Upgrade sqlite3 to the latest version.
This package is using a the version 3.30.1 from sqlite3 which doesn't support RETURNING that a lot of orms use when creating new record in the database, I tried forking the package and using the upgrade script, but the pragma key is no longer working.

You may want to have a look at: https://github.com/ValentinMontmirail/go-sqlcipher I just updated to SQLite 3.45.0 (This pre-release for now)
@ValentinMontmirail Thank you, I will try it out soon and give you feedback.
@ValentinMontmirail I cloned your repo locally and replaced the dependency, the issue is the database file doesn't get encrypted, am using it with ent like this
var Client *ent.Client
func Init() {
client, err := ent.Open("sqlite3", "file:ent.sqlite?_key=secret&cache=shared&_fk=1")
if err != nil {
log.Fatalf("failed opening connection to sqlite: %v", err)
}
if err := client.Schema.Create(context.Background()); err != nil {
log.Fatalf("failed creating schema resources: %v", err)
}
Client = client
}
the database file can be viewed.
That's odd. I will have a look. Thanks for the feedback !
@ValentinMontmirail maybe am doing it wrong, if so, please provide an example that I can use.
Should be better now. Can you retry with github.com/ValentinMontmirail/go-sqlcipher v0.0.0-20231219102833-c47b144b2843 ?
@ValentinMontmirail same thing, can you publish an example? maybe am doing something wrong.
You will find in attachment, a very small example where the *sql.DB object generated after encryption can be used by an ORM. Basically, it uses automatically-generated type-safe interfaces for your queries.
There is also a Docker image on alpine to make it run safely.