ariga / atlas

Manage your database schema as code
https://atlasgo.io
Apache License 2.0
5.37k stars 236 forks source link

Error: sql/schema: unsupported dialect "libsql" #2338

Open arjunyel opened 7 months ago

arjunyel commented 7 months ago

When running the command: atlas migrate apply --env "turso" I get the error Error: sql/schema: unsupported dialect "libsql"

My atlas.hcl:

env "turso" {
  url     = "libsql+ws://127.0.0.1:8080"
  exclude = ["_litestream*"]
}
masseelch commented 7 months ago

Can you provide me the output of atlas version, please?

arjunyel commented 7 months ago

@masseelch Thank you for taking a look friend! atlas version v0.15.1-143f43e-canary

masseelch commented 7 months ago

For versioned migrations, Atlas stores some meta-data about the migration process in a separate table / schema. We use Ent for this, but Ent does not have support for libsql which is the reason it does not work. (If I recall correctly, there was some issue with time.Time parsing).

cc @haaawk, who added the turso integration.

haaawk commented 7 months ago

We fixed the time.Time parsing in libsql client so maybe it will be enough to update it's version it Atlas. I will send a PR

haaawk commented 7 months ago

This might help https://github.com/ariga/atlas/pull/2341

arjunyel commented 7 months ago

Does libsql support still need to be added to ent for this to work?

haaawk commented 7 months ago

Does libsql support still need to be added to ent for this to work?

Not sure. It's been a while since I checked ent.

arjunyel commented 7 months ago

For versioned migrations, Atlas stores some meta-data about the migration process in a separate table / schema. We use Ent for this, but Ent does not have support for libsql which is the reason it does not work. (If I recall correctly, there was some issue with time.Time parsing).

cc @haaawk, who added the turso integration.

I think based on this message Ent is where the error is originating from

asterikx commented 7 months ago

I get the same error with Turso with versioned migrations, declarative workflow works just fine.

atlas version v0.15.1-96e920d-canary

arjunyel commented 6 months ago

@haaawk is it possible to add Ent support to the TODO list? 😄 Thank you friend

arjunyel commented 4 months ago

@haaawk sorry for the ping again, is there somewhere we can officially request this feature and get it tracked?

haaawk commented 4 months ago

I put Ent support on my list but unfortunately there are many other items with higher priority at the moment.

libsql-client-go supports already time.Time so maybe it's enough to update the libsql-client-go version that atlas is using. I encourage you to give it a try :).

arjunyel commented 3 months ago

@PietervdWerk hi friend, how come you said this isn't an Ent issue when the Atlas maintainer above said they use Ent for the versioned migrations? Atlas does work already for declarative migrations