{"id":22328594,"url":"https://github.com/qrailibs/memorydb","last_synced_at":"2026-05-18T15:31:32.003Z","repository":{"id":59697943,"uuid":"537843883","full_name":"qrailibs/MemoryDB","owner":"qrailibs","description":"✨ In-memory database, fully type-safe, with Queries, Event-handling, Analytics.","archived":false,"fork":false,"pushed_at":"2024-03-27T10:06:59.000Z","size":754,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T14:48:42.031Z","etag":null,"topics":["database","in-memory","in-memory-database","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/qrailibs.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}},"created_at":"2022-09-17T15:06:40.000Z","updated_at":"2024-03-19T18:12:59.000Z","dependencies_parsed_at":"2023-01-22T09:30:27.824Z","dependency_job_id":"561d5877-0b4d-41b8-89f6-83ac1cdf283e","html_url":"https://github.com/qrailibs/MemoryDB","commit_stats":null,"previous_names":["qrai/memorydb","ultralib/memorydb","qrailibs/memorydb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/qrailibs/MemoryDB","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qrailibs%2FMemoryDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qrailibs%2FMemoryDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qrailibs%2FMemoryDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qrailibs%2FMemoryDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qrailibs","download_url":"https://codeload.github.com/qrailibs/MemoryDB/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qrailibs%2FMemoryDB/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33182710,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","in-memory","in-memory-database","typescript"],"created_at":"2024-12-04T03:13:04.698Z","updated_at":"2026-05-18T15:31:31.965Z","avatar_url":"https://github.com/qrailibs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MemoryDB\n\nIn-memory typesafe database with Queries, Events, Analytics.\n\n# Installation\n\n```bash\nnpm i @datasco/memorydb # pnpm add @datasco/memorydb\n```\n\n# Usage\n\nYou can use MemoryDB for creating in-memory database with any type of data.\n\n### Creating instance of database\n\nPrimitive database:\n\n```typescript\nconst db = new MemoryDB\u003cstring\u003e(\"primitives_database\")\n```\n\nTyped object-based database:\n\n```typescript\nconst db = new MemoryDB\u003c{\n    name: string;\n    price: number;\n}\u003e(\"complex_database\")\n```\n\n### Insert row\n\n```typescript\ndb.insert({ name: \"Bear toy\", price: 1000 })\n```\n\n### Insert multiple rows\n\n```typescript\ndb.insert([\n    { name: \"Cat toy\", price: 2000 },\n    { name: \"Dog toy\", price: 3000 },\n])\n```\n\n### Mapping rows\n\n```typescript\ndb.map(\n    row =\u003e ({ ...row, price: price + 100 })\n)\n```\n\n### Remove rows\n\n```typescript\ndb.remove(\n    row =\u003e row.price \u003e 1000\n)\n```\n\n### Remove all rows\n\n```typescript\ndb.clear()\n```\n\n### Remove duplicates with predicate\n\n```typescript\n// remove rows, where value of \"price\" is same\ndb.removeDuplicatesByPredicate(\n    (duplicateRows) =\u003e [ duplicateRows[0] ],\n    \"price\"\n)\n```\n\n### Remove duplicates (primitive)\n\n```typescript\ndb.removeDuplicates()\n```\n\n### Remove column\n\n```typescript\ndb.removeColumn(\"price\")\n```\n\n### Splitting into chunks\n\n```typescript\n// split database into chunks of size 5\ndb.chunks(5)\n```\n\n### Merge with another database\n\n```typescript\ndb.merge(new MemoryDB(\"another_db\"))\n```\n\n### Listing rows\n\n```typescript\nconst { data } = db.list()\n```\n\n### Listing rows, but paginated\n\n```typescript\n// 1 page, 50 rows per page\nconst { data } = db.listPaginated(1, 50)\n```\n\n### Find row\n\n```typescript\nconst { data } = db.find(\n    row =\u003e row.name === \"Bear toy\"\n)\n```\n\n### Search row\n\n```typescript\nconst { data } = db.search(\n    row =\u003e row.name.includes(\"toy\")\n)\n```\n\n### Chain multiple operations\n\n```typescript\ndb.chain([\n    _ =\u003e _.insert({ name: \"Test\", price: 7500 }),\n    _ =\u003e _.map(row =\u003e {...row, price: price + 500 }),\n    _ =\u003e _.map(row =\u003e {...row, name: name + \" toy\" })\n])\n```\n\n### (Analytics) Use Analytics API\n```typescript\nconst {analytics} = db\n```\n\n### (Analytics) Display contents of table\n```typescript\nanalytics.head()\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqrailibs%2Fmemorydb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqrailibs%2Fmemorydb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqrailibs%2Fmemorydb/lists"}