Skip to content

dal-go/dalgo2sqlite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dalgo2sqlite

SQLite-specific DALgo driver. Wraps github.com/dal-go/dalgo2sql to provide the dal.DB surface, and adds SQLite-native implementations of:

  • dbschema.Adapter — schema introspection via sqlite_master and pragma_table_info
  • ddl.Applier — SQLite-flavored CREATE TABLE / CREATE INDEX / DROP TABLE etc.
  • dal.ConcurrencyAware — advertises Concurrency() = 1 for write paths (SQLite is single-writer)

Used by consumers (e.g. datatug-cli's db copy) that need schema-modification and concurrency hints through the unified DALgo abstraction without hand-rolling engine-specific SQL.

Our approach to development

We build with our own tooling:

  • SpecScore — specify requirements as SpecScore.md artifacts
  • SpecStudio — author & manage specs across their lifecycle
  • inGitDB — store structured data in Git where applicable
  • DALgo — data access layer for Go
  • cover100.dev — drive toward 100% test coverage
  • DataTug — query & explore data

SQLite driver: modernc.org/sqlite (pure Go, CGO_ENABLED=0)

This package uses modernc.org/sqlite — a pure-Go transpilation of the SQLite C library — instead of the former github.com/mattn/go-sqlite3 cgo binding. The migration was done because:

  • The cgo driver required a C toolchain in every build environment (CI, containers, cross-compilation targets).
  • It prevented single static binaries for downstream consumers such as datatug-cli.
  • modernc.org/sqlite exposes the same database/sql interface (driver name "sqlite" instead of "sqlite3"), so dalgo2sql continues to work unchanged.
  • All existing SQLite features relied on here — sqlite_master introspection, PRAGMA table/index queries, transactional DDL — behave identically under the pure-Go driver.

The cgo_enabled: true flag can be removed from this repo's CI workflow and from any downstream workflow that no longer needs cgo for other reasons.

About

SQLite-specific DALgo driver: dbschema, ddl, ConcurrencyAware on top of dalgo2sql

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages