Closed KamWithK closed 10 months ago
The libsql://
protocol implies remote access right now. @haaawk, is this use case supported where you use local files only?
The
libsql://
protocol implies remote access right now. @haaawk, is this use case supported where you use local files only?
Ah I see, makes sense
Would definitely be useful to be able to use it from a file as well though!
Maybe you could do libsql+file://
for file databases or something
From a quick search through your code you've imported libsql-client-go
, sql.open("libsql", "file:/local.db")
allows you to read a local libsql database
Guessing the problem is here, libsql by itself isn't registered as a flavour (unlike for sqlite
above): https://github.com/ariga/atlas/blob/2b47d884c6383bbc4e8a283d01cea85fb0b6c2f2/sql/sqlite/driver.go#L68-L71
Looks like memory mode is also not supported for libsql either
Maybe adding sqlclient.RegisterFlavours("libsql+file", "libsql+file"),
would solve the problem.
That should fix the problem https://github.com/ariga/atlas/pull/2203
I'm trying to use Atlas but if I set up my atlas.hcl as such:
Then I get this error (when for example I run a command like
atlas migrate diff --env local
):Does atlas only support LibSQL when run with Turso or as a server?
I could modify it to just use sqlite instead of libsql for local tests but then libsql supports some features which libsql does not (for example random row id), and so atlas would give an error when trying to use one of those