{"id":20668606,"url":"https://github.com/studiowebux/petitedb","last_synced_at":"2026-04-13T04:02:11.131Z","repository":{"id":262929650,"uuid":"888813815","full_name":"studiowebux/petitedb","owner":"studiowebux","description":"In-memory with persistance local JSON database","archived":false,"fork":false,"pushed_at":"2025-01-12T16:53:03.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T17:35:36.070Z","etag":null,"topics":["database","deno","in-memory","json","local","nosql","on-disk","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/studiowebux.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":"2024-11-15T03:49:32.000Z","updated_at":"2025-01-12T16:53:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"34ade930-0a30-4e0f-aa67-3a4736744a91","html_url":"https://github.com/studiowebux/petitedb","commit_stats":null,"previous_names":["studiowebux/petitedb"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studiowebux%2Fpetitedb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studiowebux%2Fpetitedb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studiowebux%2Fpetitedb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/studiowebux%2Fpetitedb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/studiowebux","download_url":"https://codeload.github.com/studiowebux/petitedb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242873755,"owners_count":20199294,"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":["database","deno","in-memory","json","local","nosql","on-disk","typescript"],"created_at":"2024-11-16T20:09:58.453Z","updated_at":"2025-12-24T05:19:32.969Z","avatar_url":"https://github.com/studiowebux.png","language":"TypeScript","funding_links":["https://www.buymeacoffee.com/studiowebux"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003ch2\u003ePetite DB\u003c/h2\u003e\n\n[![JSR](https://jsr.io/badges/@studiowebux/petitedb)](https://jsr.io/@studiowebux/petitedb)\n\n\u003cp\u003eThe minimalistic NoSQL in-memory/on-disk database\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/studiowebux/petitedb/issues\"\u003eReport Bug\u003c/a\u003e\n  ·\n  \u003ca href=\"https://github.com/studiowebux/petitedb/issues\"\u003eRequest Feature\u003c/a\u003e\n\u003c/p\u003e\n\u003c/div\u003e\n\n---\n\n## About\n\n- Ideal for test, offline applications and Proof-of-Concept\n- Manage data in memory\n- Store and load data to/from a JSON file\n- Uses Write-Ahead Logging (WAL) to increase performance\n- Collection data is split into individual files.\n- Configurable (see table below)ù\n- Core operations:\n  - Create, update, upsert, delete records\n    - `insertOne` / `insertMany`\n    - `updateOne`\n    - `upsert`\n    - `deleteOne` / `deleteMany`\n  - Drop Collection\n    - `drop`\n  - Count\n    - `count`\n  - Retrieve configurable amount of random records (`sample()`)\n    - `sample`\n  - Snapshot and Clear data\n    - `getData`\n    - `clear`\n  - Support Typescript Types: _Data_ (`Schema`) and _Collections_ (`string`)\n- Support Saving BigInt in JSON file\n- Added `_meta` object for each record (not fully implemented)\n  - createdAt\n  - updatedAt\n  - Version (increase when update and upsert)\n- Added simple indexing (by _id)\n\n---\n\n## Installation and Usage\n\n1. Install deno: https://deno.com\n2. `deno add @studiowebux/petitedb`\n3. `import { PetiteDB } from \"@studiowebux/petitedb@^2.1.2\";`\n\n\u003e  Version 2.2.0+ has breaking changes.\n\n**Example:**\n\nsee `demo/` directory, there are many examples.\n\n**Clean Shutdown**\n\n```ts\nconst db = new PetiteDB(...);\n\nawait db.shutdown()\n```\n\n**Options**\n\n| Parameter            | Description                                                                                 | Default           |\n| -------------------- | ------------------------------------------------------------------------------------------- | ----------------- |\n| autoCommit           | If true, the database will be commited automatically when `maxWritesBeforeFlush` is reached | `true`            |\n| walLogPath           |  WAL File name                                                                              | `db_name.wal.log` |\n| maxWritesBeforeFlush |   Number of entries to store in the WAL before saving on-disk                               | `100`             |\n| memoryOnly           |  Ephemeral DB only                                                                          | `false`           |\n| verbose              |  Enables all log levels                                                                     | `false`           |\n\n---\n\n## Contributing\n\n1. Fork the project\n2. Create a Feature Branch\n3. Commit your changes\n4. Push your changes\n5. Create a PR\n\n\u003cdetails\u003e\n\u003csummary\u003eWorking with your local branch\u003c/summary\u003e\n\n**Branch Checkout:**\n\n```bash\ngit checkout -b \u003cfeature|fix|release|chore|hotfix\u003e/prefix-name\n```\n\n\u003e Your branch name must starts with [feature|fix|release|chore|hotfix] and use a\n\u003e / before the name; Use hyphens as separator; The prefix correspond to your\n\u003e Kanban tool id (e.g. abc-123)\n\n**Keep your branch synced:**\n\n```bash\ngit fetch origin\ngit rebase origin/master\n```\n\n**Commit your changes:**\n\n```bash\ngit add .\ngit commit -m \"\u003cfeat|ci|test|docs|build|chore|style|refactor|perf|BREAKING CHANGE\u003e: commit message\"\n```\n\n\u003e Follow this convention commitlint for your commit message structure\n\n**Push your changes:**\n\n```bash\ngit push origin \u003cfeature|fix|release|chore|hotfix\u003e/prefix-name\n```\n\n**Examples:**\n\n```bash\ngit checkout -b release/v1.15.5\ngit checkout -b feature/abc-123-something-awesome\ngit checkout -b hotfix/abc-432-something-bad-to-fix\n```\n\n```bash\ngit commit -m \"docs: added awesome documentation\"\ngit commit -m \"feat: added new feature\"\ngit commit -m \"test: added tests\"\n```\n\n\u003c/details\u003e\n\n## License\n\nDistributed under the MIT License. See LICENSE for more information.\n\n## Contact\n\n- Tommy Gingras @ tommy@studiowebux.com | Studio Webux\n\n\u003cdiv\u003e\n\u003cb\u003e | \u003c/b\u003e\n\u003ca href=\"https://www.buymeacoffee.com/studiowebux\" target=\"_blank\"\n      \u003e\u003cimg\n        src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\"\n        alt=\"Buy Me A Coffee\"\n        style=\"height: 30px !important; width: 105px !important\"\n        height=\"30\"\n        width=\"105\"\n/\u003e\u003c/a\u003e\n\u003cb\u003e | \u003c/b\u003e\n\u003ca href=\"https://webuxlab.com\" target=\"_blank\"\n      \u003e\u003cimg\n        src=\"https://webuxlab-static.s3.ca-central-1.amazonaws.com/logoAmpoule.svg\"\n        alt=\"Webux Logo\"\n        style=\"height: 30px !important\"\n        height=\"30\"\n/\u003e Webux Lab\u003c/a\u003e\n\u003cb\u003e | \u003c/b\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudiowebux%2Fpetitedb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstudiowebux%2Fpetitedb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudiowebux%2Fpetitedb/lists"}