go-rpmdb
go-rpmdb copied to clipboard
failed to open sqlite3: sql: unknown driver "sqlite" (forgotten import?)
The title is the error message at run time. Fedora-40 distro. I use the Packages RPM DB to be /var/lib/rpm/rpmdb.sqlite file as a string. So maybe i do not understand what "RPM DB" is in this context (a string of what ? i imagine the file name of the database, but...). Or something went wrong with the driver. I hear about different database used by rpm depend of the distribution. Fedora use sqlite3 database. I read about openSuse to use ndb.
Maybe you need to do add _ "github.com/glebarez/go-sqlite" to your imports like this:
https://github.com/knqyf263/go-rpmdb/blob/facee9e1ddafec177b8e3159f61fb747c0762bdf/cmd/rpmdb/main.go#L10
I had the same issue, and adding _ "github.com/glebarez/go-sqlite" to the imports resolved it for me as well.
It would be helpful to have this noted in the README for others who might run into the same problem.