{"id":15041207,"url":"https://github.com/timoj/chaindb","last_synced_at":"2026-01-06T21:47:15.968Z","repository":{"id":50760116,"uuid":"134889358","full_name":"timoj/chaindb","owner":"timoj","description":"Simple Javascript Database  with chained-queries","archived":false,"fork":false,"pushed_at":"2020-02-16T10:25:46.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T06:38:13.552Z","etag":null,"topics":["chained","database","js","query","simple"],"latest_commit_sha":null,"homepage":null,"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/timoj.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}},"created_at":"2018-05-25T18:06:53.000Z","updated_at":"2020-02-16T10:08:07.000Z","dependencies_parsed_at":"2022-09-05T20:12:01.740Z","dependency_job_id":null,"html_url":"https://github.com/timoj/chaindb","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/timoj%2Fchaindb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timoj%2Fchaindb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timoj%2Fchaindb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timoj%2Fchaindb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timoj","download_url":"https://codeload.github.com/timoj/chaindb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245814748,"owners_count":20676808,"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":["chained","database","js","query","simple"],"created_at":"2024-09-24T20:45:45.592Z","updated_at":"2026-01-06T21:47:15.929Z","avatar_url":"https://github.com/timoj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChainDB - Simple Javascript Database\n[![Build Status](https://travis-ci.org/timoj/chaindb.svg?branch=master)](https://travis-ci.org/timoj/chaindb)\n\n## Introduction\nChainDB is a simple javascript database with chained-querying support.\n\n## Installation\n\n`npm install --save chaindb`\n\nSettings:\n- indexAtInsert: default true, if false: rows will be indexed by the optimize task, on a later moment\n- maxRows: default 51000000, max number of rows allowed to be stored in the database.\n- optimizerInterval: default 500, the interval in which the optimize task is triggered, in milliseconds\n\nSettings can be changed in the following way:  \n`ChainDB.settings.optimizerInterval = xxx;`\n## Usage\n\n### Creating a table\nA table is a collection, it has a name, which has to be unique, and a set of column names, which have to be unique to that table  \n`ChainDB.createTable(\"Users\", [\"name\", \"age\"]);`\n\nYou can also give a list of columns that need to be indexed. The values of these columns will be indexed for faster querying:  \n`ChainDB.createTable(\"Users\", [\"name\", \"age\"]);`  \n_Note that you should only index columns that hold a small value such as number values or short string values._\n\n### Inserting data\n\nInserting a single row:  \n`ChainDB.insert(\"Users\", {name: \"User1\", age: 24});`\n\nInserting in bulk:  \n`ChainDB.insertBulk(\"Users\", [{name: \"User2\", age: 32},{name: \"User3\", age: 24}]);`\n\n### Querying\n\nExample:\n```\nvar query = new ChainDB.Query();\nvar users = query.select([\"name\", \"age\"])\n    .from(\"Users\")\n    .whereColumnEquals(\"age\", 24)\n    .whereColumnMeets(\"name\", function (name) {\n        return (name.slice(-1) === \"3\")\n    })\n    .getResults();\n```\n\n### Removing data\nYou can remove each result set, by doing the following:  \n```\nvar query = new ChainDB.Query();\nvar users = query.select([\"name\", \"age\"])\n    .from(\"Users\")\n    .whereColumnEquals(\"age\", 24)\n    .whereColumnMeets(\"name\", function (name) {\n        return (name.slice(-1) === \"3\")\n    })\n    .remove();\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimoj%2Fchaindb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimoj%2Fchaindb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimoj%2Fchaindb/lists"}