-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Upgrade sqlite3 to the latest version. #34
Comments
You may want to have a look at: https://github.com/ValentinMontmirail/go-sqlcipher |
@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 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 |
@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. |
This package is using a the version
3.30.1
from sqlite3 which doesn't supportRETURNING
that a lot oforms
use when creating new record in the database, I tried forking the package and using the upgrade script, but thepragma key
is no longer working.The text was updated successfully, but these errors were encountered: