{"id":13412283,"url":"https://github.com/cvilsmeier/sqinn-go","last_synced_at":"2026-01-16T20:34:20.059Z","repository":{"id":53516813,"uuid":"270098255","full_name":"cvilsmeier/sqinn-go","owner":"cvilsmeier","description":"Golang SQLite without cgo","archived":false,"fork":false,"pushed_at":"2026-01-11T22:18:59.000Z","size":10451,"stargazers_count":510,"open_issues_count":0,"forks_count":17,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-01-12T02:01:38.124Z","etag":null,"topics":["golang","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cvilsmeier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-06-06T20:37:12.000Z","updated_at":"2026-01-11T22:11:33.000Z","dependencies_parsed_at":"2025-08-21T12:32:16.918Z","dependency_job_id":null,"html_url":"https://github.com/cvilsmeier/sqinn-go","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/cvilsmeier/sqinn-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvilsmeier%2Fsqinn-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvilsmeier%2Fsqinn-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvilsmeier%2Fsqinn-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvilsmeier%2Fsqinn-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cvilsmeier","download_url":"https://codeload.github.com/cvilsmeier/sqinn-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvilsmeier%2Fsqinn-go/sbom","scorecard":{"id":313417,"data":{"date":"2025-08-11","repo":{"name":"github.com/cvilsmeier/sqinn-go","commit":"3860b4982b96729e50ae499233ed4bd0aa552ee8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Maintained","score":2,"reason":"3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: prebuilt/linux/sqinn2:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/linux.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/linux.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/cvilsmeier/sqinn-go/linux.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/linux.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/cvilsmeier/sqinn-go/linux.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: The Unlicense: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T23:37:50.927Z","repository_id":53516813,"created_at":"2025-08-17T23:37:50.927Z","updated_at":"2025-08-17T23:37:50.927Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28482267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","sqlite"],"created_at":"2024-07-30T20:01:22.963Z","updated_at":"2026-01-16T20:34:20.052Z","avatar_url":"https://github.com/cvilsmeier.png","language":"Go","funding_links":[],"categories":["数据库驱动程序","Go","Database Drivers","数据库驱动","数据库驱动`连接和操作数据库工具`","Relational Databases","Data Integration Frameworks","Generators"],"sub_categories":["关系数据库驱动程序","Relational Database Drivers","SQL 查询语句构建库","Advanced Console UIs"],"readme":"\n![Sqinn](logo.png \"Sqinn\")\n\n[![GoDoc Reference](https://pkg.go.dev/badge/github.com/cvilsmeier/sqinn-go/v2)](http://godoc.org/github.com/cvilsmeier/sqinn-go/v2)\n[![Go Report Card](https://goreportcard.com/badge/github.com/cvilsmeier/sqinn-go)](https://goreportcard.com/report/github.com/cvilsmeier/sqinn-go)\n[![Build Status](https://github.com/cvilsmeier/sqinn-go/actions/workflows/linux.yml/badge.svg)](https://github.com/cvilsmeier/sqinn-go/actions/workflows/linux.yml)\n[![Build Status](https://github.com/cvilsmeier/sqinn-go/actions/workflows/windows.yml/badge.svg)](https://github.com/cvilsmeier/sqinn-go/actions/workflows/windows.yml)\n[![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue.svg)](http://unlicense.org/)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)\n\nSqinn-Go is a Go (Golang) library for accessing SQLite databases without cgo.\nIt uses Sqinn \u003chttps://github.com/cvilsmeier/sqinn\u003e under the hood.\nIt starts Sqinn as a child process (`os/exec`) and communicates with\nSqinn over stdin/stdout/stderr. The Sqinn child process then does the SQLite\nwork.\n\nIf you want SQLite but do not want cgo, Sqinn-Go can be a solution.\n\n\u003e [!NOTE]\n\u003e This work is sponsored by Monibot - Easy Server and Application Monitoring.\n\u003e Try out Monibot at [https://monibot.io](https://monibot.io?ref=sqinn-go).\n\u003e It's free.\n\n\nUsage\n------------------------------------------------------------------------------\n\n```bash\ngo get -u github.com/cvilsmeier/sqinn-go/v2\n```\n\n```go\nimport (\n\t\"fmt\"\n\t\"github.com/cvilsmeier/sqinn-go/v2\"\n)\n\nfunc main() {\n\t// Launch sqinn, close when done.\n\tsq := sqinn.MustLaunch(sqinn.Options{\n\t\tDb: \":memory:\", // use a transient in-memory database\n\t})\n\tdefer sq.Close()\n\t// Create a table, cleanup when done\n\tsq.MustExecSql(\"CREATE TABLE users (id INTEGER PRIMARY KEY NOT NULL, name TEXT)\")\n\tdefer sq.MustExecSql(\"DROP TABLE users\")\n\t// Insert users\n\tsq.MustExecParams(\"INSERT INTO users (id, name) VALUES (?, ?)\", 3, 2, []sqinn.Value{\n\t\tsqinn.Int32Value(1), sqinn.StringValue(\"Alice\"),\n\t\tsqinn.Int32Value(2), sqinn.StringValue(\"Bob\"),\n\t\tsqinn.Int32Value(3), sqinn.StringValue(\"Carol\"),\n\t})\n\t// Query users\n\trows := sq.MustQueryRows(\n\t\t\"SELECT id, name FROM users WHERE id \u003e= ? ORDER BY id\",\n\t\t[]sqinn.Value{sqinn.Int32Value(0)},      // query parameters\n\t\t[]byte{sqinn.ValInt32, sqinn.ValString}, // fetch id as int, name as string\n\t)\n\tfor _, values := range rows {\n\t\tfmt.Printf(\"user id=%d, name=%s\\n\", values[0].Int32, values[1].String)\n\t}\n\t// Output:\n\t// user id=1, name=Alice\n\t// user id=2, name=Bob\n\t// user id=3, name=Carol\n}\n```\n\nFor usage examples, see `examples` directory.\n\n\nBuilding\n------------------------------------------------------------------------------\n\nThe library includes a prebuilt embedded build of sqinn for linux_amd64 and\nwindows_amd64.\n\nIf you do not want to use a prebuilt sqinn binary, you can compile sqinn\nyourself. See \u003chttps://github.com/cvilsmeier/sqinn\u003e for instructions.\nYou must then specify the path to sqinn like so:\n\n```go\nsq := sqinn.MustLaunch(sqinn.Options{\n\tSqinn: \"/path/to/sqinn\",\n})\n```\n\n\nPros and Cons\n------------------------------------------------------------------------------\n\n### Advantages\n\n- No need to have gcc installed on development machines.\n- Go cross compilation works.\n- Faster build speed than cgo (1s vs 3s for sample program).\n- Smaller binary size than cgo (2MB vs 10MB for sample program).\n\n\n### Disadvantages\n\n- No built-in connection pooling.\n- Sqinn-Go is not a Golang `database/sql` Driver.\n- Sqinn covers only a subset of SQLite's C APIs.\n\n\nPerformance\n------------------------------------------------------------------------------\n\nPerformance tests show that, for many use-cases, Sqinn-Go performance is better\nthan cgo solutions.\n\nSee \u003chttps://github.com/cvilsmeier/go-sqlite-bench\u003e for details.\n\n\nTesting\n------------------------------------------------------------------------------\n\nSqinn-Go comes with a large set of automated unit tests. Follow these steps to\nexecute all tests on linux/amd64 or windows/amd64:\n\nGet and test Sqinn-Go\n\n```bash\ngo mod init test\ngo get -v -u github.com/cvilsmeier/sqinn-go/v2\ngo test github.com/cvilsmeier/sqinn-go/v2\n```\n\n\nCheck test coverage\n\n```bash\ngo test github.com/cvilsmeier/sqinn-go/v2 -coverprofile=cover.out\ngo tool cover -html=cover.out\n```\n\nTest coverage is ~ 90% (as of August 2025)\n\n\nDiscussion\n------------------------------------------------------------------------------\n\n### Go without cgo\n\nSqinn-Go is Go without cgo, as it does not use cgo, nor does it depend on third-party\ncgo packages. However, Sqinn-Go has a runtime dependency on Sqinn, which is a\nprogram written in C. Sqinn has to be installed separately on each machine\nwhere a Sqinn-Go application is executing. For this to work, Sqinn has to be\ncompiled for every target platform. As an alternative, pre-built Sqinn binaries\nfor common platforms are included in sqinn-go or can be downloaded from the\nSqinn releases page \u003chttps://github.com/cvilsmeier/sqinn/releases\u003e.\n\n\n### No database/sql driver\n\nDatabase/sql is Go's default abstraction layer for SQL databases. It is widely\nused and there are many third-party packages built on top of it. Sqinn-Go does\nnot implement the database/sql interfaces. The reason is that the sql package\nprovides low-level function calls to prepare statements, bind parameters, fetch\ncolumn values, and so on. Sqinn could do that, too. But, since for every\nfunction call, Sqinn-Go has to make a inter-process communication\nrequest/response roundtrip to a sqinn child process, this would be very slow.\nInstead, Sqinn-Go provides higher-level Exec/Query interfaces that should be\nused in favor of low-level fine-grained functions.\n\n\n### Concurrency\n\nSqinn/Sqinn-Go performs well in non-concurrent as well as concurrent settings,\nas shown in the performance section. However, a single Sqinn instance\nis inherently single-threaded, requests are served one-after-another.\n\nIf you want true concurrency at the database level, you can spin up multiple\nSqinn instances. You may even implement a connection pool. But be aware that\nwhen accessing a SQLite database concurrently, the dreaded SQLITE_BUSY error\nmight occur. The PRAGMA busy_timeout might help to avoid SQLITE_BUSY errors.\n\n\n\nChangelog\n------------------------------------------------------------------------------\n\n### v2.1.2\n\n- update prebuilt sqinn v2.0.2\n\n\n### v2.1.1\n\n- update prebuilt sqinn v2.0.1\n\n\n### v2.1.0\n\n- bind and scan functions for converting go types to sqinn values and back\n\n\n### v2.0.2\n\n- better prebuilts (gzip and build constraints)\n\n\n### v2.0.1\n\n- ValXy const is now byte (was untyped)\n\n\n### v2.0.0\n\n- Major Version 2 (streaming protocol, less memory, faster)\n- Include prebuilt sqinn v2.0.0 (SQLite v3.50.4 (2025-07-30))\n\n\n### v1.2.0 (2023-10-05)\n\n- Added marshalling benchmark\n- Removed 'pure Go' claim\n- Removed travis build\n- Added github workflow with sqinn v1.1.27\n- Updated min. go version 1.19\n- Updated samples\n\n\n### v1.1.2 (2021-05-27)\n\n- Fixed negative int32 marshalling\n\n\n### v1.1.1 (2021-03-27)\n\n- Added more docs for Values\n- Added example for handling NULL values\n- Added example for sqlite specialties\n\n\n### v1.1.0 (2020-06-14)\n\n- Use IEEE 745 encoding for float64 values, needs sqinn v1.1.0 or higher.\n\n\n### v1.0.0 (2020-06-10)\n\n- First version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvilsmeier%2Fsqinn-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcvilsmeier%2Fsqinn-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvilsmeier%2Fsqinn-go/lists"}