Skip to content

libsql support#4436

Open
coffe-cafe-zed wants to merge 1 commit into
ent:masterfrom
coffe-cafe-zed:libsql
Open

libsql support#4436
coffe-cafe-zed wants to merge 1 commit into
ent:masterfrom
coffe-cafe-zed:libsql

Conversation

@coffe-cafe-zed

Copy link
Copy Markdown

I have been using ent with https://turso.tech in development for a couple of month now and everything is working well except for creating records using ent.

Whenever I call .Save() function, the record will be created but and error will be returned. I dug into the issue and found that libsql does not support the "RETURNING" clause, just like MySQL.

This change is working well for me, but I am not sure if I need to do a full libsql driver.

Example connection:

	drv, err := sql.Open("libsql", viper.GetString("turso_database_url")+"?authToken="+viper.GetString("turso_auth_token"))
	if err != nil {
		config.Logger.Error("failed to open db", zap.Error(err))
		os.Exit(1)
	}

	Client := gen.NewClient(gen.Driver(drv))

@a8m

a8m commented Sep 1, 2025

Copy link
Copy Markdown
Member

I think you can do this instead: #1667 (comment)

We don’t have the capacity to support Turso as non of us is using this service atm.

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.

2 participants