Open hairyhenderson opened 2 weeks ago
@hairyhenderson please add one or more appropriate labels. Here are some tips:
if you are making an issue, TODO, or reminder for yourself or your team, please add one label that best describes the product or feature area. Please also add the issue to your project board. :rocket:
if you are making an issue for any other reason (docs typo, you found a bug, etc), please add at least one label that best describes the product or feature that you are discussing (e.g. area/alerting
, datasource/loki
, type/docs
, type/bug
, etc). Our issue triage doc also provides additional guidance on labeling. :rocket:
Thank you! :heart:
Upon reading closer about github.com/glebarez/go-sqlite
I realize my initial impression of modernc.org/sqlite
was mistaken - I thought the latter had no database/sql
driver, hence the former. However both have drivers. The reason glebarez/go-sqlite
exists is explained here: https://github.com/glebarez/go-sqlite/issues/96 - essentially:
glebarez/go-sqlite
is just a fork ofmodernc.org/sqlite
with slight changes in the driver part (2), to behave more closely to mattn’s CGo driver (https://github.com/mattn/go-sqlite3). this slight changes allowed it to be fully compatible with GORM [...]
This may or may not be relevant, as we're currently using the mattn
driver, and that with xorm
, which, while different from GORM, raises questions about whether or not modernc.org/sqlite
will work without too much trouble on its own.
https://github.com/cvilsmeier/go-sqlite-bench also lists a number of other candidate modules:
(copy/pasted from the README, and annotated by me):
So, we're left with effectively 3 options:
IMO it's worth experimenting with these three, starting with modernc.org/sqlite
.
Why is this needed:
Currently we need to build the Grafana backend with
CGO_ENABLED=1
because of our use ofgithub.com/mattn/go-sqlite3
. A pure Go alternative is available -github.com/glebarez/go-sqlite
.We should consider using this to simplify our build process (remove cross-compilation considerations, etc).