fdb.dev

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2026 License: Apache-2.0

README

fdb-go - FoundationDB Ecosystem for Go

CI Test Report Go Reference

A native FoundationDB client, a testcontainer, the Record Layer and an embedded SQL engine for Go, without cgo. Requires a FoundationDB 7.3 cluster.

go get fdb.dev@master

Or run the examples from a clone, against a disposable cluster in Docker. Build the fdb CLI from the checkout:

go build -o .tmpbuild/fdb ./cmd/fdb &&
export PATH="$PWD/.tmpbuild:$PATH" &&
FDB_CLUSTER_FILE=$(fdb dev up) &&
export FDB_CLUSTER_FILE &&
go run ./example/sql &&
go run ./example

fdb dev down removes the cluster. Tagged installation with go install fdb.dev/cmd/fdb@<tag> requires a release containing cmd/fdb; the installer also requires matching fdb_ release archives. Use the checkout build until that release is available. See the CLI guide for configuration and commands.

Pre-1.0; expect API changes. Status and known gaps. Independent project, not affiliated with Apple or the FoundationDB project.

Native Go Client

fdb.dev/pkg/fdbgo/fdb implements FoundationDB's 7.3 client protocol without cgo or libfdb_c, with an API modeled on Apple's Go binding. Differential tests compare results, stored bytes and error codes against libfdb_c 7.3.77 on every pull request.

import "fdb.dev/pkg/fdbgo/fdb"

fdb.MustAPIVersion(730)
db, err := fdb.OpenDatabase(clusterFile)
if err != nil {
	return err
}
defer db.Close()

v, err := db.Transact(func(tx fdb.WritableTransaction) (any, error) {
	tx.Set(fdb.Key("hello"), []byte("world"))
	return tx.Get(fdb.Key("hello")).Get()
})

Transact retries retryable errors; keep external side effects outside its callback. Supported options.

One transaction per operation, Go client vs. Apple's binding over libfdb_c, same process and cluster:

Operation Go CGo + libfdb_c Go allocs/op
Get, 100 B value 117 µs 207 µs 73
Get, 10 KB value 140 µs 224 µs 73
GetRange, 10 keys 156 µs 248 µs 86
GetRange, 100 keys 251 µs 339 µs 122
Set 100 B + commit 1.25 ms 1.02 ms 105

Median of 5, master 9a9a448, Ryzen 9 3900X, single-node FDB 7.3.77 (ssd engine) in local Docker. Allocation counts cover the Go heap only, not libfdb_c's. Raw results and commands. An earlier, larger comparison measured an older client revision.

Testcontainer

fdb.dev/pkg/testcontainers/foundationdb starts FoundationDB in Docker and returns a configured, ready cluster. Single node or several (RunCluster); storage engine, redundancy and knobs are options; Pause simulates an unreachable cluster.

import foundationdbtc "fdb.dev/pkg/testcontainers/foundationdb"

func TestThing(t *testing.T) {
	ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
	defer cancel()

	c, err := foundationdbtc.Run(ctx, "") // foundationdb/foundationdb:7.3.77
	if err != nil {
		t.Fatal(err)
	}
	t.Cleanup(func() { c.Terminate(context.Background()) })

	clusterFile, err := c.ClusterFilePath(ctx)
	if err != nil {
		t.Fatal(err)
	}
	fdb.MustAPIVersion(730)
	db, err := fdb.OpenDatabase(clusterFile)
	// ...
}

Run returns a usable database in 4.6 s (median of 5, image already pulled, same machine). Raw results.

Record Layer

A Go port of FoundationDB's Record Layer: protobuf records, secondary indexes, schema evolution and resumable cursors. Go and Java Record Layer 4.14.2.0 can share record stores in the supported formats; see compatibility and the Java conformance tests.

Go

fdb.dev/pkg/recordlayer. Records are your protobuf messages; as in Java, a union message lists the record types:

message Order {
  optional int64 order_id = 1;
  optional int32 price = 2;
}

message RecordTypeUnion {
  option (com.apple.foundationdb.record.record).usage = UNION;
  optional Order _Order = 1;
}
builder := recordlayer.NewRecordMetaDataBuilder().SetRecords(shoppb.File_shop_proto)
builder.GetRecordType("Order").SetPrimaryKey(recordlayer.Field("order_id"))
builder.AddIndex("Order", recordlayer.NewIndex("price_idx", recordlayer.Field("price")))
metadata, err := builder.Build()
if err != nil {
	return err
}

rdb := recordlayer.NewFDBDatabase(db)
_, err = rdb.Run(ctx, func(rtx *recordlayer.FDBRecordContext) (any, error) {
	store, err := recordlayer.NewStoreBuilder().
		SetContext(rtx).
		SetMetaDataProvider(metadata).
		SetSubspace(subspace.FromBytes([]byte("app"))).
		CreateOrOpen()
	if err != nil {
		return nil, err
	}
	if _, err := store.SaveRecord(&shoppb.Order{OrderId: proto.Int64(1), Price: proto.Int32(25)}); err != nil {
		return nil, err
	}
	orders, err := recordlayer.GetTypedRecordStore[*shoppb.Order](store, "Order")
	if err != nil {
		return nil, err
	}
	return orders.LoadRecord(tuple.Tuple{int64(1)})
})

Runnable example · operations guide (online index builds, schema evolution).

Operation, one transaction each Time Allocs/op
Load record by primary key 210 µs 180
Save record + commit 1.01 ms 289
Save record with one index + commit 1.01 ms 359
Scan 1,000 records through an index, pipelined 23.6 ms 47,378
Same scan, loading records one at a time 57.8 ms 41,221

Median of 5, same machine, FDB memory engine. Raw results.

SQL

fdb.dev/pkg/relational/sqldriver is an embedded database/sql driver over Record Layer stores. It uses Java Relational's SQL dialect and a port of its Cascades planner. Not PostgreSQL-compatible; differences from Java.

