### Install Sqinn-Go Source: https://github.com/cvilsmeier/sqinn-go/blob/master/README.md Installs the latest version of the Sqinn-Go library using the go get command. ```bash go get -u github.com/cvilsmeier/sqinn-go/v2 ``` -------------------------------- ### Test Sqinn-Go Source: https://github.com/cvilsmeier/sqinn-go/blob/master/README.md Provides commands to fetch, install, and run the automated tests for the Sqinn-Go library, including checking test coverage. ```bash go mod init test go get -v -u github.com/cvilsmeier/sqinn-go/v2 go test github.com/cvilsmeier/sqinn-go/v2 ``` ```bash go test github.com/cvilsmeier/sqinn-go/v2 -coverprofile=cover.out go tool cover -html=cover.out ``` -------------------------------- ### Update Sqinn Binaries with Gzip Source: https://github.com/cvilsmeier/sqinn-go/blob/master/prebuilt/howto.md This snippet demonstrates how to update prebuilt sqinn binaries by downloading them, extracting, and then compressing them using gzip for embedding. It covers Linux, Windows, and macOS architectures. ```bash cd prebuilt cat ~/Downloads/dist-linux-amd64/sqinn | gzip > linux-amd64.gz cat ~/Downloads/dist-windows-amd64/sqinn.exe | gzip > windows-amd64.gz cat ~/Downloads/dist-darwin-amd64/sqinn | gzip > darwin-amd64.gz cat ~/Downloads/dist-darwin-arm64/sqinn | gzip > darwin-arm64.gz ``` -------------------------------- ### Basic Sqinn-Go Usage Source: https://github.com/cvilsmeier/sqinn-go/blob/master/README.md Demonstrates the fundamental usage of Sqinn-Go, including launching Sqinn, creating a table, inserting data, and querying records. It shows how to manage the Sqinn process lifecycle and handle data types. ```go import ( "fmt" "github.com/cvilsmeier/sqinn-go/v2" ) func main() { // Launch sqinn, close when done. sq := sqinn.MustLaunch(sqinn.Options{ Db: ":memory:", // use a transient in-memory database }) defer sq.Close() // Create a table, cleanup when done sq.MustExecSql("CREATE TABLE users (id INTEGER PRIMARY KEY NOT NULL, name TEXT)") defer sq.MustExecSql("DROP TABLE users") // Insert users sq.MustExecParams("INSERT INTO users (id, name) VALUES (?, ?)", 3, 2, []sqinn.Value{ sqinn.Int32Value(1), sqinn.StringValue("Alice"), sqinn.Int32Value(2), sqinn.StringValue("Bob"), sqinn.Int32Value(3), sqinn.StringValue("Carol"), }) // Query users rows := sq.MustQueryRows( "SELECT id, name FROM users WHERE id >= ? ORDER BY id", []sqinn.Value{sqinn.Int32Value(0)}, // query parameters []byte{sqinn.ValInt32, sqinn.ValString}, // fetch id as int, name as string ) for _, values := range rows { fmt.Printf("user id=%d, name=%s\n", values[0].Int32, values[1].String) } // Output: // user id=1, name=Alice // user id=2, name=Bob // user id=3, name=Carol } ``` -------------------------------- ### Specify Custom Sqinn Path Source: https://github.com/cvilsmeier/sqinn-go/blob/master/README.md Shows how to configure Sqinn-Go to use a custom-compiled Sqinn binary by providing the path to the executable in the launch options. ```go sq := sqinn.MustLaunch(sqinn.Options{ Sqinn: "/path/to/sqinn", }) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.