{"id":16318442,"url":"https://github.com/abhishiv/qbase","last_synced_at":"2026-04-30T09:33:19.615Z","repository":{"id":57114211,"uuid":"316702076","full_name":"abhishiv/qbase","owner":"abhishiv","description":"Simple lightweight and fast in-memory data store with support for lazy queries, watchable queries, transactions, H1/HM/MTM/BT relationships, and MongoDB styled selectors.","archived":false,"fork":false,"pushed_at":"2020-12-02T15:48:25.000Z","size":1163,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-25T12:24:21.462Z","etag":null,"topics":["database","inmemory-db"],"latest_commit_sha":null,"homepage":"https://abhishiv.github.io/qbase","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abhishiv.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-28T09:48:30.000Z","updated_at":"2022-12-14T11:25:42.000Z","dependencies_parsed_at":"2022-08-22T03:00:15.143Z","dependency_job_id":null,"html_url":"https://github.com/abhishiv/qbase","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/abhishiv%2Fqbase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhishiv%2Fqbase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhishiv%2Fqbase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhishiv%2Fqbase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abhishiv","download_url":"https://codeload.github.com/abhishiv/qbase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239195403,"owners_count":19598036,"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","inmemory-db"],"created_at":"2024-10-10T22:23:32.395Z","updated_at":"2026-04-30T09:33:14.575Z","avatar_url":"https://github.com/abhishiv.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# @gratico/qbase\n\n@gratico/qbase\n=====\n\nSimple lightweight and fast in-memory data store with support for lazy queries, watchable queries, transactions, H1/HM/MTM/BT relationships, and MongoDB styled selectors.\n\nWritten to be an lightweight functional alternative to @apollo/client. PRs welcomed for adding support for JSONSchema.\n\nInstall and use\n---------------\n\nTo use run `npm install -g @gratico/qbase`\n\n    import {createStore, getSelect, getInsert, observe} from \"@gratico/qbase\"\n    import schema from './schema'\n    const store = createStore(schema)\n\n\nSchema Definition\n---------------------------\n\nList of table describing their column and realtions\n\n    export const schema: ISchemaDefinition = {\n      name: \"Kernel\",\n      tables: [\n        ...tables,\n        {\n          name: \"Masters\",\n          primaryKey: [\"id\"],\n          relations: [\n            {\n              type: R.MTM,\n              name: \"viewports\",\n              opts: {\n                tableName: \"Viewports\",\n                remoteKey: \"viewportId\",\n                localKey: \"masterId\",\n                through: \"MasterViewportJunction\",\n              },\n            },\n          ],\n          columns: [\n            { name: \"id\", type: \"STRING\" },\n            { name: \"createdAt\", type: \"DATE_TIME\", nullable: true },\n          ],\n        } as ITableDefinition,\n      ],\n    };\n\n\nQuerying\n---------------------------\n\nList of table describing their column and realtions\n\n    const selectQuery = getSelect(db, [\n      Q.SELECT,\n      \"Masters\",\n      { columns: [\"id\", \"name\"], includes: [\"masters\"] },\n    ]);\n    const preInsertSelectResults = selectQuery();\n    const insertMQuery = getInsert(db, [\n      Q.INSERT,\n      \"People\",\n      [{ id: \"m1\", \"name\": \"Master 1\" }],\n    ])();\n\n\n\n```\nexport * from \"./queries\";\nexport * from \"./relational\";\nexport * from \"./schema\";\nexport * from \"./types\";\nexport * from \"./utils\";\nexport * from \"./watch\";\nexport * from \"./react_hooks\";\n\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhishiv%2Fqbase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhishiv%2Fqbase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhishiv%2Fqbase/lists"}