import (
	"database/sql"
	"net/url"

	"fdb.dev/pkg/relational/sqldriver"
)

sqldriver.RegisterDomainIfNotExists("FRL")
db, err := sql.Open("fdbsql", "fdbsql:///FRL/SHOP?schema=APP&cluster_file="+url.QueryEscape(clusterFile))
if err != nil {
	return err
}
defer db.Close()

rows, err := db.QueryContext(ctx,
	"SELECT customer, SUM(amount) FROM orders GROUP BY customer ORDER BY customer")
if err != nil {
	return err
}
defer rows.Close()

Complete example, including creating the database, schema and table.

Statement, autocommit Time Allocs/op
Point select by primary key 788 µs 1,477
Index range scan, 50 of 100 rows 2.37 ms 5,153
Single-row insert 2.53 ms 4,169

Median of 5, same machine, FDB memory engine. The selects reuse a cached plan; the insert is planned on every execution. Raw results.

AI Disclaimer

LLMs were used heavily in the development and maintenance of this project. Credit goes to the original authors of FoundationDB and the FoundationDB Record Layer.


Contributing · Test report · Security · Support · Apache-2.0 (NOTICE)

Directories

Path Synopsis
cmd
bench-report command
Binary bench-report compares two Go benchmark result files and outputs a markdown comparison table.
Binary bench-report compares two Go benchmark result files and outputs a markdown comparison table.
corpus-mutation-proof command
Command corpus-mutation-proof measures what a corpus actually DETECTS, rather than what it covers.
Command corpus-mutation-proof measures what a corpus actually DETECTS, rather than what it covers.
dst-generate command
Command dst-generate runs metamorphic equivalence scenarios (hand-written or LLM-generated) through the deterministic SQL engine over SimFDB and reports findings.
Command dst-generate runs metamorphic equivalence scenarios (hand-written or LLM-generated) through the deterministic SQL engine over SimFDB and reports findings.
dst-hunt command
Command dst-hunt is the overnight brute-force bug hunter for the record layer.
Command dst-hunt is the overnight brute-force bug hunter for the record layer.
explain-differ command
Command explain-differ dumps the planned PHYSICAL plan shape of every query in the yamsql conformance corpus to a stable text baseline, and diffs two such baselines.
Command explain-differ dumps the planned PHYSICAL plan shape of every query in the yamsql conformance corpus to a stable text baseline, and diffs two such baselines.
factory-migrate command
factory-migrate re-emits the committed RFC-201 factory corpus from its seeds into the grouped `.yamsql` family-file format (RFC-201 §5.7).
factory-migrate re-emits the committed RFC-201 factory corpus from its seeds into the grouped `.yamsql` family-file format (RFC-201 §5.7).
factory-plan-census command
Command factory-plan-census makes a factory-corpus plan-shape drift READABLE, and fails loudly on the drift classes that are regressions.
Command factory-plan-census makes a factory-corpus plan-shape drift READABLE, and fails loudly on the drift classes that are regressions.
factory-rebless command
factory-rebless re-derives the PLAN-SHAPE and DEDUP-KEY headers of the committed RFC-201 factory corpus after a deliberate planner change, and rewrites the census baseline to match.
factory-rebless re-derives the PLAN-SHAPE and DEDUP-KEY headers of the committed RFC-201 factory corpus after a deliberate planner change, and rewrites the census baseline to match.
factory-rebless-plan-shapes command
Command factory-rebless-plan-shapes re-derives the PLAN SHAPE and dedup key of every committed RFC-201 factory scenario and rewrites the ones that moved.
Command factory-rebless-plan-shapes re-derives the PLAN SHAPE and dedup key of every committed RFC-201 factory scenario and rewrites the ones that moved.
factory-run command
factory-run is the RFC-201 §5 generation factory: it generates seeded query candidates, executes them against a real FoundationDB through the production SQL path, blesses the ones every oracle agrees on, deduplicates them against the corpus already committed, and WRITES the survivors into pkg/relational/conformance/factorycorpus/testdata as permanent suite content.
factory-run is the RFC-201 §5 generation factory: it generates seeded query candidates, executes them against a real FoundationDB through the production SQL path, blesses the ones every oracle agrees on, deduplicates them against the corpus already committed, and WRITES the survivors into pkg/relational/conformance/factorycorpus/testdata as permanent suite content.
fdb command
fdb — fdb.dev CLI for FoundationDB, Record Layer, and SQL.
fdb — fdb.dev CLI for FoundationDB, Record Layer, and SQL.
fdb-binding-stress command
fdb-binding-stress runs the FDB binding tester across many seeds and reports results.
fdb-binding-stress runs the FDB binding tester across many seeds and reports results.
fdb-diff-oracle
Package difforacle implements the differential serialization fuzzer.
Package difforacle implements the differential serialization fuzzer.
fdb-stacktester/bindingtester
Package bindingtester runs the official FoundationDB binding tester against the pure-Go stacktester.
Package bindingtester runs the official FoundationDB binding tester against the pure-Go stacktester.
fdb-wirelog-dump command
fdb-wirelog-dump reads a binary wire log (FDB_WIRE_LOG format) and prints human-readable frame summaries.
fdb-wirelog-dump reads a binary wire log (FDB_WIRE_LOG format) and prints human-readable frame summaries.
fdb/internal/cmd
Package cmd builds the fdb command tree.
Package cmd builds the fdb command tree.
fdb/internal/config
Package config loads and writes the fdb YAML config file (default location: ~/.fdb/config.yaml) using protoconfig.
Package config loads and writes the fdb YAML config file (default location: ~/.fdb/config.yaml) using protoconfig.
fdb/internal/meta
Package meta loads a RecordMetaData from a Context's MetadataSource:
Package meta loads a RecordMetaData from a Context's MetadataSource:
fuzzrun command
Command fuzzrun runs one fuzzing command and classifies its failure.
Command fuzzrun runs one fuzzing command and classifies its failure.
gen-feature-matrix command
Command gen-feature-matrix regenerates FEATURE_MATRIX.md from the yamsql conformance corpus.
Command gen-feature-matrix regenerates FEATURE_MATRIX.md from the yamsql conformance corpus.
gen-sql-coverage command
Command gen-sql-coverage regenerates the RFC-165 SQL conformance ledgers from the yamsql conformance corpus.
Command gen-sql-coverage regenerates the RFC-165 SQL conformance ledgers from the yamsql conformance corpus.
plan-trace command
Command plan-trace plans one query without FDB and reports where the planner's work went: tasks, time and memo groups per phase, task kind and rule, then a census of the memo the run left, including groups explored more than once.
Command plan-trace plans one query without FDB and reports where the planner's work went: tasks, time and memo groups per phase, task kind and rule, then a census of the memo the run left, including groups explored more than once.
secretscan command
Command secretscan refuses content that must never reach this repository, which is public: credentials and tokens, private keys, OpenTofu state and variables, public host addresses, and the literal contents of the secret files on the machine running it (a Hetzner Cloud token has no shape a pattern could know; its bytes do).
Command secretscan refuses content that must never reach this repository, which is public: credentials and tokens, private keys, OpenTofu state and variables, public host addresses, and the literal contents of the secret files on the machine running it (a Hetzner Cloud token has no shape a pattern could know; its bytes do).
spfresh-maintainer command
Command spfresh-maintainer is the reference SPFresh maintenance worker (RFC-156 §3.2).
Command spfresh-maintainer is the reference SPFresh maintenance worker (RFC-156 §3.2).
sql-diff-stress command
sql-diff-stress is the RFC-182 generative row-soundness differential stress binary: seeded random (schema, data, query) cases executed through the full production SQL path against a real FDB testcontainer, rows diffed against the in-memory brute-force oracle (Oracle M).
sql-diff-stress is the RFC-182 generative row-soundness differential stress binary: seeded random (schema, data, query) cases executed through the full production SQL path against a real FDB testcontainer, rows diffed against the in-memory brute-force oracle (Oracle M).
test-budget command
Command test-budget reports how much of its Bazel timeout budget each test target actually consumed, and fails when a target that RAN is close enough to its budget that the next growth will break it.
Command test-budget reports how much of its Bazel timeout budget each test target actually consumed, and fails when a target that RAN is close enough to its budget that the next growth will break it.
test-report command
Binary test-report generates a self-contained HTML test report from Bazel's Build Event Protocol (BEP) JSON output.
Binary test-report generates a self-contained HTML test report from Bazel's Build Event Protocol (BEP) JSON output.
vulnscan command
Command vulnscan runs govulncheck as a CI security gate that cannot be silenced by an upstream outage and cannot silently pass because of one.
Command vulnscan runs govulncheck as a CI security gate that cannot be silenced by an upstream outage and cannot silently pass because of one.
frl module
Package conformance holds the cross-engine conformance suite that compares the Go record layer against the Java reference.
Package conformance holds the cross-engine conformance suite that compares the Go record layer against the Java reference.
Command example saves and loads a typed record in a disposable FoundationDB.
Command example saves and loads a typed record in a disposable FoundationDB.
sql command
Command sql is a runnable quickstart for the SQL engine via Go's standard database/sql interface.
Command sql is a runnable quickstart for the SQL engine via Go's standard database/sql interface.
gen
internal
unicode15
Package unicode15 pins compatibility-sensitive Unicode data to version 15.0.0.
Package unicode15 pins compatibility-sensitive Unicode data to version 15.0.0.
unicode15/text/collate
Package collate contains types for comparing and sorting Unicode strings according to a given collation order.
Package collate contains types for comparing and sorting Unicode strings according to a given collation order.
unicode15/text/internal/colltab
Package colltab contains functionality related to collation tables.
Package colltab contains functionality related to collation tables.
unicode15/text/internal/language/compact
Package compact defines a compact representation of language tags.
Package compact defines a compact representation of language tags.
unicode15/text/internal/tag
Package tag contains functionality handling tags and related data.
Package tag contains functionality handling tags and related data.
unicode15/text/language
Package language implements BCP 47 language tags and related functionality.
Package language implements BCP 47 language tags and related functionality.
unicode15/text/transform
Package transform provides reader and writer wrappers that transform the bytes passing through as well as various transformations.
Package transform provides reader and writer wrappers that transform the bytes passing through as well as various transformations.
unicode15/text/unicode/norm
Package norm contains types and functions for normalizing Unicode strings.
Package norm contains types and functions for normalizing Unicode strings.
pkg
dst
Package dst provides the deterministic-simulation-testing foundation (RFC-199 Tier 0): a Clock seam, a seeded randomness source, and FoundationDB-style Buggify fault points.
Package dst provides the deterministic-simulation-testing foundation (RFC-199 Tier 0): a Clock seam, a seeded randomness source, and FoundationDB-style Buggify fault points.
fdbgo
Package fdbgo is the root of the pure-Go FoundationDB client.
Package fdbgo is the root of the pure-Go FoundationDB client.
fdbgo/client
Package client implements the FDB client transaction lifecycle.
Package client implements the FDB client transaction lifecycle.
fdbgo/fdb
Package fdb provides a pure-Go client for FoundationDB.
Package fdb provides a pure-Go client for FoundationDB.
fdbgo/fdb/directory
Package directory provides a tool for managing related subspaces.
Package directory provides a tool for managing related subspaces.
fdbgo/fdb/subspace
Package subspace provides a convenient way to use FoundationDB tuples to define namespaces for different categories of data.
Package subspace provides a convenient way to use FoundationDB tuples to define namespaces for different categories of data.
fdbgo/fdb/tuple
Package tuple provides a layer for encoding and decoding multi-element tuples into keys usable by FoundationDB.
Package tuple provides a layer for encoding and decoding multi-element tuples into keys usable by FoundationDB.
fdbgo/fdbmetrics
Package fdbmetrics exposes a pure-Go FDB client's operational counters (client.Database.Metrics, RFC-097) in the Prometheus text exposition format, ready to scrape — with zero dependencies.
Package fdbmetrics exposes a pure-Go FDB client's operational counters (client.Database.Metrics, RFC-097) in the Prometheus text exposition format, ready to scrape — with zero dependencies.
fdbgo/internal/diag
Package diag is the shared diagnostics sink for recovered panics in the pure-Go FDB client (the client and fdb-facade layers; transport keeps its own seriousLog).
Package diag is the shared diagnostics sink for recovered panics in the pure-Go FDB client (the client and fdb-facade layers; transport keeps its own seriousLog).
fdbgo/internal/hrtimer
Package hrtimer is a one-shot timer that fires with sub-millisecond precision.
Package hrtimer is a one-shot timer that fires with sub-millisecond precision.
fdbgo/internal/rangecheck
Package rangecheck lets the fdb facade run the client's selector-range pre-checks without making them public client API.
Package rangecheck lets the fdb facade run the client's selector-range pre-checks without making them public client API.
fdbgo/internal/sendqueue
Package sendqueue orders cold-path admission with FIFO permits.
Package sendqueue orders cold-path admission with FIFO permits.
fdbgo/libfdbc
This stub keeps the package compilable when something imports it in a CGO_ENABLED=0 build (e.g.
This stub keeps the package compilable when something imports it in a CGO_ENABLED=0 build (e.g.
fdbgo/transport
Package transport implements FDB's TCP wire protocol: framing, handshake, and request/response multiplexing via endpoint tokens.
Package transport implements FDB's TCP wire protocol: framing, handshake, and request/response multiplexing via endpoint tokens.
fdbgo/wire
Package wire implements FDB's custom FlatBuffers-inspired binary serialization format.
Package wire implements FDB's custom FlatBuffers-inspired binary serialization format.
fdbgo/wire/types
Package types contains generated FDB FlatBuffers message types.
Package types contains generated FDB FlatBuffers message types.
internal/fdbclient
Package fdbclient selects the FoundationDB client backend at BUILD time.
Package fdbclient selects the FoundationDB client backend at BUILD time.
linters/dockerskip
Package dockerskip requires foundationdb.SkipWithoutDocker in a skipping `if err != nil` right after foundationdb.Run or RunCluster; an error checked later is out of reach.
Package dockerskip requires foundationdb.SkipWithoutDocker in a skipping `if err != nil` right after foundationdb.Run or RunCluster; an error checked later is out of reach.
linters/gofumpt
Package gofumpt defines an analyzer that reports Go source files not formatted with gofumpt (a strict superset of gofmt).
Package gofumpt defines an analyzer that reports Go source files not formatted with gofumpt (a strict superset of gofmt).
linters/noemptyiface
Package noemptyiface defines an analyzer that rejects interface{} in favor of any.
Package noemptyiface defines an analyzer that rejects interface{} in favor of any.
linters/norecover
Package norecover is a nogo analyzer that enforces the panic→error boundary discipline (RFC-134, audit P2).
Package norecover is a nogo analyzer that enforces the panic→error boundary discipline (RFC-134, audit P2).
linters/recordlayerdeps
Package recordlayerdeps is a nogo analyzer that keeps the record layer independent of the SQL layer, as Java's fdb-record-layer-core is of fdb-relational: a non-test file under pkg/recordlayer must not import a package under pkg/relational.
Package recordlayerdeps is a nogo analyzer that keeps the record layer independent of the SQL layer, as Java's fdb-record-layer-core is of fdb-relational: a non-test file under pkg/recordlayer must not import a package under pkg/relational.
linters/typeimmutable
Package typeimmutable is a nogo analyzer that enforces the immutability RFC-234 relies on: a `values.Type` graph may be written only by the function that built it.
Package typeimmutable is a nogo analyzer that enforces the immutability RFC-234 relies on: a `values.Type` graph may be written only by the function that built it.
linters/unicodepin
Package unicodepin guards the RFC-265 runtime closure and compatibility-critical callers.
Package unicodepin guards the RFC-265 runtime closure and compatibility-critical callers.
recordlayer
Package recordlayer stores protobuf records in FoundationDB with secondary indexes, schema evolution and resumable cursors.
Package recordlayer stores protobuf records in FoundationDB with secondary indexes, schema evolution and resumable cursors.
recordlayer/chaos
Package chaos provides model-based chaos testing for the FDB Record Layer.
Package chaos provides model-based chaos testing for the FDB Record Layer.
recordlayer/indexfetch
Package indexfetch is Java's IndexFetchMethod, shared by the record layer's scans and the planner's index plans.
Package indexfetch is Java's IndexFetchMethod, shared by the record layer's scans and the planner's index plans.
recordlayer/indexpredicate
Package indexpredicate classifies stored index predicates the way Java's IndexPredicate.toPredicate constructors would (record.metadata.IndexPredicate).
Package indexpredicate classifies stored index predicates the way Java's IndexPredicate.toPredicate constructors would (record.metadata.IndexPredicate).
recordlayer/internal/protovalue
Package protovalue reads a key expression's Value proto as Java's LiteralKeyExpression.fromProtoValue does (LiteralKeyExpression.java:134-173), the one reader of both the meta-data loader (a literal key, a record type's explicit key, an index predicate's operand) and the planner's translation of an index predicate, which cannot import the record layer.
Package protovalue reads a key expression's Value proto as Java's LiteralKeyExpression.fromProtoValue does (LiteralKeyExpression.java:134-173), the one reader of both the meta-data loader (a literal key, a record type's explicit key, an index predicate's operand) and the planner's translation of an index predicate, which cannot import the record layer.
recordlayer/internal/tuplefast
Package tuplefast is a zero-allocation FDB tuple decoder, shared by the record layer and the vector index package.
Package tuplefast is a zero-allocation FDB tuple decoder, shared by the record layer and the vector index package.
recordlayer/javanum
Package javanum ports the JDK's floating-point text parsers, Double.parseDouble and Float.parseFloat (FloatingDecimal .readJavaFormatString), which Java's record layer uses for CAST(string AS DOUBLE/FLOAT) and for index options.
Package javanum ports the JDK's floating-point text parsers, Double.parseDouble and Float.parseFloat (FloatingDecimal .readJavaFormatString), which Java's record layer uses for CAST(string AS DOUBLE/FLOAT) and for index options.
recordlayer/keyspace
Package keyspace provides a logical directory tree abstraction over FDB.
Package keyspace provides a logical directory tree abstraction over FDB.
recordlayer/keystoretest
Package keystoretest writes PKCS12 key stores for tests, in the layout the JDK's PKCS12KeyStore writes since JDK 12: each AES secret key in a secret bag (a PKCS #8 PrivateKeyInfo shrouded under PBES2: PBKDF2 with HmacSHA256, AES-256-CBC), the bags in one unencrypted data safe, and an HmacSHA256 MAC keyed by the PKCS #12 KDF.
Package keystoretest writes PKCS12 key stores for tests, in the layout the JDK's PKCS12KeyStore writes since JDK 12: each AES secret key in a secret bag (a PKCS #8 PrivateKeyInfo shrouded under PBES2: PBKDF2 with HmacSHA256, AES-256-CBC), the bags in one unencrypted data safe, and an HmacSHA256 MAC keyed by the PKCS #12 KDF.
recordlayer/protoname
Package protoname is the protobuf identifier escaping shared by every descriptor emitter in the tree, and the DISPLAY policy that decides when an escaped name may safely be shown as the SQL identifier it came from.
Package protoname is the protobuf identifier escaping shared by every descriptor emitter in the tree, and the DISPLAY policy that decides when an escaped name may safely be shown as the SQL identifier it came from.
recordlayer/protoscope
Package protoscope lets protobuf-go build a descriptor from a file that protobuf-java accepts and protoc refuses: one whose enums share a value name.
Package protoscope lets protobuf-go build a descriptor from a file that protobuf-java accepts and protoc refuses: one whose enums share a value name.
recordlayer/query/executor
Package executor bridges RecordQueryPlan trees (Cascades planner output) and the FDBRecordStore scanning API to produce RecordCursor[QueryResult] streams.
Package executor bridges RecordQueryPlan trees (Cascades planner output) and the FDBRecordStore scanning API to produce RecordCursor[QueryResult] streams.
recordlayer/query/plan/cascades
derivations_evaluator.go — evaluates DerivationsProperty for physical plan wrapper expressions.
derivations_evaluator.go — evaluates DerivationsProperty for physical plan wrapper expressions.
recordlayer/query/plan/cascades/expressions
Package expressions ports the Cascades-side relational expression hierarchy from Java's `com.apple.foundationdb.record.query.plan.cascades.expressions`.
Package expressions ports the Cascades-side relational expression hierarchy from Java's `com.apple.foundationdb.record.query.plan.cascades.expressions`.
recordlayer/query/plan/cascades/internal/fnv64
Package fnv64 hashes planner identity streams without string-to-byte copies.
Package fnv64 hashes planner identity streams without string-to-byte copies.
recordlayer/query/plan/cascades/internal/fuzzfloor
Package fuzzfloor decides whether a fuzz target's seed-corpus coverage floor should be enforced on this run.
Package fuzzfloor decides whether a fuzz target's seed-corpus coverage floor should be enforced on this run.
recordlayer/query/plan/cascades/properties
Package properties — Cardinality and Cardinalities types.
Package properties — Cardinality and Cardinalities types.
recordlayer/query/plan/cascades/values
Package values is the Value-tier of the Go Cascades planner port — scalar / row-context expressions that compose into predicates, projections, and join keys.
Package values is the Value-tier of the Go Cascades planner port — scalar / row-context expressions that compose into predicates, projections, and join keys.
recordlayer/query/plan/constfoldcensus
Package constfoldcensus enumerates every call site that simplifies or evaluates a constant at planning (RFC-257 WS-E design 5.4(b)): the value and predicate simplification entry points, the constant evaluators, the predicate simplifier driver, and every `Evaluate(nil)` / `Eval(nil)` call.
Package constfoldcensus enumerates every call site that simplifies or evaluates a constant at planning (RFC-257 WS-E design 5.4(b)): the value and predicate simplification entry points, the constant evaluators, the predicate simplifier driver, and every `Evaluate(nil)` / `Eval(nil)` call.
recordlayer/query/plan/plans
Go extension — no Java equivalent.
Go extension — no Java equivalent.
recordlayer/rlmetrics
Package rlmetrics exposes a record-layer StoreTimer (the Go port of Java's FDBStoreTimer) in the Prometheus text exposition format, ready to scrape — with zero dependencies.
Package rlmetrics exposes a record-layer StoreTimer (the Go port of Java's FDBStoreTimer) in the Prometheus text exposition format, ready to scrape — with zero dependencies.
recordlayer/tupleordering
Package tupleordering is Java's TupleOrdering: tuples packed so that their byte order is a chosen direction and NULL placement, the encoding order functions store in index keys.
Package tupleordering is Java's TupleOrdering: tuples packed so that their byte order is a chosen direction and NULL placement, the encoding order functions store in index keys.
recordlayer/vectorcodec
Package vectorcodec is the on-disk byte codec for HNSW vector columns, wire-compatible with Java's RealVector.fromBytes / VectorType.
Package vectorcodec is the on-disk byte codec for HNSW vector columns, wire-compatible with Java's RealVector.fromBytes / VectorType.
recordlayer/vectorindex
Package vectorindex implements the record layer's vector indexes: Java's VECTOR index (VectorIndexMaintainer) with its HNSW and GuardiANN engines, and Go's SPFresh index (RFC-094).
Package vectorindex implements the record layer's vector indexes: Java's VECTOR index (VectorIndexMaintainer) with its HNSW and GuardiANN engines, and Go's SPFresh index (RFC-094).
relational/api
Package api mirrors Java's fdb-relational-api module.
Package api mirrors Java's fdb-relational-api module.
relational/api/apimock
Package apimock is a generated GoMock package.
Package apimock is a generated GoMock package.
relational/api/ddl
Package ddl defines the DDL action interfaces for the relational layer.
Package ddl defines the DDL action interfaces for the relational layer.
relational/conformance/coveringleaf
Package coveringleaf holds the schema and queries shared by the two tests that probe a COVERING index leaf from opposite sides — the planner-side shape pin in package embedded_test and the column-metadata pin in package sqldriver_test.
Package coveringleaf holds the schema and queries shared by the two tests that probe a COVERING index leaf from opposite sides — the planner-side shape pin in package embedded_test and the column-metadata pin in package sqldriver_test.
relational/conformance/explaindiff
Package explaindiff renders the PHYSICAL plan shape of every query in the yamsql conformance corpus into a stable, diffable text baseline, and diffs two such baselines entry-by-entry.
Package explaindiff renders the PHYSICAL plan shape of every query in the yamsql conformance corpus into a stable, diffable text baseline, and diffs two such baselines entry-by-entry.
relational/conformance/factory
Package factory is the producer half of the RFC-201 §5 generation factory: generate → execute → bless-or-file → dedup, with cmd/factory-run driving it and pkg/relational/conformance/factorycorpus owning the committed output.
Package factory is the producer half of the RFC-201 §5 generation factory: generate → execute → bless-or-file → dedup, with cmd/factory-run driving it and pkg/relational/conformance/factorycorpus owning the committed output.
relational/conformance/factorycorpus
Package factorycorpus is the home of the RFC-201 §5 generation factory's COMMITTED output: machine-generated, oracle-blessed yamsql scenarios that live in the repository as permanent suite content.
Package factorycorpus is the home of the RFC-201 §5 generation factory's COMMITTED output: machine-generated, oracle-blessed yamsql scenarios that live in the repository as permanent suite content.
relational/conformance/javacorpus
Package javacorpus executes the vendored Java `.yamsql` acceptance corpus (parsed by the sibling javayamsql package) against the Go SQL engine.
Package javacorpus executes the vendored Java `.yamsql` acceptance corpus (parsed by the sibling javayamsql package) against the Go SQL engine.
relational/conformance/javayamsql
Package javayamsql parses Apple's `.yamsql` acceptance-test format — the multi-document YAML dialect driving the Java record layer's yaml-tests suite.
Package javayamsql parses Apple's `.yamsql` acceptance-test format — the multi-document YAML dialect driving the Java record layer's yaml-tests suite.
relational/conformance/memoinvariant
Package memoinvariant is RFC-184 W4: a generative memo-invariant harness.
Package memoinvariant is RFC-184 W4: a generative memo-invariant harness.
relational/conformance/plandiff
Package plandiff is the Phase 4.-1 plan-equivalence harness from RFC-022 §4.-1.
Package plandiff is the Phase 4.-1 plan-equivalence harness from RFC-022 §4.-1.
relational/conformance/plandiff/seedcorpus
Package seedcorpus holds the hand-written conformance corpora.
Package seedcorpus holds the hand-written conformance corpora.
relational/conformance/rowdiff
Package rowdiff is the RFC-182 generative row-soundness differential harness: seeded random (schema, data, query) cases executed through the full production path (sqldriver → Cascades → executor → real FDB), rows diffed against Oracle M — a brute-force in-memory full-scan evaluation over the generator's own authoritative row set, reusing the engine's predicate evaluation (predicates.Comparison.Eval) so the planner is the only component removed.
Package rowdiff is the RFC-182 generative row-soundness differential harness: seeded random (schema, data, query) cases executed through the full production path (sqldriver → Cascades → executor → real FDB), rows diffed against Oracle M — a brute-force in-memory full-scan evaluation over the generator's own authoritative row set, reusing the engine's predicate evaluation (predicates.Comparison.Eval) so the planner is the only component removed.
relational/conformance/yamsql
Package yamsql is a SQL-level conformance harness for the Go SQL driver.
Package yamsql is a SQL-level conformance harness for the Go SQL driver.
relational/core/catalog
Package catalog contains concrete implementations of the api.StoreCatalog / api.SchemaTemplateCatalog / api.Transaction interfaces.
Package catalog contains concrete implementations of the api.StoreCatalog / api.SchemaTemplateCatalog / api.Transaction interfaces.
relational/core/embedded
Package embedded implements the embedded (in-process) SQL execution engine for the FoundationDB relational layer.
Package embedded implements the embedded (in-process) SQL execution engine for the FoundationDB relational layer.
relational/core/exceptionutil
Package exceptionutil is the FDB part of Java's ExceptionUtil (fdb-relational-core): FDB error codes to SQLSTATEs, kept out of api so api stays free of FDB types.
Package exceptionutil is the FDB part of Java's ExceptionUtil (fdb-relational-core): FDB error codes to SQLSTATEs, kept out of api so api stays free of FDB types.
relational/core/fleet
Package fleet drives fan-out maintenance across every tenant schema in a relational database: rebinding a fleet onto a new schema-template version, and building the indexes that rebind leaves unbuilt.
Package fleet drives fan-out maintenance across every tenant schema in a relational database: rebinding a fleet onto a new schema-template version, and building the indexes that rebind leaves unbuilt.
relational/core/functions
Package functions holds SQL helpers that need no connection or session state: SQL value comparison, identifier and table-path resolution over parse trees, string-literal unquoting, and the protoreflect <-> driver.Value marshaling shared by the planner, the executor and the embedded connection.
Package functions holds SQL helpers that need no connection or session state: SQL value comparison, identifier and table-path resolution over parse trees, string-literal unquoting, and the protoreflect <-> driver.Value marshaling shared by the planner, the executor and the embedded connection.
relational/core/keyspace
Package keyspace defines the relational-layer FDB key structure, Java's RelationalKeyspaceProvider byte for byte:
Package keyspace defines the relational-layer FDB key structure, Java's RelationalKeyspaceProvider byte for byte:
relational/core/metadata
Package metadata provides concrete bridge implementations of the api.* metadata interfaces backed by *recordlayer.RecordMetaData.
Package metadata provides concrete bridge implementations of the api.* metadata interfaces backed by *recordlayer.RecordMetaData.
relational/core/parser
Package parser houses the generated ANTLR4 lexer and parser for the Relational SQL dialect, plus the thin Go wrapper that wires them into a ParseTree suitable for consumption by the semantic analyzer.
Package parser houses the generated ANTLR4 lexer and parser for the Relational SQL dialect, plus the thin Go wrapper that wires them into a ParseTree suitable for consumption by the semantic analyzer.
relational/core/parser/grammar
Package grammar is a go-sentinel (empty) package whose only job is to anchor the *.g4 grammar files in the Go module tree so they travel with builds and gazelle doesn't delete the directory.
Package grammar is a go-sentinel (empty) package whose only job is to anchor the *.g4 grammar files in the Go module tree so they travel with builds and gazelle doesn't delete the directory.
relational/core/query
Package query defines the planner/plan seam between the SQL frontend (database/sql driver, future gRPC server, REPL) and the SQL execution engine.
Package query defines the planner/plan seam between the SQL frontend (database/sql driver, future gRPC server, REPL) and the SQL execution engine.
relational/core/query/ddl
Package ddl holds the materialized-view index generator — the Go port of Java's MaterializedViewIndexGenerator (RFC-202).
Package ddl holds the materialized-view index generator — the Go port of Java's MaterializedViewIndexGenerator (RFC-202).
relational/core/query/expr
Package expr is the parse-tree → values.Value resolver.
Package expr is the parse-tree → values.Value resolver.
relational/core/query/logical
Package logical holds the Phase 3 (TODO.md §"Phase 3 — Semantic analysis") logical-operator hierarchy.
Package logical holds the Phase 3 (TODO.md §"Phase 3 — Semantic analysis") logical-operator hierarchy.
relational/core/query/semantic
Package semantic is the Go port of Java's `com.apple.foundationdb.relational.recordlayer.query.SemanticAnalyzer` plus related Identifier / Expression / reference-resolution helpers.
Package semantic is the Go port of Java's `com.apple.foundationdb.relational.recordlayer.query.SemanticAnalyzer` plus related Identifier / Expression / reference-resolution helpers.
relational/core/query/semantic/rlcatalog
Package rlcatalog adapts the Record Layer's `RecordMetaData` into the `semantic.Catalog` interface.
Package rlcatalog adapts the Record Layer's `RecordMetaData` into the `semantic.Catalog` interface.
relational/core/rowstruct
Package rowstruct materializes a STRUCT column value for SQL clients: the Go analogue of Java's RowStruct family, where a struct column read off a record surfaces as a RelationalStruct rather than as the raw protobuf message.
Package rowstruct materializes a STRUCT column value for SQL clients: the Go analogue of Java's RowStruct family, where a struct column read off a record surfaces as a RelationalStruct rather than as the raw protobuf message.
relational/core/session
Package session holds per-connection resource state for the relational SQL engine.
Package session holds per-connection resource state for the relational SQL engine.
relational/internal/queryfixtures
Package queryfixtures holds SQL texts that more than one test package must run VERBATIM.
Package queryfixtures holds SQL texts that more than one test package must run VERBATIM.
relational/internal/simgate
Package simgate wraps a SimFDB database so a test can hold a read, commit or cancel in flight until it lets it go, or make one transaction call (or the transaction's creation) panic.
Package simgate wraps a SimFDB database so a test can hold a read, commit or cancel in flight until it lets it go, or make one transaction call (or the transaction's creation) panic.
relational/sqldriver
Package sqldriver implements a database/sql driver for the FoundationDB Record Layer relational (SQL) layer.
Package sqldriver implements a database/sql driver for the FoundationDB Record Layer relational (SQL) layer.
relational/txbudgetcensus
Package txbudgetcensus finds test transactions that carry an unstated assumption about FDB's five-second MVCC window.
Package txbudgetcensus finds test transactions that carry an unstated assumption about FDB's five-second MVCC window.
simfdb
Package simfdb is a deterministic, in-memory MVCC implementation of the fdb.BackendDatabase contract (RFC-199 Tier 1 — "SimFDB").
Package simfdb is a deterministic, in-memory MVCC implementation of the fdb.BackendDatabase contract (RFC-199 Tier 1 — "SimFDB").
simfdb/hunt
Package hunt is a brute-force, seed-driven bug hunter for the record layer.
Package hunt is a brute-force, seed-driven bug hunter for the record layer.
simfdb/hunt/atomicops
Package atomicops is a DST driver that differentials FoundationDB's ten atomic mutation types (Add / And / Or / Xor / Max / Min / ByteMax / ByteMin / AppendIfFits / CompareAndClear) end-to-end through the SimFDB backend against an INDEPENDENT Go reference model.
Package atomicops is a DST driver that differentials FoundationDB's ten atomic mutation types (Add / And / Or / Xor / Max / Min / ByteMax / ByteMin / AppendIfFits / CompareAndClear) end-to-end through the SimFDB backend against an INDEPENDENT Go reference model.
simfdb/hunt/continuation
Package continuation is RFC-199 Tier 2's continuation-under-fault replay driver.
Package continuation is RFC-199 Tier 2's continuation-under-fault replay driver.
simfdb/hunt/golden
Package golden is a characterization ("golden master") harness for the SQL engine over SimFDB.
Package golden is a characterization ("golden master") harness for the SQL engine over SimFDB.
simfdb/hunt/interleave
Package interleave is RFC-199 Tier 2's concurrent-open-transaction interleaving driver.
Package interleave is RFC-199 Tier 2's concurrent-open-transaction interleaving driver.
simfdb/hunt/metamorphic
Package metamorphic is the WRONG-catching SQL oracle for the DST harness (RFC-199 Tier 2).
Package metamorphic is the WRONG-catching SQL oracle for the DST harness (RFC-199 Tier 2).
simfdb/hunt/rangeconflict
Package rangeconflict is RFC-199 Tier 2's range-conflict interleaving driver.
Package rangeconflict is RFC-199 Tier 2's range-conflict interleaving driver.
simfdb/hunt/sqlhunt
This file adds a SECOND SQL workload to the DST bug hunter, focused on SECONDARY-INDEX maintenance under the commit-fault schedule (commit_unknown / not_committed / too_old retry).
This file adds a SECOND SQL workload to the DST bug hunter, focused on SECONDARY-INDEX maintenance under the commit-fault schedule (commit_unknown / not_committed / too_old retry).
simfdb/hunt/sqlpage
Package sqlpage is RFC-199 Tier 2's SQL-query pagination oracle.
Package sqlpage is RFC-199 Tier 2's SQL-query pagination oracle.
testcontainers/foundationdb
Package foundationdb provides a testcontainers module for FoundationDB.
Package foundationdb provides a testcontainers module for FoundationDB.
testutil/allocs
Package allocs isolates allocation assertions from parallel test activity.
Package allocs isolates allocation assertions from parallel test activity.
testutil/benchcluster
Package benchcluster gives benchmark binaries one FoundationDB cluster file.
Package benchcluster gives benchmark binaries one FoundationDB cluster file.
tools
benchcampaign/multinode/placementprobe
Package placementprobe implements the multi-node campaign's placement probe (H5) and ballast/control writer (H6).
Package placementprobe implements the multi-node campaign's placement probe (H5) and ballast/control writer (H6).
benchcampaign/multinode/placementprobe/cmd/placementprobe command
Command placementprobe is the multi-node campaign's placement probe (H5) and ballast/control writer (H6).
Command placementprobe is the multi-node campaign's placement probe (H5) and ballast/control writer (H6).
clientbench/cmd/wgscen command
Command wgscen runs the wire-golden scenarios (internal/wgscenarios) on the client compiled in: pure Go, or libfdb_c with the libfdbc tag.
Command wgscen runs the wire-golden scenarios (internal/wgscenarios) on the client compiled in: pure Go, or libfdb_c with the libfdbc tag.
clientbench/cmd/wiregolden command
Command wiregolden prints the normalized request transcript of a capture (see internal/wiregolden).
Command wiregolden prints the normalized request transcript of a capture (see internal/wiregolden).
clientbench/cmd/wiretrace command
Command wiretrace summarizes the FDB GRV and commit traffic in a loopback packet capture: requests per server batch, client segments per request, and arrival spread within batches.
Command wiretrace summarizes the FDB GRV and commit traffic in a loopback packet capture: requests per server batch, client segments per request, and arrival spread within batches.
clientbench/internal/wgscenarios
Package wgscenarios holds the wire-golden scenarios: deterministic, one transaction each, run by one goroutine.
Package wgscenarios holds the wire-golden scenarios: deterministic, one transaction each, run by one goroutine.
clientbench/internal/wiregolden
Package wiregolden renders the client requests of a capture as a normalized transcript, so that libfdb_c's and the Go client's requests for the same deterministic scenario can be compared line by line.
Package wiregolden renders the client requests of a capture as a normalized transcript, so that libfdb_c's and the Go client's requests for the same deterministic scenario can be compared line by line.
clientbench/internal/wiretrace
Package wiretrace decodes FoundationDB client traffic from a loopback packet capture: it reassembles each TCP connection, splits it into FDB frames, and matches GRV and commit requests with their replies.
Package wiretrace decodes FoundationDB client traffic from a loopback packet capture: it reassembles each TCP connection, splits it into FDB frames, and matches GRV and commit requests with their replies.
unicode15baseline command
unicode15baseline captures the pre-pin implementation with its original SDK.
unicode15baseline captures the pre-pin implementation with its original SDK.
unicode15baseline/corpus
Package corpus defines the immutable RFC-265 baseline population.
Package corpus defines the immutable RFC-265 baseline population.
unicode15gen/internal/gen
Package gen supplies offline, hash-verified input/output for the frozen norm generator.
Package gen supplies offline, hash-verified input/output for the frozen norm generator.
unicode15gen/internal/triegen
Package triegen implements a code generator for a trie for associating unsigned integer values with UTF-8 encoded runes.
Package triegen implements a code generator for a trie for associating unsigned integer values with UTF-8 encoded runes.
unicode15gen/internal/ucd
Package ucd provides a parser for Unicode Character Database files, the format of which is defined in https://www.unicode.org/reports/tr44/.
Package ucd provides a parser for Unicode Character Database files, the format of which is defined in https://www.unicode.org/reports/tr44/.
unicode15store command
unicode15store is a cross-process persisted-key compatibility probe.
unicode15store is a cross-process persisted-key compatibility probe.
unicode15store/capture command
capture exports raw golden states using an immutable pre-pin writer process.
capture exports raw golden states using an immutable pre-pin writer process.
unicode15store/harness
Package harness exercises persisted Unicode-sensitive keys in real record stores.
Package harness exercises persisted Unicode-sensitive keys in real record stores.
bazelscaleset module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL