Skip to content

Add pure-go (-nocgo) sqlite variant#678

Merged
brandond merged 2 commits into
k3s-io:masterfrom
brandond:sqlite-nocgo
May 30, 2026
Merged

Add pure-go (-nocgo) sqlite variant#678
brandond merged 2 commits into
k3s-io:masterfrom
brandond:sqlite-nocgo

Conversation

@brandond

@brandond brandond commented May 28, 2026

Copy link
Copy Markdown
Member

This is a from-scratch rework of #557 with the unnecessary changes left out.

  • Uses sqlite from modernc.org/sqlite
  • Adds -nocgo binaries and image tags
  • Same CI coverage as the current cgo sqlite variant from github.com/mattn/go-sqlite3

Other than package names, the only differences between variants are:

  • WAL fcntl callback interface (for litespeed)
  • Format of pragmas in DSN query string
  • Error code translation

Linked issues:

Note: the cgo variant is actually 1mb smaller:

-rwxr-xr-x  1 brandond brandond 47263816 May 29 05:25 kine
-rwxr-xr-x  1 brandond brandond 48349368 May 29 05:22 kine-nocgo

@brandond
brandond force-pushed the sqlite-nocgo branch 9 times, most recently from a8f7eae to f0fc74b Compare May 29, 2026 04:58
@brandond brandond changed the title [WIP] Add support for pure-go sqlite Add CGO_ENABLED=0 (nocgo) sqlite variant May 29, 2026
@brandond
brandond marked this pull request as ready for review May 29, 2026 05:13
@brandond
brandond requested a review from a team as a code owner May 29, 2026 05:13
@brandond
brandond force-pushed the sqlite-nocgo branch 4 times, most recently from c5d2867 to 50aa883 Compare May 29, 2026 07:27
@brandond brandond changed the title Add CGO_ENABLED=0 (nocgo) sqlite variant Add pure-go (-nocgo) sqlite variant May 29, 2026

@dereknola dereknola left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we duplicate the sqlite_cgo_test.go to also cover some of the pure-go sqlite implementation? Even if its a duplication of the unit test, we should have some coverage of these funtions.

Comment thread .github/workflows/pr.yml Outdated
@brandond
brandond force-pushed the sqlite-nocgo branch 2 times, most recently from 4946843 to 761fa53 Compare May 29, 2026 18:13
@brandond
brandond requested a review from dereknola May 29, 2026 18:13
@brandond
brandond force-pushed the sqlite-nocgo branch 3 times, most recently from 7fd5a94 to 29cc638 Compare May 29, 2026 22:25
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
@brandond
brandond merged commit 0972433 into k3s-io:master May 30, 2026
68 of 69 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.

3 participants