tursodatabase / turso-cli

Command line interface to Turso.
https://turso.tech
MIT License
215 stars 35 forks source link

allow users developing locally to use extensions #636

Open glommer opened 1 year ago

glommer commented 1 year ago

Users wanting to use extensions today, miss out on local development experience. For file URL users, the client doesn't provide a good way to bring in and load the extensions: we miss both a libsql-level API, and a smooth way to specify them, since in the service, extensions are enabled on the server-side.

For turso dev, our serverless friends, this is easier: we would have to download the extensions for the user's architecture (unfortunately not much we can do if the user is on a non-supported architecture), put them somewhere, and configure sqld to load them.

The ok experience is turso dev --enable-extensions. The great experience is what @CodingDoug once suggested: turso dev --from-prod <name-of-turso-db>. This would create a db as close as possible to the prod db. That would include but not be limited to extensions. We can go as far as creating a local db with the same schema as the remote db, but also match the sqld version, and any other relevant configuration.

fforres commented 1 year ago

JIC it adds to this. We've been playing around w/ automating db creation and loading extensions on DBs for my test suite.

(Pretty much going through this process through some scripts)

And we started getting issues on mac, (identity of the developer cannot be recognized / verified). Makes it a bit shady to ask contributors to adjust security settings to just run the project, (or run it w/ sudo) 😅

Thanks a lot for all the work on Turso / libsql 🙏