Artifact a879644e9fd9761b7991dd8cc93c3ed89d5717943a87a237e1d5831c58252028:
- File
hub/driver.go
— part of check-in
[754914fd82]
at
2026-05-13 20:27:25
on branch trunk
— refactor(hub): register modernc SQL driver internally (#166)
The hub package promised consumers wouldn't need to import libfossil directly, but they still had to blank-import libfossil's SQL driver to satisfy the underlying db layer's registration requirement. Move the blank import into hub itself (hub/driver.go) so the package fulfills its own dependency.
Consumers like sesh can now reduce their main.go to a plain `import "github.com/danmestas/EdgeSync/hub"` (or whatever wrapper they use) without taking a direct dep on libfossil's internal SQL machinery.
modernc is registered as the production default. If a consumer ever needs ncruces (WASM/WASI), an escape hatch can be added then.
Tests in hub/ drop their now-redundant blank imports.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> (user: [email protected], size: 639) [annotate] [blame] [check-ins using]
package hub // libfossil's db layer requires a SQL driver to be registered before any // Repo can be opened. Registering it here means consumers of EdgeSync can // `import "github.com/danmestas/EdgeSync/hub"` without also taking a direct // dependency on libfossil's internal SQL machinery — the package doc // promise that consumers don't need to import libfossil holds end-to-end. // // modernc is the production default. If a consumer ever needs ncruces // (WASM/WASI), expose an escape hatch then — don't preemptively widen // the API surface for a hypothetical caller. import _ "github.com/danmestas/libfossil/db/driver/modernc"