Open aymanbagabas opened 1 year ago
This implements a pure-go alternative driver whenever CGO_ENABLED=0
Related: https://github.com/go-gorm/sqlite/pull/93 Fixes: https://github.com/go-gorm/sqlite/issues/35 Fixes: https://github.com/go-gorm/sqlite/issues/72 Fixes: https://github.com/go-gorm/sqlite/issues/77 Fixes: https://github.com/go-gorm/sqlite/issues/160
This PR uses a pure-go implementation of SQLite using https://gitlab.com/cznic/sqlite whenever CGO_ENABLED is disabled, and uses https://github.com/mattn/go-sqlite3 when CGO is enabled.
CGO_ENABLED
As shown in https://github.com/go-gorm/sqlite/issues/77 https://github.com/go-gorm/sqlite/issues/72 https://github.com/go-gorm/sqlite/pull/93 https://github.com/go-gorm/sqlite/issues/35, sometime CGO is inconvenient.
DSNs are different between drivers. Having code that behaves silently behaves significantly differently because the C compiler toolchain is not installed is a bad idea, IMO.
This implements a pure-go alternative driver whenever CGO_ENABLED=0
Related: https://github.com/go-gorm/sqlite/pull/93 Fixes: https://github.com/go-gorm/sqlite/issues/35 Fixes: https://github.com/go-gorm/sqlite/issues/72 Fixes: https://github.com/go-gorm/sqlite/issues/77 Fixes: https://github.com/go-gorm/sqlite/issues/160
What did this pull request do?
This PR uses a pure-go implementation of SQLite using https://gitlab.com/cznic/sqlite whenever
CGO_ENABLED
is disabled, and uses https://github.com/mattn/go-sqlite3 when CGO is enabled.User Case Description
As shown in https://github.com/go-gorm/sqlite/issues/77 https://github.com/go-gorm/sqlite/issues/72 https://github.com/go-gorm/sqlite/pull/93 https://github.com/go-gorm/sqlite/issues/35, sometime CGO is inconvenient.