{"id":27306302,"url":"https://github.com/nityanandkumarm/builder-database","last_synced_at":"2026-05-12T07:41:00.111Z","repository":{"id":287144885,"uuid":"963741606","full_name":"nityanandkumarm/builder-database","owner":"nityanandkumarm","description":"A Scalabale Database Builder Service","archived":false,"fork":false,"pushed_at":"2025-04-11T15:39:22.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T03:59:19.998Z","etag":null,"topics":["api-design","builder-pattern","java","jdbc","lombok","maven","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","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/nityanandkumarm.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}},"created_at":"2025-04-10T06:25:19.000Z","updated_at":"2025-04-11T15:39:26.000Z","dependencies_parsed_at":"2025-04-10T07:41:23.496Z","dependency_job_id":"84eb359a-d7fc-4e78-a19d-4dba00c484a1","html_url":"https://github.com/nityanandkumarm/builder-database","commit_stats":null,"previous_names":["nityanandkumarm/builder-database"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nityanandkumarm%2Fbuilder-database","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nityanandkumarm%2Fbuilder-database/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nityanandkumarm%2Fbuilder-database/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nityanandkumarm%2Fbuilder-database/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nityanandkumarm","download_url":"https://codeload.github.com/nityanandkumarm/builder-database/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248514198,"owners_count":21116900,"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":["api-design","builder-pattern","java","jdbc","lombok","maven","spring-boot"],"created_at":"2025-04-12T03:59:22.825Z","updated_at":"2026-05-12T07:41:00.105Z","avatar_url":"https://github.com/nityanandkumarm.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🏗️ Builder Database Service\n\nA scalable and extensible Java + Spring Boot service for **dynamic database operations** via APIs.  \nThis project helps applications manage their PostgreSQL schemas, tables, indexes, and query behavior **at runtime** — with strong support for batching, metadata, and performance-tuned operations.\n\n---\n\n## ❓ Why Use This Service?\n\nManaging evolving database schemas, optimizing data writes, and controlling metadata programmatically is **complex** and often application-specific. This service simplifies that by providing a **standardized, API-driven interface** to build, manage, and query relational structures at runtime.\n\n### 🔍 Advantages\n\n- **Schema Evolution Without Downtime**  \n  Create or modify table structures dynamically via REST APIs — no manual SQL or migration scripts.\n\n- **Performance via Temporary Writes**  \n  High-throughput inserts/updates land in `TEXT`-typed temporary tables, bypassing serialization costs. Data is then flushed in batches to real tables.\n\n- **Generic Select with Precision**  \n  Return only required columns, include aggregated fields, and reduce network overhead.\n\n- **Pluggable \u0026 Extensible**  \n  Built with interchangeable SQL builders and clean interfaces — adaptable to non-PostgreSQL databases in future.\n\n- **Clean Architecture**  \n  Structured with separation between builder, service, mapper, and controller — ideal for SDK distribution or hosted client integration.\n\n- **Metadata \u0026 Index Visibility**  \n  Introspect schema or index info using JDBC metadata — great for admin dashboards or dynamic UIs.\n\n---\n\n## 🚀 Features\n\n### ✅ Table \u0026 Schema Management\n- Create actual and temporary write tables through API.\n- Temporary write tables use all `TEXT` fields to eliminate serialization/deserialization.\n- Built-in fields: `lastUpdateDate`, `isDeleted` (for soft deletes and batch cleanups).\n\n### ✅ Index Support\n- Request index creation on any combination of fields via API.\n- Supports `BTREE`, `HASH`, etc. with unique constraints.\n\n### ✅ Select Queries with Aggregates\n- Retrieve only selected columns.\n- Add rollups/aggregations (like `SUM`, `COUNT`, `AVG`) per column.\n- Results returned via a flexible, generic DTO structure.\n\n### ✅ Metadata Introspection\n- Use API to fetch column-level and index metadata for any created table.\n- Auto-detect primary keys and types from JDBC metadata.\n\n### ✅ Safety \u0026 Validations\n- DTO and model validations via JSR-303.\n- Postgres-only type checking.\n- SQL is generated using parameterized builders to avoid injection attacks.\n\n---\n\n## ⚙️ Tech Stack\n\n- Java 17  \n- Spring Boot 3.x  \n- PostgreSQL  \n- Maven  \n- Lombok  \n- HikariCP  \n- JDBC Metadata APIs  \n- Bean Validation (Jakarta)\n\n---\n\n## 📦 Installation\n\n### 🔧 Requirements\n- Java 17+\n- PostgreSQL 13 or higher\n- Maven 3.8+\n\n### 🧱 Setup\n\n1. **Clone the repo**\n\n```bash\ngit clone https://github.com/your-username/builder-database-service.git\ncd builder-database-service\n```\n\n2. **Configure database connection**\n\nEdit `src/main/resources/application.yml`:\n\n```yaml\nspring:\n  datasource:\n    url: jdbc:postgresql://localhost:5432/your_database\n    username: your_user\n    password: your_password\n  jpa:\n    hibernate:\n      ddl-auto: none\n    open-in-view: false\n```\n\n3. **Build the project**\n\n```bash\nmvn clean install\n```\n\n4. **Run the application**\n\n```bash\nmvn spring-boot:run\n```\n\nThe service will be available at: `http://localhost:8080`.\n\n---\n\n## 🧪 Example Workflow\n\n1. **POST** `/api/tables/create`  \n   Creates schema + actual + temporary write table (if enabled).\n\n2. **POST** `/api/tables/select`  \n   Execute select queries with filters and aggregates.\n\n3. **POST** `/api/tables/{schema}/{table}/indexes`  \n   Add indexes to an existing table.\n\n4. **GET** `/api/tables/{schema}/{table}?includeIndexes=true`  \n   Fetch metadata + optional indexes.\n\n5. **POST** `/api/tables/flush`  \n   Flush data from temporary table → actual table.\n\n---\n\n## 🛣️ Roadmap\n\n- [x] Table \u0026 temp write table creation\n- [x] Indexing support\n- [x] Generic select with filters and rollups\n- [x] Metadata API\n- [x] Insert API → writes to temp or actual table based on context\n- [x] Flush API → batch-based transfer to actual table\n- [ ] Cron job for automated flush\n- [ ] Soft delete cleanup jobs\n- [ ] View \u0026 Materialized View creation\n- [ ] Caching for metadata and schema\n- [ ] Multi-tenant schema isolation\n\n---\n\n## 🧑‍💻 Contributing\n\nPull requests are welcome! Please fork the repo and open a PR from a feature branch.  \nIf you're not sure how to approach a feature, open an issue first to discuss.\n\n---\n\n## 📄 License\n\n```\nApache License 2.0\n\nLicensed under the Apache License, Version 2.0 (the \"License\");  \nyou may not use this file except in compliance with the License.  \nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software  \ndistributed under the License is distributed on an \"AS IS\" BASIS,  \nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  \nSee the License for the specific language governing permissions and  \nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnityanandkumarm%2Fbuilder-database","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnityanandkumarm%2Fbuilder-database","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnityanandkumarm%2Fbuilder-database/lists"}