R
Railway10mo ago
Nuke

"error": "Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub"

I am trying to deploy my golang web api which uses sqlite db to store and retrieve data. I tried to add CGO_ENABLED=1 in the env variables but then it shows that gcc is not available . What should I do ?
Solution:
use a pure go sqlite adapter
Jump to solution
10 Replies
Percy
Percy10mo ago
Project ID: N/A
Solution
Brody
Brody10mo ago
use a pure go sqlite adapter
Nuke
Nuke10mo ago
the one without cgo ?
Brody
Brody10mo ago
yep
Nuke
Nuke10mo ago
Okay , will try that.
Brody
Brody10mo ago
and set CGO_ENABLED back to 0
Nuke
Nuke10mo ago
Okay Thanks
Brody
Brody10mo ago
no problem!
Nuke
Nuke10mo ago
It worked ,thanks.
Brody
Brody10mo ago
no problem!