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 dialect in ent #3112

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

delkopiso
Copy link

@delkopiso delkopiso commented Sep 11, 2024

What's up

Versioned migrations fail for libsql with sql/schema: unsupported dialect "libsql" error. This happens because Ent is expecting one of dialect.MySQL, dialect.Postgres, or dialect.SQLite. Since this project already registers a libsql driver in the ariga.io/atlas/sql/sqlite package, it's reasonable to also do a simple remapping of the client's name to match Ent's expected driver dialect.

What this does:

  • Sets the Name property of *sqlclient.Client to "sqlite3" if the Name begins with "libsql".
  • Updates the libsql client to the github.com/tursodatabase/libsql-client-go to fix a time parsing error in the old libsql client.

Fixes #2338

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

Successfully merging this pull request may close these issues.

Error: sql/schema: unsupported dialect "libsql"
1 participant