Capability flags
160+ flags across 27 categories. Every flag has an enforcement point. The vocabulary that drives capability-aware execution.
DbCapabilities is the typed declaration of what a provider can do. Vadyl branches on capabilities — never on provider name strings — to decide between native execution and runtime supplementation. Every flag has a real enforcement point; unused flags are removed.
27 capability categories
Capabilities are organized into 27 typed category records:
- DML — insert, update, delete, upsert variants.
- Query — projections, filters, distinct, top-N.
- Join — inner, outer, semi, anti, lateral, hash, merge.
- Pagination — limit/offset, cursor, keyset.
- Types — numeric, text, date, JSON, binary, geo, vector.
- Text — full-text, trigram, fuzzy, collation.
- Identity — IDENTITY, sequences, UUIDs.
- Indexing — btree, hash, gin, gist, brin, partial, expression, hidden.
- Constraints — primary, unique, foreign, check, exclusion, deferrable.
- DDL — transactional DDL, online operations, IF EXISTS, …
- SchemaObjects — schemas, tablespaces, namespaces.
- Transactions — isolation levels, savepoints, 2PC.
- Aggregation — sum, avg, percentile, window functions.
- Functions — string, math, datetime, array, JSON ops.
- Predicates — IN, BETWEEN, LIKE, regex, IS DISTINCT FROM.
- ValueGeneration — defaults, computed, identity, sequence.
- Namespace — schema/db separation modes.
- Security — RLS, session context, role checks, masking.
- Cryptography — Always Encrypted, pgcrypto, AES_ENCRYPT.
- ChangeTracking — CDC, native notification, polling.
- StorageModel — relational, document, KV, graph, wide-column, time-series, vector.
- Document — embedded, references, aggregation pipeline.
- KeyValue — TTL, atomic ops, batch.
- Graph — traversal, shortest path, pattern match.
- Consistency — strong, bounded staleness, eventual.
- Transition — online schema change strategies.
- DatabaseSources — backup/restore protocols.
Per-provider matrix (excerpt)
| Capability | PG | MySQL | Mongo | Redis | Neo4j |
|---|---|---|---|---|---|
| SupportsTransactions | ✓ | ✓ | ✓ (session) | ✗ | ✓ |
| SupportsRowLevelSecurity | ✓ | ✗ | runtime | — | runtime |
| SupportsJsonOps | ✓ | ✓ | native | ✗ | ✗ |
| SupportsArrayTypes | ✓ | ✗ | native | ✗ | ✗ |
| SupportsCte | ✓ | ✓ | — | — | — |
| SupportsLateralJoins | ✓ | ✗ | — | — | — |
| SupportsAlwaysEncrypted | ✗ | ✗ | ✗ | — | — |
| SupportsPgCrypto | ✓ | ✗ | — | — | — |
| SupportsTransactionalDdl | ✓ | ✗ | — | — | — |
| SupportsNativeNotification | ✓ (LISTEN) | polling | change streams | pub/sub | — |
How Vadyl uses capabilities
Read coordinator and write coordinator branch on capabilities to decide:
- Native vs hybrid execution (e.g. JSON path vs application-side traversal).
- RLS injection at query time vs predicate filter at app level.
- Transactional DDL vs per-step DDL.
- Bulk insert vs row-by-row.
- 2PC vs saga compensation.
- Native time-series vs companion-collection model.
Runtime substrate capabilities
Runtime Fabric uses the same pattern for project scaling. A RuntimeSubstrate declares scaling modes, partition modes, autoscale strategies, autoscale metrics, load-balancing modes, protocol support, resource classes, CPU and memory limits, storage limits, accelerator classes, artifact kinds, drain behavior, health probes, and telemetry sources. Project topology is matched against those declarations before a workload can be placed.
If a project asks for per-surface scaling, public load balancing, a custom PCG autoscale metric, a GPU class, HTTP/3, or in-place vertical resize, the selected substrate must advertise and actually realize that capability. Otherwise compile and mutation paths fail closed with a typed reason code.
Closure invariants
Every capability flag must be either consumed (have a real enforcement point) or removed. Pinned by CapabilityFlagConsumptionTests.NoTier1Flags_EveryCapabilityFlagMustBeConsumedand Tier2ShallowCount_StaysUnderHardCeiling = 0. Operators see canonical per-flag coverage in Documentation/CapabilityFlagCoverage.md.