Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyDDL(t testing.TB, dsn string, stmts []string)
- func CreateAppRole(t testing.TB, superDSN string) string
- func NewConformanceBackend(t testing.TB) conformance.Backend
- func NewFabric(w *World) query.Fabric
- func QueryStrings(t testing.TB, dsn, sql string, args ...any) []string
- func RunCacheConformance(t *testing.T, newCache func(t *testing.T) cache.Cache)
- func StartClickHouse(t testing.TB) string
- func StartElasticsearch(t testing.TB) string
- func StartFalkorDB(t testing.TB) string
- func StartPostgres(t testing.TB) string
- func StartRedis(t testing.TB) string
- type FakeAnalytics
- type FakeAnalyticsSink
- type FakeBlob
- type FakeCAS
- type FakeCache
- type FakeCatalog
- type FakeDocumentStore
- type FakeGraph
- type FakeNode
- type FakeProjectionState
- type FakeRelational
- type FakeSearch
- type FakeSpatial
- type FakeStore
- type FakeTS
- type FakeVector
- type World
Constants ¶
const ( PostgresImage = "timescale/timescaledb-ha:pg16-all" // PostgresPlainImage is the vanilla upstream Postgres image used for the // primary+standby replication harness (StartPrimaryStandby). It backs the // catalog control database — a single plain table with no pgvector/timescale // needs — and, unlike timescaledb-ha, has no HA entrypoint that fights // pg_basebackup-based standby setup. PostgresPlainImage = "postgres:16-alpine" RedisImage = "redis:7-alpine" FalkorDBImage = "falkordb/falkordb:v4.2.2" // pinned: multi-label + SET n:Label ElasticsearchImage = "elasticsearch:9.4.1" // ClickHouseImage pins a server new enough that lightweight DELETE is GA and // enabled by default (>= 23.3). ClickHouseImage = "clickhouse/clickhouse-server:24.3" )
Container images for the integration harness. timescaledb-ha bundles TimescaleDB and pgvector, matching the production datastore contract.
Variables ¶
var ErrFakeNotFound = coretest.ErrFakeNotFound
ErrFakeNotFound is the not-found sentinel the fakes return.
Functions ¶
func ApplyDDL ¶ added in v0.0.3
ApplyDDL executes the given statements against dsn as the connecting role (typically the superuser/owner DSN). It is the seam tests use to create application-defined materialization targets (e.g. domain.PagesDDL()) that are no longer part of fabriq's shipped migration chain. Apply it BEFORE CreateAppRole so the app role inherits grants on the new tables.
func CreateAppRole ¶
CreateAppRole provisions a NON-superuser application role on a database previously started with StartPostgres and returns a DSN for it.
This mirrors production: migrations run as the schema owner; the application connects as a restricted role so RLS actually applies (Postgres row security NEVER constrains superusers). Call it AFTER running migrations.
func NewConformanceBackend ¶
func NewConformanceBackend(t testing.TB) conformance.Backend
NewConformanceBackend builds a fake-backed conformance.Backend over the domain registry. It is the fast (Docker-free) gate that keeps the fakes from drifting from real-adapter behavior.
func QueryStrings ¶ added in v0.0.6
QueryStrings runs a single-column query against dsn and returns the rows as strings — the seam integration tests use for schema-shape assertions (information_schema / pg_catalog checks).
func RunCacheConformance ¶
RunCacheConformance runs the shared cache conformance suite.
func StartClickHouse ¶ added in v0.0.6
StartClickHouse launches a ClickHouse container and returns its clickhouse:// DSN. The container terminates with the test.
func StartElasticsearch ¶
StartElasticsearch launches a single-node Elasticsearch container (security off, HTTP only) and returns its base URL. The container terminates with the test.
func StartFalkorDB ¶
StartFalkorDB launches a FalkorDB container and returns its address (host:port). The container terminates with the test.
func StartPostgres ¶
StartPostgres launches a Postgres+Timescale+pgvector container and returns its DSN. The container terminates with the test.
func StartRedis ¶
StartRedis launches a Redis container and returns its address (host:port). The container terminates with the test.
Types ¶
type FakeAnalytics ¶ added in v0.0.6
type FakeAnalytics = coretest.FakeAnalytics
The fakes live in core/fabriqtest so the core module can test itself without depending on the main module. These aliases keep github.com/xraph/fabriq/fabriqtest working for anyone importing it.
Aliases, not wrappers: fabriqtest.World and coretest.World are the same type, so methods, struct fields and type assertions all carry over.
func NewFakeAnalytics ¶ added in v0.0.6
func NewFakeAnalytics(reg *registry.Registry) *FakeAnalytics
NewFakeAnalytics builds an in-memory analytics querier.
type FakeAnalyticsSink ¶ added in v0.0.6
type FakeAnalyticsSink = coretest.FakeAnalyticsSink
The fakes live in core/fabriqtest so the core module can test itself without depending on the main module. These aliases keep github.com/xraph/fabriq/fabriqtest working for anyone importing it.
Aliases, not wrappers: fabriqtest.World and coretest.World are the same type, so methods, struct fields and type assertions all carry over.
func NewFakeAnalyticsSink ¶ added in v0.0.6
func NewFakeAnalyticsSink() *FakeAnalyticsSink
NewFakeAnalyticsSink builds an in-memory analytics sink.
type FakeBlob ¶
The fakes live in core/fabriqtest so the core module can test itself without depending on the main module. These aliases keep github.com/xraph/fabriq/fabriqtest working for anyone importing it.
Aliases, not wrappers: fabriqtest.World and coretest.World are the same type, so methods, struct fields and type assertions all carry over.
type FakeCAS ¶
The fakes live in core/fabriqtest so the core module can test itself without depending on the main module. These aliases keep github.com/xraph/fabriq/fabriqtest working for anyone importing it.
Aliases, not wrappers: fabriqtest.World and coretest.World are the same type, so methods, struct fields and type assertions all carry over.
func NewFakeCAS ¶
func NewFakeCAS() *FakeCAS
NewFakeCAS builds an in-memory content-addressable store.
type FakeCache ¶
The fakes live in core/fabriqtest so the core module can test itself without depending on the main module. These aliases keep github.com/xraph/fabriq/fabriqtest working for anyone importing it.
Aliases, not wrappers: fabriqtest.World and coretest.World are the same type, so methods, struct fields and type assertions all carry over.
type FakeCatalog ¶ added in v0.0.6
type FakeCatalog = coretest.FakeCatalog
The fakes live in core/fabriqtest so the core module can test itself without depending on the main module. These aliases keep github.com/xraph/fabriq/fabriqtest working for anyone importing it.
Aliases, not wrappers: fabriqtest.World and coretest.World are the same type, so methods, struct fields and type assertions all carry over.
func NewFakeCatalog ¶ added in v0.0.6
func NewFakeCatalog() *FakeCatalog
NewFakeCatalog builds an in-memory tenant catalog.
type FakeDocumentStore ¶
type FakeDocumentStore = coretest.FakeDocumentStore
The fakes live in core/fabriqtest so the core module can test itself without depending on the main module. These aliases keep github.com/xraph/fabriq/fabriqtest working for anyone importing it.
Aliases, not wrappers: fabriqtest.World and coretest.World are the same type, so methods, struct fields and type assertions all carry over.
type FakeGraph ¶
The fakes live in core/fabriqtest so the core module can test itself without depending on the main module. These aliases keep github.com/xraph/fabriq/fabriqtest working for anyone importing it.
Aliases, not wrappers: fabriqtest.World and coretest.World are the same type, so methods, struct fields and type assertions all carry over.
func NewFakeGraph ¶
func NewFakeGraph(reg *registry.Registry, rel query.RelationalQuerier) *FakeGraph
NewFakeGraph builds a graph querier over a relational querier.
type FakeNode ¶
The fakes live in core/fabriqtest so the core module can test itself without depending on the main module. These aliases keep github.com/xraph/fabriq/fabriqtest working for anyone importing it.
Aliases, not wrappers: fabriqtest.World and coretest.World are the same type, so methods, struct fields and type assertions all carry over.
type FakeProjectionState ¶
type FakeProjectionState = coretest.FakeProjectionState
The fakes live in core/fabriqtest so the core module can test itself without depending on the main module. These aliases keep github.com/xraph/fabriq/fabriqtest working for anyone importing it.
Aliases, not wrappers: fabriqtest.World and coretest.World are the same type, so methods, struct fields and type assertions all carry over.
type FakeRelational ¶
type FakeRelational = coretest.FakeRelational
The fakes live in core/fabriqtest so the core module can test itself without depending on the main module. These aliases keep github.com/xraph/fabriq/fabriqtest working for anyone importing it.
Aliases, not wrappers: fabriqtest.World and coretest.World are the same type, so methods, struct fields and type assertions all carry over.
type FakeSearch ¶
type FakeSearch = coretest.FakeSearch
The fakes live in core/fabriqtest so the core module can test itself without depending on the main module. These aliases keep github.com/xraph/fabriq/fabriqtest working for anyone importing it.
Aliases, not wrappers: fabriqtest.World and coretest.World are the same type, so methods, struct fields and type assertions all carry over.
func NewFakeSearch ¶
func NewFakeSearch(reg *registry.Registry) *FakeSearch
NewFakeSearch builds an in-memory search querier.
type FakeSpatial ¶
type FakeSpatial = coretest.FakeSpatial
The fakes live in core/fabriqtest so the core module can test itself without depending on the main module. These aliases keep github.com/xraph/fabriq/fabriqtest working for anyone importing it.
Aliases, not wrappers: fabriqtest.World and coretest.World are the same type, so methods, struct fields and type assertions all carry over.
type FakeStore ¶
The fakes live in core/fabriqtest so the core module can test itself without depending on the main module. These aliases keep github.com/xraph/fabriq/fabriqtest working for anyone importing it.
Aliases, not wrappers: fabriqtest.World and coretest.World are the same type, so methods, struct fields and type assertions all carry over.
type FakeTS ¶
The fakes live in core/fabriqtest so the core module can test itself without depending on the main module. These aliases keep github.com/xraph/fabriq/fabriqtest working for anyone importing it.
Aliases, not wrappers: fabriqtest.World and coretest.World are the same type, so methods, struct fields and type assertions all carry over.
type FakeVector ¶
type FakeVector = coretest.FakeVector
The fakes live in core/fabriqtest so the core module can test itself without depending on the main module. These aliases keep github.com/xraph/fabriq/fabriqtest working for anyone importing it.
Aliases, not wrappers: fabriqtest.World and coretest.World are the same type, so methods, struct fields and type assertions all carry over.
type World ¶
The fakes live in core/fabriqtest so the core module can test itself without depending on the main module. These aliases keep github.com/xraph/fabriq/fabriqtest working for anyone importing it.
Aliases, not wrappers: fabriqtest.World and coretest.World are the same type, so methods, struct fields and type assertions all carry over.