mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 22:34:56 +00:00
README.md
LICENSE
AGENTS.md
api/ # Language-agnostic contract (source of truth)
schema/
entities/ # Entity definitions (conceptual models)
user.yaml
session.yaml
...
operations/ # CRUD + domain operations (semantic, not SQL)
user.ops.yaml
...
errors.yaml # Standard error codes (conflict, not_found, etc.)
capabilities.yaml # Feature flags per backend (tx, joins, ttl, etc.)
idl/
dbal.proto # Optional: RPC/IPC contract if needed
dbal.fbs # Optional: FlatBuffers schema if you prefer
versioning/
compat.md # Compatibility rules across TS/C++
common/ # Shared test vectors + fixtures + golden results
fixtures/
seed/
datasets/
golden/
query_results/
contracts/
conformance_cases.yaml
ts/ # Development implementation in TypeScript
package.json
tsconfig.json
src/
index.ts # Public entrypoint (creates client)
core/
client.ts # DBAL client facade
types.ts # TS types mirroring api/schema
errors.ts # Error mapping to api/errors.yaml
validation/ # Runtime validation (zod/io-ts/etc.)
input.ts
output.ts
capabilities.ts # Capability negotiation
telemetry/
logger.ts
metrics.ts
tracing.ts
adapters/ # Backend implementations (TS)
prisma/
index.ts
prisma_client.ts # Wraps Prisma client (server-side only)
mapping.ts # DB <-> entity mapping, select shaping
migrations/ # Optional: Prisma migration helpers
sqlite/
index.ts
sqlite_driver.ts
schema.ts
migrations/
mongodb/
index.ts
mongo_driver.ts
schema.ts
query/ # Query builder / AST (no backend leakage)
ast.ts
builder.ts
normalize.ts
optimize.ts
runtime/
config.ts # DBAL config (env, URLs, pool sizes)
secrets.ts # Secret loading boundary (server-only)
util/
assert.ts
retry.ts
backoff.ts
time.ts
tests/
unit/
integration/
conformance/ # Runs common/contract vectors on TS adapters
harness/
setup.ts
cpp/ # Production implementation in C++
CMakeLists.txt
include/
dbal/
dbal.hpp # Public API
client.hpp # Facade
types.hpp # Entity/DTO types
errors.hpp
capabilities.hpp
telemetry.hpp
query/
ast.hpp
builder.hpp
normalize.hpp
adapters/
adapter.hpp # Adapter interface
sqlite/
sqlite_adapter.hpp
mongodb/
mongodb_adapter.hpp
prisma/
prisma_adapter.hpp # Usually NOT direct; see note below
util/
expected.hpp
result.hpp
uuid.hpp
src/
client.cpp
errors.cpp
capabilities.cpp
telemetry.cpp
query/
ast.cpp
builder.cpp
normalize.cpp
adapters/
sqlite/
sqlite_adapter.cpp
sqlite_pool.cpp
sqlite_migrations.cpp
mongodb/
mongodb_adapter.cpp
mongo_pool.cpp
prisma/
prisma_adapter.cpp # See note below (often an RPC bridge)
util/
uuid.cpp
backoff.cpp
tests/
unit/
integration/
conformance/ # Runs common/contract vectors on C++ adapters
harness/
main.cpp
backends/ # Backend-specific assets not tied to one lang
sqlite/
schema.sql
migrations/
mongodb/
indexes.json
prisma/
schema.prisma
migrations/
tools/ # Codegen + build helpers (prefer Python)
codegen/
gen_types.py # api/schema -> ts/core/types.ts and cpp/types.hpp
gen_errors.py
gen_capabilities.py
conformance/
run_all.py # runs TS + C++ conformance suites
dev/
lint.py
format.py
scripts/ # Cross-platform entrypoints (Python per your pref)
build.py
test.py
conformance.py
package.py
dist/ # Build outputs (gitignored)
.github/
workflows/
ci.yml
.gitignore
.editorconfig
142 lines
3.7 KiB
YAML
142 lines
3.7 KiB
YAML
capabilities:
|
|
description: "Backend adapter capabilities matrix"
|
|
|
|
adapters:
|
|
prisma:
|
|
display_name: "Prisma ORM"
|
|
description: "Multi-database ORM with migrations"
|
|
version: "6.3+"
|
|
features:
|
|
transactions: true
|
|
nested_transactions: true
|
|
joins: true
|
|
full_text_search: false
|
|
ttl: false
|
|
json_queries: true
|
|
aggregations: true
|
|
relations: true
|
|
migrations: true
|
|
schema_introspection: true
|
|
connection_pooling: true
|
|
read_replicas: false
|
|
supported_databases:
|
|
- postgresql
|
|
- mysql
|
|
- sqlite
|
|
- sqlserver
|
|
- mongodb
|
|
- cockroachdb
|
|
limitations:
|
|
- "Full-text search depends on database"
|
|
- "TTL not natively supported"
|
|
performance:
|
|
bulk_insert: excellent
|
|
bulk_update: good
|
|
complex_queries: excellent
|
|
|
|
sqlite:
|
|
display_name: "SQLite Direct"
|
|
description: "Embedded SQL database"
|
|
version: "3.40+"
|
|
features:
|
|
transactions: true
|
|
nested_transactions: true
|
|
joins: true
|
|
full_text_search: true
|
|
ttl: false
|
|
json_queries: true
|
|
aggregations: true
|
|
relations: true
|
|
migrations: manual
|
|
schema_introspection: true
|
|
connection_pooling: false
|
|
read_replicas: false
|
|
supported_databases:
|
|
- sqlite
|
|
limitations:
|
|
- "Single writer at a time"
|
|
- "No connection pooling"
|
|
- "TTL requires manual cleanup"
|
|
performance:
|
|
bulk_insert: good
|
|
bulk_update: good
|
|
complex_queries: good
|
|
|
|
mongodb:
|
|
display_name: "MongoDB Driver"
|
|
description: "Document database"
|
|
version: "6.0+"
|
|
features:
|
|
transactions: true
|
|
nested_transactions: false
|
|
joins: false
|
|
full_text_search: true
|
|
ttl: true
|
|
json_queries: true
|
|
aggregations: true
|
|
relations: false
|
|
migrations: manual
|
|
schema_introspection: false
|
|
connection_pooling: true
|
|
read_replicas: true
|
|
supported_databases:
|
|
- mongodb
|
|
limitations:
|
|
- "No native joins (use $lookup)"
|
|
- "No foreign keys"
|
|
- "Schema-less (validation optional)"
|
|
performance:
|
|
bulk_insert: excellent
|
|
bulk_update: excellent
|
|
complex_queries: good
|
|
|
|
feature_matrix:
|
|
transactions:
|
|
description: "ACID transaction support"
|
|
supported_by: [prisma, sqlite, mongodb]
|
|
required_for: ["Multi-step operations", "Data consistency"]
|
|
|
|
joins:
|
|
description: "SQL-style JOIN operations"
|
|
supported_by: [prisma, sqlite]
|
|
fallback: "Multiple queries with in-memory join"
|
|
|
|
full_text_search:
|
|
description: "Full-text search capabilities"
|
|
supported_by: [sqlite, mongodb]
|
|
fallback: "LIKE queries or external search engine"
|
|
|
|
ttl:
|
|
description: "Automatic expiration of records"
|
|
supported_by: [mongodb]
|
|
fallback: "Manual cleanup job"
|
|
|
|
json_queries:
|
|
description: "Query JSON fields"
|
|
supported_by: [prisma, sqlite, mongodb]
|
|
|
|
aggregations:
|
|
description: "Aggregate functions (COUNT, SUM, etc.)"
|
|
supported_by: [prisma, sqlite, mongodb]
|
|
|
|
relations:
|
|
description: "Foreign key relationships"
|
|
supported_by: [prisma, sqlite]
|
|
|
|
migrations:
|
|
description: "Schema migration support"
|
|
supported_by: [prisma]
|
|
manual: [sqlite, mongodb]
|
|
|
|
capability_detection:
|
|
runtime_check: true
|
|
negotiation: true
|
|
graceful_degradation: true
|
|
|
|
version_compatibility:
|
|
min_api_version: "1.0"
|
|
current_api_version: "1.0"
|
|
breaking_changes:
|
|
- version: "2.0"
|
|
changes: ["TBD"]
|