go-rpmdb icon indicating copy to clipboard operation
go-rpmdb copied to clipboard

failed to open sqlite3: sql: unknown driver "sqlite" (forgotten import?)

Open jerome-diver opened this issue 1 year ago • 2 comments

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.

jerome-diver avatar Sep 18 '24 02:09 jerome-diver

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

djoreilly avatar Oct 30 '24 11:10 djoreilly

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.

royroyee avatar Nov 06 '24 10:11 royroyee