Repository navigation
Use the module path of this fork in the examples - #8
Merged
Merged
Conversation
The examples still imported github.com/mattn/go-sqlite3, which this module does not provide, so they did not build in it: go build ./_example/simple fails with "no required module provides package github.com/mattn/go-sqlite3". The custom_driver_name Makefile sets driverName under the same path with -X, which the linker silently ignores for a package it does not link. Use github.com/CovenantSQL/go-sqlite3-encrypt in all of them. The Dockerfile of the simple example builds it in a module of its own that replaces the imported module with the checkout, so its replace directive changes with the import; otherwise the image would be built with the latest release instead of the checkout.
The json, mod_regexp and simple examples listed the module among the standard library imports, so goimports reported them. The previous commit changed those import lines, so give the module its own group.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The examples under
_examplestill importgithub.com/mattn/go-sqlite3, which this module does not provide, so they do not build in it: ondevelop,go build ./_example/simplefails withno required module provides package github.com/mattn/go-sqlite3, and so does every other example. Thecustom_driver_nameMakefile also setsdriverNameunder that path with-X, which the linker silently ignores when no such package is linked.The first commit replaces the path with
github.com/CovenantSQL/go-sqlite3-encrypteverywhere under_example, including the-Xflag and thereplacedirective in the Dockerfile of thesimpleexample. That Dockerfile builds the example in a module of its own that replaces the imported module with the checkout; with only the import changed,go mod tidythere would fetch the latest release of this module from the proxy instead, and the image would no longer test the checkout. The second commit gives the module its own import group in the three examples that listed it among the standard library, asgoimportsdoes.Only examples change; the package itself does not, so CovenantSQL and query results are unaffected.
Left out:
mod_regexpC extension (itsextension.gobuilds; the C part needspcre.h), which are separate updates.go get github.com/mattn/go-sqlite3lines in the README: they are in the README of go-sqlite3, which the README of this fork quotes below its own section..github/workflows/docker.yamlbuilds the Dockerfile only for tags and for PRs tomaster, so this PR's checks do not run it; it was built by hand as described below.Testing
On linux/amd64 (Debian trixie container
cql-ci:go1.27), Go 1.27.3,--cpus 4, ondevelopand on this branch:go build -tags "sqlite_vtable sqlite_trace" ./_example/<dir>forcustom_func,hook,json,limit,simple,trace,vtableandvtable_eponymous_only;go build ./_example/fuzz;go build extension.goinmod_regexpandmod_vtable, as their Makefiles do;makeincustom_driver_name;go vetof the Go examples. All fail ondevelopwith the missing module and pass on this branch.custom_driver_namebinary built by its Makefile printsmy-sqlite3, and thesimplebinary prints99 こんにちは世界099.gofmt -l _exampleandgoimports -l _example(x/tools v0.52.0) report nothing; ondevelop,goimportsreports the three files of the second commit.simpleDockerfile, with its base image pulled through a registry mirror, apk switched to a mirror andENV GOPROXY=offadded so that nothing can come from the module proxy, built and ran as.github/workflows/docker.yamldoes: it passes ondevelopand on this branch, and printed99 こんにちは世界099; with this branch's examples anddevelop's Dockerfile,go mod tidyfails, as it looks forgithub.com/CovenantSQL/go-sqlite3-encryptin the proxy.