ConduitPlatform / Conduit

Batteries-included backend that works with any stack.

Home Page:https://getconduit.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Database module triggers introspection process on unpopulated dbs

kon14 opened this issue · comments

Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the Issue Tracker for a bug that matches the one I want to file, without success.
  • This issue is not related to the Conduit Admin Panel user interface.

Conduit version

0.12.6

Describe the Bug

While the Database module is being brought up it checks whether the database it's attempting to connect to has previously been used with Conduit, otherwise it attempts to introspect it.

Specifically, it calls the active adapter's isConduitDb() function, which returns true in case there are Core schemas available.

This check will obviously fail on a fresh db, but that shouldn't initiate an introspection process on a non-populated database.

Thankfully, this won't crash right now, but it shouldn't be the case anyway.

Expected Behavior

On isConduitDb() === false, the Database module should actually check whether the database is devoid of any user generated collections before moving on with introspection.

How to Reproduce

  1. Bring up Conduit with an unpopulated database.
  2. Notice how the introspection process gets triggered.

Additional Information

No response

Environment

No response