supabase-community / seed

Automatically seed your database with production-like dummy data based on your schema for local development and testing.
MIT License
381 stars 15 forks source link

fix: better-sqlite3 database arguments #155

Closed avallete closed 4 months ago

avallete commented 4 months ago

I've tough about also waiting to have a valid introspection before exiting the loop, but that was making the logic leak quite a bit and starting to look spaghetti. So I have opted for keeping the separations of concerns as it is.

Fixes S-2093

linear[bot] commented 4 months ago
S-2093 Waiting for connection does not work correctly for sqlite

I ran into an issue when testing for sqlite db, where the place where we wait for a valid connection would stop waiting as soon as we have a `seed.config.ts` (before we have provided a valid connection). Then during introspection, the cli fails and shows an error message about the db not having any tables in it. It might be because better-sqlite3 does not require any args for the client connection to be valid (maybe it creates a new one by default?).