Versions in this module Expand all Collapse all v0 v0.0.6 Jul 16, 2026 Changes in this version + var ErrRawSQLUnsupported = fabriqerr.ErrRawSQLUnsupported + func ValidateAnalyticsConfig(cfg Config) error + type AdaptivePoolConfig struct + ConnBudget int + Enabled bool + HeapSoftLimit uint64 + Interval time.Duration + Max int + Min int + PerShardConns int + type AnalyticsConfig struct + Batch int + DSN string + EventRetention time.Duration + HashSalt string + PartitionEvents bool + func (c AnalyticsConfig) Enabled() bool + type CatalogConfig struct + Adaptive AdaptivePoolConfig + AllowSuperuser bool + CacheTTL time.Duration + ClusterDSNs map[string]string + DSN string + Isolation string + MaxActiveShards int + ReplicaDSNs []string + SharedSchema string + func (c CatalogConfig) Enabled() bool + func (c CatalogConfig) SchemaMode() bool type Config + Analytics AnalyticsConfig + Catalog CatalogConfig + Insights InsightsConfig + ShardPins map[string]string type Fabriq + func (f *Fabriq) Analytics() query.AnalyticsQuerier + func (f *Fabriq) NodePath(ctx context.Context, id string) (string, error) + type InsightsConfig struct + Enabled bool type Ports + Analytics query.AnalyticsQuerier type Stores + Analytics analytics.Sink + Catalog *postgres.CatalogStore + func (s *Stores) AnalyticsBackfiller(reg *registry.Registry) (*analytics.Backfiller, error) + func (s *Stores) AnalyticsConsumer(reg *registry.Registry, upcasters *event.UpcasterChain) (*analytics.Consumer, error) + func (s *Stores) AnalyticsReconciler(reg *registry.Registry) (*analytics.Reconciler, error) + func (s *Stores) AnalyticsReprojector(reg *registry.Registry) (*analytics.Reprojector, error) + func (s *Stores) AttachMetrics(m *metrics.Metrics) + func (s *Stores) CatalogReadStats() (primary, replica, failover int64, ok bool) + func (s *Stores) InsightsConsumer(reg *registry.Registry) (*insights.Consumer, error) + func (s *Stores) PoolCap() (int, bool) + func (s *Stores) PoolStats() (open, held int, ok bool) + func (s *Stores) RollupSurfaceFor(ctx context.Context, tenantID string) (insights.RollupSurface, context.Context, func(), error) + func (s *Stores) TenantSweeper() sweep.TenantSweeper v0.0.5 Jul 3, 2026 Changes in this version type Fabriq + func (f *Fabriq) PublishDocumentPresence(ctx context.Context, docID, nodeID string, data json.RawMessage) error + func (f *Fabriq) SubscribeDocumentPresence(ctx context.Context, docID string) (<-chan query.Delta, error) type Stores + Docs *postgres.DocStore v0.0.4 Jul 2, 2026 Changes in this version + const CodeAlreadyExists + const CodeConstraintViolation + const CodeInternal + const CodeInvalidInput + const CodeNotConfigured + const CodeNotFound + const CodePermissionDenied + const CodeSchemaMismatch + const CodeSerialization + const CodeTimeout + const CodeUnauthorized + const CodeUnavailable + const CodeVersionConflict + var ErrDynamicUnavailable = errors.New("fabriq: dynamic schema management requires Open with a Postgres store") + type Code = fabriqerr.Code type Config + Documents DocumentsConfig + type DocumentsConfig struct + ArchiveHistory bool + type DynamicDDL interface + AddGuardedTable func(table string) + DropDynamic func(ctx context.Context, table string) error + DropDynamicColumn func(ctx context.Context, table, column string) error + EnsureDynamic func(context.Context, *registry.Entity) error + RemoveGuardedTable func(table string) + RenameDynamicColumn func(ctx context.Context, table, oldName, newName string) error + type Error = fabriqerr.Error type Fabriq + func (f *Fabriq) AlterDynamic(ctx context.Context, spec registry.EntitySpec) error + func (f *Fabriq) DefineDynamic(ctx context.Context, spec registry.EntitySpec) error + func (f *Fabriq) DropDynamic(ctx context.Context, typeName string) error + func (f *Fabriq) DropDynamicField(ctx context.Context, typeName, col string) error + func (f *Fabriq) RenameDynamicField(ctx context.Context, typeName, oldCol, newCol string) error + type Meta = fabriqerr.Meta v0.0.3 Jun 22, 2026 Changes in this version type Config + func (c Config) InjectedGrove() *grove.DB + func (c Config) WithInjectedGrove(db *grove.DB) Config v0.0.2 Jun 21, 2026 v0.0.1 Jun 20, 2026 Changes in this version + var ErrNoTenant = tenant.ErrNoTenant + var ErrNodeLocked = errors.New("fabriq: fs_node is locked") + var ErrNodeNameConflict = errors.New("fabriq: fs_node name already exists in folder") + var ErrNotContainer = errors.New("fabriq: parent is not a folder") + var ErrNotFound = fabriqerr.ErrNotFound + var ErrProjectionLag = fabriqerr.ErrProjectionLag + var ErrStoreNotConfigured = fabriqerr.ErrStoreNotConfigured + var ErrTenantHookTripped = tenant.ErrTenantHookTripped + var ErrVersionConflict = fabriqerr.ErrVersionConflict + func For[T any](f *Fabriq) (*query.Repo[T], error) + func Open(ctx context.Context, reg *registry.Registry, cfg Config, opts ...Option) (*Fabriq, *Stores, error) + type BlobRef struct + Hash string + ID string + Size int64 + Version int64 + type BlobSourceView struct + Auth map[string]any + BasePath string + Enabled bool + Endpoint string + FileFilter map[string]any + ID string + Name string + ProjectID string + Provider string + Tags map[string]string + Version int64 + WatchConfig map[string]any + type CacheConfig struct + L1Enabled bool + L1Size int + L1TTL time.Duration + type Config struct + Cache CacheConfig + CustomAppliers []projection.CustomApplier + Elasticsearch ElasticsearchConfig + Encryption EncryptionConfig + FalkorDB FalkorDBConfig + Postgres PostgresConfig + Projections ProjectionsConfig + Redis RedisConfig + Shards []ShardConfig + Storage StorageConfig + Subscriptions SubscriptionsConfig + func (c Config) Options() []Option + func (c Config) Validate() error + type CreateFileOpts struct + ContentType string + type CreateShareInput struct + CreatedBy string + ExpiresAt *time.Time + MaxDownloads *int + NodeID string + PasswordHash string + Permission string + Token string + type ElasticsearchConfig struct + Addrs []string + Password string + Username string + type EncryptionConfig struct + Key string + type Fabriq struct + func New(reg *registry.Registry, ports Ports, opts ...Option) (*Fabriq, error) + func (f *Fabriq) AddBookmark(ctx context.Context, userID, nodeID string, sortOrder int) (string, error) + func (f *Fabriq) Ancestors(ctx context.Context, id string) ([]domain.FsNode, error) + func (f *Fabriq) Blob() blob.Store + func (f *Fabriq) CatchUp(ctx context.Context, scope query.SubscribeScope, afterID string, limit int) ([]query.Delta, error) + func (f *Fabriq) Close() error + func (f *Fabriq) CreateFile(ctx context.Context, parentID, name string, r io.Reader, opts CreateFileOpts) (FsRef, error) + func (f *Fabriq) CreateFolder(ctx context.Context, parentID, name string) (FsRef, error) + func (f *Fabriq) CreateMount(ctx context.Context, parentID, name string, mountConfig map[string]any) (FsRef, error) + func (f *Fabriq) CreateShare(ctx context.Context, in CreateShareInput) (string, error) + func (f *Fabriq) CreateSource(ctx context.Context, in SourceInput) (SourceRef, error) + func (f *Fabriq) DeleteBlob(ctx context.Context, blobObjectID string) error + func (f *Fabriq) DeleteShare(ctx context.Context, id string) error + func (f *Fabriq) DeleteSource(ctx context.Context, id string) error + func (f *Fabriq) Descendants(ctx context.Context, id string) ([]domain.FsNode, error) + func (f *Fabriq) Document() document.Store + func (f *Fabriq) Exec(ctx context.Context, cmd command.Command) (command.Result, error) + func (f *Fabriq) ExecBatch(ctx context.Context, cmds []command.Command) ([]command.Result, error) + func (f *Fabriq) GetBlob(ctx context.Context, blobObjectID string) (io.ReadCloser, BlobRef, error) + func (f *Fabriq) GetNode(ctx context.Context, id string) (domain.FsNode, error) + func (f *Fabriq) GetNodeByPath(ctx context.Context, path string) (domain.FsNode, error) + func (f *Fabriq) GetShareByToken(ctx context.Context, token string) (domain.FsShare, error) + func (f *Fabriq) GetSource(ctx context.Context, id string) (BlobSourceView, error) + func (f *Fabriq) GrantPermission(ctx context.Context, ...) (string, error) + func (f *Fabriq) Graph() query.GraphQuerier + func (f *Fabriq) Hub() *subscribe.Hub + func (f *Fabriq) IncrementShareDownload(ctx context.Context, id string) error + func (f *Fabriq) ListChildren(ctx context.Context, parentID string, limit, offset int) ([]domain.FsNode, error) + func (f *Fabriq) ListNodePermissions(ctx context.Context, nodeID string) ([]domain.FsPermission, error) + func (f *Fabriq) ListNodeShares(ctx context.Context, nodeID string) ([]domain.FsShare, error) + func (f *Fabriq) ListPrincipalPermissions(ctx context.Context, principalType, principalID string) ([]domain.FsPermission, error) + func (f *Fabriq) ListSources(ctx context.Context) ([]BlobSourceView, error) + func (f *Fabriq) ListUserBookmarks(ctx context.Context, userID string) ([]domain.FsBookmark, error) + func (f *Fabriq) LiveQuery(ctx context.Context, q livequery.LiveQuery) (livequery.Snapshot, <-chan livequery.LiveDelta, *livequery.Handle, error) + func (f *Fabriq) LockNode(ctx context.Context, id, by string) error + func (f *Fabriq) MoveNode(ctx context.Context, id, newParentID string) (FsRef, error) + func (f *Fabriq) PermanentDeleteNode(ctx context.Context, id string) error + func (f *Fabriq) PutBlob(ctx context.Context, r io.Reader, opts PutBlobOpts) (BlobRef, error) + func (f *Fabriq) ReconcileLiveQueries(ctx context.Context) (int, error) + func (f *Fabriq) Registry() *registry.Registry + func (f *Fabriq) Relational() query.RelationalQuerier + func (f *Fabriq) RemoveBookmark(ctx context.Context, id string) error + func (f *Fabriq) RenameNode(ctx context.Context, id, newName string) (FsRef, error) + func (f *Fabriq) ReplaceFile(ctx context.Context, id string, r io.Reader, opts CreateFileOpts) (FsRef, error) + func (f *Fabriq) ResolveMount(ctx context.Context, id string) (map[string]any, error) + func (f *Fabriq) RestoreNode(ctx context.Context, id string) error + func (f *Fabriq) RevokePermission(ctx context.Context, id string) error + func (f *Fabriq) Search() query.SearchQuerier + func (f *Fabriq) SearchNodesByName(ctx context.Context, q string, limit int) ([]domain.FsNode, error) + func (f *Fabriq) Spatial() query.SpatialQuerier + func (f *Fabriq) Subscribe(ctx context.Context, scope query.SubscribeScope) (<-chan query.Delta, error) + func (f *Fabriq) SubscribeDocument(ctx context.Context, docID string) (<-chan query.Delta, error) + func (f *Fabriq) Timeseries() query.TSQuerier + func (f *Fabriq) TrashNode(ctx context.Context, id string) error + func (f *Fabriq) UnlockNode(ctx context.Context, id string) error + func (f *Fabriq) Upcasters() *event.UpcasterChain + func (f *Fabriq) UpdateMount(ctx context.Context, id string, mountConfig map[string]any) (FsRef, error) + func (f *Fabriq) UpdateSource(ctx context.Context, id string, in SourceInput) (SourceRef, error) + func (f *Fabriq) Vector() query.VectorQuerier + func (f *Fabriq) WaitForProjection(ctx context.Context, proj, aggregate, aggID string, version int64) error + func (f *Fabriq) WatchChildren(ctx context.Context, parentID string, limit int) (livequery.Snapshot, <-chan livequery.LiveDelta, *livequery.Handle, error) + type FalkorDBConfig struct + Addr string + Password string + Username string + type FsRef struct + ID string + Name string + NodeType string + ParentID string + Path string + Version int64 + type LiveReader interface + type NotFoundError = fabriqerr.NotFoundError + type Option func(*settings) + func WithAuthz(fn subscribe.AuthzFunc) Option + func WithClock(now func() time.Time) Option + func WithConflationWindow(d time.Duration) Option + func WithDocumentAuthz(fn func(ctx context.Context, docID string) error) Option + func WithEncryptor(e crypto.Encryptor) Option + func WithLifecycleHook(hooks ...command.LifecycleHook) Option + func WithLiveAuthz(fn livequery.AuthzFunc) Option + func WithLiveCushion(n int) Option + func WithStreamMaxLen(n int64) Option + func WithSubscribeBuffer(n int) Option + func WithTraceparent(fn func(context.Context) string) Option + func WithUpcasters(chain *event.UpcasterChain) Option + func WithWaitPollInterval(d time.Duration) Option + type Ports struct + Blob blob.Store + CAS blob.CAS + Cache cache.Cache + Documents document.Store + Graph query.GraphQuerier + Live LiveReader + ProjectionState projection.StateReader + Relational query.RelationalQuerier + Search query.SearchQuerier + Spatial query.SpatialQuerier + Store command.Store + Timeseries query.TSQuerier + Vector query.VectorQuerier + type PostgresConfig struct + DSN string + PoolSize int + type ProjectionsConfig struct + Graph bool + Search bool + type PutBlobOpts struct + ContentType string + type RedisConfig struct + Addr string + DB int + Password string + Username string + type ShardConfig struct + DSN string + ID string + PoolSize int + type ShardPG struct + ID string + PG *postgres.Adapter + type SourceInput struct + Auth map[string]any + BasePath string + Enabled bool + Endpoint string + FileFilter map[string]any + Name string + ProjectID string + Provider string + Tags map[string]string + WatchConfig map[string]any + type SourceRef struct + ID string + Version int64 + type StorageConfig struct + DefaultBucket string + EnableCas bool + StorageDriver string + type Stores struct + Blob *trovestore.Adapter + CAS *trovestore.CASStore + Cache corecache.Cache + Elastic *elastic.Adapter + Falkor *falkordb.Adapter + Postgres *postgres.Adapter + Redis *redis.Adapter + Shards *shard.Set + func (s *Stores) AllTenants(ctx context.Context) ([]string, error) + func (s *Stores) BlobReconciler(grace time.Duration) (*trovestore.BlobReconciler, error) + func (s *Stores) Close() error + func (s *Stores) GraphEngine(reg *registry.Registry, upcasters *event.UpcasterChain) (*projection.Engine, error) + func (s *Stores) GraphRebuilder(reg *registry.Registry) (*projection.Rebuilder, error) + func (s *Stores) GraphReconciler(reg *registry.Registry) (*projection.Reconciler, error) + func (s *Stores) SearchEngine(reg *registry.Registry, upcasters *event.UpcasterChain) (*projection.Engine, error) + func (s *Stores) SearchRebuilder(reg *registry.Registry) (*projection.Rebuilder, error) + func (s *Stores) SearchReconciler(reg *registry.Registry) (*projection.Reconciler, error) + func (s *Stores) ShardPGs() []ShardPG + type SubscriptionsConfig struct + ConflationWindow time.Duration + StreamMaxLen int64 + SubscribeBuffer int + type VersionConflictError = fabriqerr.VersionConflictError