-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Remove dependency on CGO #349
Conversation
This commit changes the SQLite dependency to one that does not depend on CGO. It uses a C-to-Go translated sqlite library that is Pure go.
Oh! Didn't know about this module. Cool! |
Oh! Awesome! I didn't know about this library either! |
There is one drawback, I had to set concurrent connections for SQLite to one, I am not sure if that actually has a practical difference as I suspect the whole thing is loaded to memory, But can't confidently merge it until I have poked around a bit more. I'll let you know what I'll find and click ready. |
Current state of this, I think I can look a bit more tomorrow:
Unanswered question: Does that actually matter in our case?
but for the same reasons as above, I dont think it matters over the other practical gains... Benchmarks: https://github.com/glebarez/go-sqlite/tree/master/benchmark I'll try to investigate the single connection a bit, might be something I did, or it might not matter. @juanfont @cure thoughts on the benefits vs drawbacks? edit: One other "risk" is that the library is not official, it is mentioned on GORMs website, but there could be a risk of it becoming unmaintained, on the other hand, it might become official. |
I don't think that in principle, a single concurrent connection is going to be a problem for our use case. Any delays because of this are unlikely to be significant for small-ish sites. And if it becomes a problem, the site can always switch to PostgreSQL. Maybe we could somehow measure connection contention and expose it as a metric? But that should probably be a separate story, and it may not be worth the effort. I'm not concerned about the library being official or not. If it becomes unmaintained later, we can deal with that then. Getting rid of CGO is really nice and will speed up builds etc! |
This commit changes the SQLite dependency to one that does not depend on
CGO. It uses a C-to-Go translated sqlite library that is Pure go.