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

[C bindings] Have a single API function for opening all sorts of databases #1480

Open
pdenapo opened this issue Jun 16, 2024 · 1 comment
Open

Comments

@pdenapo
Copy link
Contributor

pdenapo commented Jun 16, 2024

It would be nice to have an API that can open any type of connection (like you would for instace do in javascript using libsql-js) with a given URL / database location.

Futhermore, the C API seems to be no where documented. After some testing, I have found the following

  1. libsql_open_ext works with

":memory:"
"file:prueba.db"

  1. but for a remote http connection like

"http://127.0.0.1:8080"
"libsql://yourdb-username.turso.io"

you need to use libsql_open_remote. But this function does not understand the

":memory:"
"file:prueba.db"

schemas.

@pdenapo
Copy link
Contributor Author

pdenapo commented Jun 16, 2024

You can see my test program at my libsql-C-testing repository

There I have created also a function int libsql_open_any that does exactly this. If you think that this is a good idea, I may submit a pull request. But may be this just must be the
default libsql_open_remote behavoir.

(But perhaps you already have an API for doing this, I don't know)

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

1 participant