{"id":13811429,"url":"https://github.com/janet-lang/sqlite3","last_synced_at":"2025-04-25T15:31:56.845Z","repository":{"id":34771258,"uuid":"163110320","full_name":"janet-lang/sqlite3","owner":"janet-lang","description":"Bindings to sqlite for the Janet language.","archived":false,"fork":false,"pushed_at":"2024-02-15T09:33:19.000Z","size":5381,"stargazers_count":42,"open_issues_count":9,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-08-05T04:02:48.970Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/janet-lang.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-12-25T20:41:35.000Z","updated_at":"2024-05-05T17:44:30.000Z","dependencies_parsed_at":"2024-10-25T16:29:51.426Z","dependency_job_id":"1cadf96d-efeb-4a19-95e1-a9d43a44244b","html_url":"https://github.com/janet-lang/sqlite3","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/janet-lang%2Fsqlite3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janet-lang%2Fsqlite3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janet-lang%2Fsqlite3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janet-lang%2Fsqlite3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janet-lang","download_url":"https://codeload.github.com/janet-lang/sqlite3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224008008,"owners_count":17240293,"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":[],"created_at":"2024-08-04T04:00:20.960Z","updated_at":"2024-11-10T20:03:32.189Z","avatar_url":"https://github.com/janet-lang.png","language":"C","funding_links":[],"categories":["Database"],"sub_categories":["GitHub Actions"],"readme":"# SQLite bindings\n\nThis native module proves sqlite bindings for janet.\n\n## Install\n\n```\njpm install sqlite3\n```\n\n## Building\n\nTo build, use the `jpm` tool and make sure you have janet installed.\n\n```\njpm build\n```\n## Using the System's SQLite library\n\nUsually, a Linux system has a package for SQLite installed globally.\nThis packages will usually have many plugins for SQlite enabled (e.g\nJSON1, FTS3 etc.). The [Debian package][1] or [Gentoo ebuild][2] are good examples.\n\nThis package allows one to use it instead of the SQLite sources included with the package.\nTo do this use:\n\n```\nexport JANET_SYSTEM_SQLITE=1\njpm build\n```\n\nNote, if you intead to install the package globally, use:\n\n```\nsudo -E jpm build\n```\n\n## Update the embedded SQLite version\n\nYou can use the jpm rule to update the version of SQLite included.\n```\njpm run update-sqlite3\n```\n\nYou can find the latest version https://sqlite.org/index.html.\n\n## Example Usage\n\nNext, enter the repl and create a database and a table.\nBy default, the generated module will be in the build folder.\n\n```\njanet:1:\u003e (import build/sqlite3 :as sql)\nnil\njanet:2:\u003e (def db (sql/open \"test.db\"))\n\u003csqlite3.connection 0x5561A138C470\u003e\njanet:3:\u003e (sql/eval db `CREATE TABLE customers(id INTEGER PRIMARY KEY, name TEXT);`)\n@[]\njanet:4:\u003e (sql/eval db `INSERT INTO customers VALUES(:id, :name);` {:name \"John\" :id 12345})\n@[]\njanet:5:\u003e (sql/eval db `SELECT * FROM customers;`)\n@[{\"id\" 12345 \"name\" \"John\"}]\n```\n\nLoad and use SQLite extensions.\n\n```\njanet:6:\u003e (sql/allow-loading-extensions db)\nfalse\njanet:7:\u003e (sql/load-extension db \"/tmp/base64\")\nerror: not authorized\n  in sqlite3/load-extension\n  in _thunk [janet] (tailcall) on line 4, column 1\njanet:8:\u003e (sql/allow-loading-extensions db true)\ntrue\njanet:9:\u003e (sql/load-extension db \"/tmp/base64\")\n\"/tmp/base64\"\njanet:10:\u003e (sql/eval db \"select base64('YWJjMTIz') as b64\")\n@[{:b64 @\"abc123\"}]\n```\n\nFinally, close the database connection when done with it.\n\n```\njanet:11:\u003e (sql/close db)\nnil\n```\n\n[1]: https://git.launchpad.net/ubuntu/+source/sqlite3/tree/debian/rules?h=debian/sid#n41\n[2]: https://github.com/gentoo/gentoo/blob/653b190ffe5f4433112ad6786d1bfd2e26143711/dev-db/sqlite/sqlite-3.34.0.ebuild\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanet-lang%2Fsqlite3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanet-lang%2Fsqlite3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanet-lang%2Fsqlite3/lists"}