{"id":19866058,"url":"https://github.com/riyaz-ali/sqlite","last_synced_at":"2025-05-16T18:09:58.441Z","repository":{"id":39603058,"uuid":"304813972","full_name":"riyaz-ali/sqlite","owner":"riyaz-ali","description":"Golang library to build sqlite extensions :rocket:","archived":false,"fork":false,"pushed_at":"2025-02-04T09:10:32.000Z","size":2546,"stargazers_count":169,"open_issues_count":5,"forks_count":8,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-23T21:18:42.183Z","etag":null,"topics":["golang","golang-library","sqlite-virtual-table","sqlite3","sqlite3-extension"],"latest_commit_sha":null,"homepage":"https://go.riyazali.net/sqlite","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/riyaz-ali.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}},"created_at":"2020-10-17T06:35:42.000Z","updated_at":"2025-04-01T15:07:38.000Z","dependencies_parsed_at":"2025-04-23T21:18:45.262Z","dependency_job_id":"1420c503-6c66-4f1e-9fb0-65321c4f63f4","html_url":"https://github.com/riyaz-ali/sqlite","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riyaz-ali%2Fsqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riyaz-ali%2Fsqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riyaz-ali%2Fsqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riyaz-ali%2Fsqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/riyaz-ali","download_url":"https://codeload.github.com/riyaz-ali/sqlite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254582907,"owners_count":22095518,"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","golang-library","sqlite-virtual-table","sqlite3","sqlite3-extension"],"created_at":"2024-11-12T15:24:54.048Z","updated_at":"2025-05-16T18:09:58.421Z","avatar_url":"https://github.com/riyaz-ali.png","language":"Go","readme":"# SQLite Extensions\n\n[![Go v1.14](https://img.shields.io/badge/v1.14-blue.svg?labelColor=a8bfc0\u0026color=5692c7\u0026logoColor=fff\u0026style=for-the-badge\u0026logo=Go)](https://golang.org/doc/go1.14)\n[![CGO](https://img.shields.io/badge/requires_cgo-blue.svg?labelColor=a8bfc0\u0026color=5692c7\u0026logoColor=fff\u0026style=for-the-badge\u0026logo=Go)](https://golang.org/doc/go1.14)\n[![Godoc](https://img.shields.io/badge/godoc-reference-blue.svg?labelColor=a8bfc0\u0026color=5692c7\u0026logoColor=fff\u0026style=for-the-badge)](https://pkg.go.dev/go.riyazali.net/sqlite)\n\n## Overview\n\n**`sqlite`** package provides a low-level interface that allows you to build [**`sqlite`** extensions](https://www.sqlite.org/loadext.html) that [_can be loaded dynamically at runtime_](https://www.sqlite.org/loadext.html#loading_an_extension)\nor [_linked statically at build-time_](https://www.sqlite.org/loadext.html#statically_linking_a_run_time_loadable_extension) \u003csup\u003e(experimental)\u003c/sup\u003e\n\n## Installation\n\nThis package can be installed with `go get` as:\n\n```shell\n$ go get -u go.riyazali.net/sqlite\n```\n\n**`sqlite`** is a `cgo` package and requires a working `c` compiler.\n\n## Usage\n\nTo build an `sqlite` extension, you need to build your project with [`-buildmode=c-shared`](https://golang.org/cmd/go/#hdr-Build_modes). That would emit\na **`.so`** file (or **`.dll`** on windows), which you can then [_load into `sqlite`_](https://www.sqlite.org/c3ref/load_extension.html).\n\nConsider as an example, the [sample `upper`](_examples/upper/upper.go) module in `_examples/`. To build it, you'd use something similar to:\n\n```shell\n$ go build -buildmode=c-shared -o upper.so _examples/upper\n```\n\nwhich would emit an `upper.so` in the current directory. Now, to use it with (say) the `sqlite3` shell, you could do something like\n\n```shell\n$ sqlite3\n\u003e .load upper.so\n\u003e SELECT upper(\"sqlite3\");\nSQLITE3\n\u003e .exit\n```\n\n## Features\n\n- [x] [`commit` / `rollback` hooks](https://www.sqlite.org/c3ref/commit_hook.html)\n- [x] custom [`collation`](https://www.sqlite.org/c3ref/create_collation.html)\n- [x] custom [`scalar`, `aggregate` and `window` functions](https://www.sqlite.org/appfunc.html)\n- [x] custom [`virtual table`](https://www.sqlite.org/vtab.html) \u003csup\u003edoes not support `xShadowName` and nested transations _yet_\u003c/sup\u003e\n\nEach of the support feature provides an exported interface that the user code must implement. Refer to code and [godoc](https://pkg.go.dev/go.riyazali.net/sqlite)\nfor more details.\n\n## License\n\nMIT License Copyright (c) 2020 Riyaz Ali\n\nRefer to [LICENSE](./LICENSE) for full text.\n\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friyaz-ali%2Fsqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friyaz-ali%2Fsqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friyaz-ali%2Fsqlite/lists"}