{"id":13782126,"url":"https://github.com/crawshaw/sqlite","last_synced_at":"2025-05-15T04:07:08.431Z","repository":{"id":31274107,"uuid":"127425805","full_name":"crawshaw/sqlite","owner":"crawshaw","description":"Go SQLite3 driver","archived":false,"fork":false,"pushed_at":"2024-04-21T13:29:20.000Z","size":6592,"stargazers_count":590,"open_issues_count":35,"forks_count":69,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-07T13:02:39.055Z","etag":null,"topics":["golang","sqlite"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crawshaw.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}},"created_at":"2018-03-30T12:28:06.000Z","updated_at":"2025-05-02T17:59:18.000Z","dependencies_parsed_at":"2024-01-07T00:07:54.045Z","dependency_job_id":null,"html_url":"https://github.com/crawshaw/sqlite","commit_stats":{"total_commits":176,"total_committers":27,"mean_commits":6.518518518518518,"dds":0.6534090909090908,"last_synced_commit":"d1964889ea3ccf38f82e20ce4d5b03d926f90ed1"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crawshaw%2Fsqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crawshaw%2Fsqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crawshaw%2Fsqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crawshaw%2Fsqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crawshaw","download_url":"https://codeload.github.com/crawshaw/sqlite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270646,"owners_count":22042859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-08-03T18:01:33.180Z","updated_at":"2025-05-15T04:07:03.417Z","avatar_url":"https://github.com/crawshaw.png","language":"C","readme":"# Go interface to SQLite.\n\n[![GoDoc](https://godoc.org/crawshaw.io/sqlite?status.svg)](https://godoc.org/crawshaw.io/sqlite) [![Build Status](https://travis-ci.org/crawshaw/sqlite.svg?branch=master)](https://travis-ci.org/crawshaw/sqlite) (linux and macOS) [![Build status](https://ci.appveyor.com/api/projects/status/jh9xx6cut73ufkl8?svg=true)](https://ci.appveyor.com/project/crawshaw/sqlite) (windows)\n\nThis package provides a low-level Go interface to SQLite 3. Connections are [pooled](https://godoc.org/crawshaw.io/sqlite#Pool) and if the SQLite [shared cache](https://www.sqlite.org/sharedcache.html) mode is enabled the package takes advantage of the [unlock-notify API](https://www.sqlite.org/unlock_notify.html) to minimize the amount of handling user code needs for dealing with database lock contention.\n\nIt has interfaces for some of SQLite's more interesting extensions, such as [incremental BLOB I/O](https://www.sqlite.org/c3ref/blob_open.html) and the [session extension](https://www.sqlite.org/sessionintro.html).\n\nA utility package, [sqlitex](https://godoc.org/crawshaw.io/sqlite/sqlitex), provides some higher-level tools for making it easier to perform common tasks with SQLite. In particular it provides support to make nested transactions easy to use via [sqlitex.Save](https://godoc.org/crawshaw.io/sqlite/sqlitex#Save).\n\nThis is not a database/sql driver.\n\n```go get -u crawshaw.io/sqlite```\n\n## Example\n\nA HTTP handler that uses a multi-threaded pool of SQLite connections via a shared cache.\n\n```go\nvar dbpool *sqlitex.Pool\n\nfunc main() {\n\tvar err error\n\tdbpool, err = sqlitex.Open(\"file:memory:?mode=memory\", 0, 10)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\thttp.HandleFunc(\"/\", handler)\n\tlog.Fatal(http.ListenAndServe(\":8080\", nil))\n}\n\nfunc handler(w http.ResponseWriter, r *http.Request) {\n\tconn := dbpool.Get(r.Context())\n\tif conn == nil {\n\t\treturn\n\t}\n\tdefer dbpool.Put(conn)\n\tstmt := conn.Prep(\"SELECT foo FROM footable WHERE id = $id;\")\n\tstmt.SetText(\"$id\", \"_user_id_\")\n\tfor {\n\t\tif hasRow, err := stmt.Step(); err != nil {\n\t\t\t// ... handle error\n\t\t} else if !hasRow {\n\t\t\tbreak\n\t\t}\n\t\tfoo := stmt.GetText(\"foo\")\n\t\t// ... use foo\n\t}\n}\n```\n\nhttps://godoc.org/crawshaw.io/sqlite\n\n## Platform specific considerations\n\nBy default it requires some pthreads DLL on Windows. To avoid it, supply `CGOLDFLAGS=\"-static\"` when building your application.\n","funding_links":[],"categories":["Go","C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrawshaw%2Fsqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrawshaw%2Fsqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrawshaw%2Fsqlite/lists"}