Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support libSQL adapter #5808

Open
TzviPM opened this issue Feb 26, 2024 · 2 comments
Open

Support libSQL adapter #5808

TzviPM opened this issue Feb 26, 2024 · 2 comments

Comments

@TzviPM
Copy link

TzviPM commented Feb 26, 2024

Environment

Knex version: N/A
Database + version: libsql
OS: N/A

Feature discussion / request

  1. Explain what is your use case

I would like to use libSQL (https://github.com/tursodatabase/libsql) as an adapter. Locally, I will use a sqlite file, and then, in production, I will use something like Turso.

  1. Explain what kind of feature would support this

Adding a new adapter for libsql or adding infrastructure to support 3rd party adapters (If that exiosts already, please kindly point me to the docs or an example :) )

  1. Give some API proposal, how the feature should work

Similarly to better-sqlite3, simple define libsql as the adapter.

I would love to contribute to the poject either by:

  1. Building a libsql adapter and creating a PR to contribute it back to knex
  2. Helping to act as a tester for an API that allows 3rd party adapters.
@rluvaton
Copy link
Member

Custom dialects are supported

See this for example:

https://github.com/Tomas2D/knex-firebird-dialect

We should better document it though, a PR for that welcome

@TzviPM
Copy link
Author

TzviPM commented Feb 27, 2024

One thing I'm noticing so far is that there are documentation-esque comments in the code that are not doc comments. For example, in client.js:

// The base client provides the general structure
// for a dialect specific client object.

class Client extends EventEmitter {

Also, I'm wondering how it will work to build a dialect in pure typescript. There are type definitions for the external APIs, but not for the client code, AFAICT. Turns out there are type definitions for the Client API 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants