Skip to content

fix: [#983] upgrade go-sqlite3 and drop the unnecessary embed import - #31

Merged
hwbrzzl merged 1 commit into
goravel:masterfrom
darakanoit:fix/drop-sqlite3-embed
Sep 20, 2026
Merged

hwbrzzl merged 1 commit into
goravel:masterfrom
darakanoit:fix/drop-sqlite3-embed

Conversation

@darakanoit

@darakanoit darakanoit commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

📑 Description

Closes goravel/goravel#983

sqlite.go and docker.go both import github.com/ncruces/go-sqlite3/embed. Since go-sqlite3 v0.33.2 that package is an empty stub whose init prints:

If you're reading this, you're unnecessarily importing github.com/ncruces/go-sqlite3/embed.

The driver still pins go-sqlite3 v0.25.0, so the line only shows up once an application pulls a newer version into the build, which is what the reporter hit. A plain app that imports the driver and requires go-sqlite3 v0.35.5 prints the warning on every start.

This raises the minimum Go version for anyone using the driver from 1.25 to 1.26, since that is what go-sqlite3 requires from v0.33.2 on. It is the reason the upgrade has been sitting: happy to hold it for a release where a bump like that is acceptable.

What changed

  • go-sqlite3 v0.25.0 → v0.35.5, gormlite v0.24.0 → v0.34.0
  • both _ "github.com/ncruces/go-sqlite3/embed" imports removed
  • dialector.go (a copy of gormlite's sqlite.go) picks up the one upstream change since v0.24: a clause builder set by the caller is no longer overwritten
  • go.mod moves to go 1.26.0

Since v0.33.2 the SQLite wasm build is compiled to Go with wasm2go instead of being embedded and interpreted, so github.com/tetratelabs/wazero is gone from the dependency graph.

Verification

A small app that imports the driver and requires go-sqlite3 v0.35.5:

output
master If you're reading this, you're unnecessarily importing... then app started
this branch app started

go test ./... passes, including TestDockerTestSuite, which builds a database, writes to it and refreshes it.

Trade-off worth knowing: the compiled SQLite makes binaries larger. The same app built against the current default (go-sqlite3 v0.25.0) is 25.1 MB, against this branch 29.3 MB. Speed is unchanged in a rough check: 50k inserts in one transaction take ~45ms before and ~42ms after, a count/sum over them 3ms and 4ms.

Scope

  • go.mod, go.sum: dependency upgrade
  • sqlite.go, docker.go: one import each
  • dialector.go: the upstream clause builder change

No public API changed.

✅ Checks

  • Added test cases for my code

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@6abd3bd). Learn more about missing BASE report.

Files with missing lines Patch % Lines
dialector.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master      #31   +/-   ##
=========================================
  Coverage          ?   38.15%           
=========================================
  Files             ?       11           
  Lines             ?      629           
  Branches          ?        0           
=========================================
  Hits              ?      240           
  Misses            ?      389           
  Partials          ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hwbrzzl hwbrzzl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@hwbrzzl
hwbrzzl merged commit 942367d into goravel:master Sep 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Getting "If you're reading this, you're unnecessarily importing github.com/ncruces/go-sqlite3/embed"

3 participants