{"id":18828539,"url":"https://github.com/farjs/better-sqlite3-wrapper","last_synced_at":"2025-04-14T03:11:24.366Z","repository":{"id":152714155,"uuid":"620414485","full_name":"farjs/better-sqlite3-wrapper","owner":"farjs","description":"Thin api wrapper around better-sqlite3 and bun:sqlite to allow cross- runtime/engine usage","archived":false,"fork":false,"pushed_at":"2024-11-03T18:09:27.000Z","size":11,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-07T11:41:06.291Z","etag":null,"topics":["api-wrapper","better-sqlite3","bun","cross-engine","cross-runtime","db","sql","sqlite","sqlite-database","sqlite3","sqlite3-database"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/farjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2023-03-28T16:26:19.000Z","updated_at":"2024-11-17T23:57:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"1bce31af-b6f5-4cec-95bb-fdff2d47e626","html_url":"https://github.com/farjs/better-sqlite3-wrapper","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"2a424e6167cfb0110e100ae9410e27f3841657ba"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farjs%2Fbetter-sqlite3-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farjs%2Fbetter-sqlite3-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farjs%2Fbetter-sqlite3-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farjs%2Fbetter-sqlite3-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/farjs","download_url":"https://codeload.github.com/farjs/better-sqlite3-wrapper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248813796,"owners_count":21165634,"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":["api-wrapper","better-sqlite3","bun","cross-engine","cross-runtime","db","sql","sqlite","sqlite-database","sqlite3","sqlite3-database"],"created_at":"2024-11-08T01:30:43.441Z","updated_at":"2025-04-14T03:11:24.340Z","avatar_url":"https://github.com/farjs.png","language":"JavaScript","readme":"\n[![CI](https://github.com/farjs/better-sqlite3-wrapper/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/farjs/better-sqlite3-wrapper/actions/workflows/ci.yml?query=workflow%3Aci+branch%3Amain)\n[![npm version](https://img.shields.io/npm/v/@farjs/better-sqlite3-wrapper)](https://www.npmjs.com/package/@farjs/better-sqlite3-wrapper)\n\n## @farjs/better-sqlite3-wrapper\n\nThin api wrapper around [better-sqlite3](https://github.com/WiseLibs/better-sqlite3)\nand [bun:sqlite](https://bun.sh/docs/api/sqlite) to allow cross- runtime/engine usage.\n\nIt exposes only [a subset](./index.d.ts) of `better-sqlite3` api because not everything\nis available in `bun:sqlite`.\n\nFor example, since `run` returns `undefined` you can use the following queries to get\n `changes` and/or `lastInsertRowid`:\n\n```javascript\nconst changes = db.prepare(\"SELECT changes() AS changes;\").get().changes;\nconst lastInsertRowId = db.prepare(\"SELECT last_insert_rowid() AS id;\").get().id;\n```\n\nAlso, since `db.pragma` is not available in `bun:sqlite`, you can run:\n\n```javascript\n// non-transactional\ndb.prepare(\"PRAGMA foreign_keys = ON;\").run();\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarjs%2Fbetter-sqlite3-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarjs%2Fbetter-sqlite3-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarjs%2Fbetter-sqlite3-wrapper/lists"}