FoundationDB Record Layer is a layered database library built on top of FoundationDB. The repository contains two main layers:
- Record Layer (
fdb-record-layer-core,fdb-extensions, etc.): A structured key-value store with rich indexing, querying, and schema evolution capabilities. The core API is asynchronous, built aroundCompletableFuture. - Relational Layer (
fdb-relational-*): A SQL database layer on top of the record layer, providing JDBC connectivity, a Cascades-based query planner, and schema templates for multi-tenant architectures. Also exposes a direct-access API (RelationalDirectAccessStatement) that bypasses the SQL planner for lower-overhead reads; this API is expected to be deprecated in the future as the SQL layer matures.
All Java, Gradle, and property files MUST end with a newline character.
JDK 21 is required to build. The code targets Java 17 language compatibility.
- The default PR target branch is
main. - PRs can reference the issue they address (e.g.,
Fixes #492). - PR titles are used to generate release notes — make them clear and descriptive.
- PRs must carry one of these labels:
breaking change,enhancement,bug fix,performance,dependencies,build improvement,testing improvement,documentation. - Always create PRs as drafts (
gh pr create --draft). Let the human decide when it's ready for review. - Never merge branches or PRs without explicit user consent.
- Record Layer team members with write access to the upstream repository should create branches directly on
FoundationDB/fdb-record-layerinstead of working from a personal fork. Branch names must be namespaced asapple/«github-username»/**. This is a precondition for creating stacked pull requests (via thegh stackCLI extension), since each PR’s base branch must live in the same repository as the PR. External contributors without upstream write access should keep using a fork.
The primary way to test SQL-layer behavior is via .yamsql files in
yaml-tests/src/test/resources/. To add a test:
- Create or extend a
.yamsqlfile. - Register it in
yaml-tests/src/test/java/YamlIntegrationTests.java. - Decorate the entry with
@MaintainYamlTestConfig(YamlTestConfigFilters.CORRECT_EXPECTATIONS)to have the framework auto-correct expected query plans, metadata, and metrics on first run.
See yaml-tests/src/test/resources/showcasing-tests.yamsql for a comprehensive reference of
the yamsql format (schema templates, setup blocks, result matchers, parameterization, etc.).
Use JUnit 5 for things that operate below the SQL layer, or that cannot be easily expressed in
the yamsql framework (e.g., specific JDBC interactions, record layer API behavior, async edge
cases). Some JUnit tests require a running FDB instance — configure fdb-environment.yaml in
the repo root before running them.
Use the appropriate specialized skill for each task type.
→ Apply the using-gradle skill.
→ Apply the test-runner skill.
→ Apply the frl-coding-standard skill. For test code, also apply frl-test-coding-standard.
→ Use the code-reviewer skill.
→ Use the docs-writer skill.
→ Use the relational-query-processor skill.
→ Use the stacked-prs skill.
Each AI assistant reads its own context file, all of which point here:
- Claude Code:
CLAUDE.md→AGENTS.md. Additional tooling (agents, skills, commands) is available under.claude/. See.claude/README.md. - GitHub Copilot:
.github/copilot-instructions.md→AGENTS.md. - Gemini:
GEMINI.md→AGENTS.md.
The .claude/ directory is Claude Code-specific — no equivalent directory exists yet for
other tools. Contributions adding similar tooling for Copilot, Gemini, or Cursor are welcome.