{"id":24201479,"url":"https://github.com/the-forgebase/dynamic-db","last_synced_at":"2026-04-20T06:10:31.551Z","repository":{"id":271958712,"uuid":"915052862","full_name":"The-ForgeBase/dynamic-db","owner":"The-ForgeBase","description":"Dynamic Database API","archived":false,"fork":false,"pushed_at":"2025-05-17T12:27:52.000Z","size":138,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-17T13:39:22.656Z","etag":null,"topics":["database","http","rest-api","sql"],"latest_commit_sha":null,"homepage":"","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/The-ForgeBase.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-10T21:32:38.000Z","updated_at":"2025-05-17T12:27:55.000Z","dependencies_parsed_at":"2025-01-11T02:52:01.213Z","dependency_job_id":"4d42f740-8921-45d3-afab-3c50d0dd1932","html_url":"https://github.com/The-ForgeBase/dynamic-db","commit_stats":null,"previous_names":["the-forgebase/dynamic-db"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/The-ForgeBase/dynamic-db","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-ForgeBase%2Fdynamic-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-ForgeBase%2Fdynamic-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-ForgeBase%2Fdynamic-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-ForgeBase%2Fdynamic-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/The-ForgeBase","download_url":"https://codeload.github.com/The-ForgeBase/dynamic-db/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/The-ForgeBase%2Fdynamic-db/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32035291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","http","rest-api","sql"],"created_at":"2025-01-13T21:16:05.286Z","updated_at":"2026-04-20T06:10:31.533Z","avatar_url":"https://github.com/The-ForgeBase.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dynamic Database API (Experimental)\n\n\u003e ⚠️ **Note**: This is an experimental project for exploring dynamic database management concepts. Not recommended for production use.\n\n## Features\n\n- **Dynamic Schema Management**\n  - Create and delete tables dynamically via API (Sqlite, Postgres, MySql, MSSql, and any knex compatible database)\n  - Support for various column types (string, integer, boolean, decimal and more) - Automatic primary key handling - Unique constraints support\n- **Data Operations**\n\n  - CRUD operations for any table\n  - Filtered queries with pagination\n  - Safe parameter handling\n\n- **Database Inspection**\n\n  - Retrieve complete database schema\n  - Table structure inspection\n  - Foreign key relationship information\n\n- **Event Hooks System**\n\n  - Before/After query hooks\n  - Before/After mutation hooks (create/update/delete)\n  - Real-time operation logging\n  - Extensible event system\n\n- **Row-Level Security (RLS)**\n\n  - Fine-grained access control at row level\n  - Multiple permission rule types:\n    - Public/Auth/Guest access\n    - Label-based permissions\n    - Team-based permissions\n    - Field-value checks\n    - Custom SQL conditions\n  - Permission persistence in database\n  - Real-time permission evaluation\n\n- **Permission Management**\n  - CRUD operations for table permissions\n  - Operation-specific rules (SELECT/INSERT/UPDATE/DELETE)\n  - Flexible permission rule configuration\n  - Database-backed permission storage\n\n- **Multiple SDK (Server and Client side)**\n  - Check the example.ts file at the root of the folder\n  - Also check `src/sdk` for full code implementation\n\n- **Others**\n  - ClI for type generate `src/cli` in zod and ts\n  - Dashboard example `src/dashoard`\n  - Can be use as a package `src/framework` and `src/dashboard/route.ts`\n\n## Quick Start\n\n```bash\n# Install dependencies\nnpm install\n\n# Start the development server\nnpm run dev\n\n# Server will be running at:\n# http://localhost:3000\n```\n\n## API Examples\n\n### Create a Table\n\n```http\nPOST /schema\n{\n  \"action\": \"create\",\n  \"tableName\": \"users\",\n  \"columns\": [\n    { \"name\": \"id\", \"type\": \"increments\", \"primary\": true },\n    { \"name\": \"name\", \"type\": \"string\" },\n    { \"name\": \"email\", \"type\": \"string\", \"unique\": true }\n  ]\n}\n```\n\n### Query Records\n\n```http\nGET /records/users?filter={\"name\":\"John\"}\u0026limit=10\u0026offset=0\n```\n\n### Insert Record\n\n```http\nPOST /data/users\n{\n  \"data\": {\n    \"name\": \"John Doe\",\n    \"email\": \"john@example.com\"\n  }\n}\n```\n\n### Permission Management\n\n#### Get Table Permissions\n\n```http\nGET /permissions/users\n```\n\n#### Set Table Permissions\n\n```http\nPOST /permissions/users\n{\n  \"operations\": {\n    \"SELECT\": [\n      { \"allow\": \"public\" }\n    ],\n    \"INSERT\": [\n      { \"allow\": \"auth\" }\n    ],\n    \"UPDATE\": [\n      { \"allow\": \"labels\", \"labels\": [\"admin\"] }\n    ],\n    \"DELETE\": [\n      { \"allow\": \"teams\", \"teams\": [\"moderators\"] }\n    ]\n  }\n}\n```\n\n#### Field-Based Permission Example\n\n```http\nPOST /permissions/posts\n{\n  \"operations\": {\n    \"SELECT\": [\n      {\n        \"allow\": \"fieldCheck\",\n        \"fieldCheck\": {\n          \"field\": \"authorId\",\n          \"operator\": \"===\",\n          \"valueType\": \"userContext\",\n          \"value\": \"userId\"\n        }\n      }\n    ]\n  }\n}\n```\n\n#### Delete Table Permissions\n\n```http\nDELETE /permissions/users\n```\n\n## Technology Stack\n\n- Hono (Web Framework)\n- Knex.js (Query Builder)\n- SQLite (Database)\n- TypeScript\n\n\n## References\n\n- [Knex.js Documentation](https://knexjs.org/)\n- [knex schema inspector](https://github.com/knex/knex-schema-inspector)\n- [Hono Documentation](https://hono.dev/)\n\u003c!-- - [https://github.com/arthurkushman/buildsqlx?utm_campaign=awesomego\u0026utm_medium=referral\u0026utm_source=awesomego](For Golang)\n- [https://awesome-go.com/sql-query-builders/](For Golang) --\u003e\n\u003c!-- explore save-eval for more complex case --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-forgebase%2Fdynamic-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthe-forgebase%2Fdynamic-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-forgebase%2Fdynamic-db/lists"}