package
1.40.0
Repository: https://github.com/authzed/spicedb.git
Documentation: pkg.go.dev

# README

PostgreSQL Datastore

Minimum required version can be found here defined as MinimumSupportedPostgresVersion in version.go

PostgreSQL is a traditional relational database management system that is very popular. This datastore implementation allows you to use a PostgreSQL database as the backing durable storage for SpiceDB. Recommended usage: when you are comfortable with having all permissions data stored in a single region.

Configuration

track_commit_timestamp must be set to on for the Watch API to be enabled.

Implementation Caveats

While PostgreSQL uses MVCC to implement its ACID properties, it doesn't offer users the ability to read dirty data without adding an extension. For that reason, the PostgreSQL datastore driver implements a second layer of MVCC where we can manually control all writes to the database. This allows us to track all revisions of the database explicitly and perform point-in-time snapshot queries.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

AllowedMigrations configures a set of additional migrations that will pass the health check (head migration is always allowed).
CredentialsProviderName is the name of the CredentialsProvider implementation to use for dynamically retrieving the datastore credentials at runtime Empty by default.
DebugAnalyzeBeforeStatistics signals to the Statistics method that it should run Analyze on the database before returning statistics.
DefaultQueryExecMode parses a Postgres URI and determines if a default_query_exec_mode has been specified.
EnableTracing enables trace-level logging for the Postgres clients being used by the datastore.
FilterMaximumIDCount is the maximum number of IDs that can be used to filter IDs in queries.
GCEnabled indicates whether garbage collection is enabled.
GCInterval is the the interval at which garbage collection will occur.
GCMaxOperationTime is the maximum operation time of a garbage collection pass before it times out.
GCWindow is the maximum age of a passed revision that will be considered valid.
IncludeQueryParametersInTraces is a flag to set whether to include query parameters in OTEL traces.
MaxRetries is the maximum number of times a retriable transaction will be client-side retried.
MaxRevisionStalenessPercent is the amount of time, expressed as a percentage of the revision quantization window, that a previously computed rounded revision can still be advertised after the next rounded revision would otherwise be ready.
MigrationPhase configures the postgres driver to the proper state of a multi-phase migration.
NewPostgresDatastore initializes a SpiceDB datastore that uses a PostgreSQL database by leveraging manual book-keeping to implement revisioning.
NewReadOnlyPostgresDatastore initializes a SpiceDB datastore that uses a PostgreSQL database by leveraging manual book-keeping to implement revisioning.
ParseRevisionString parses a revision string into a Postgres revision.
ReadConnHealthCheckInterval is the frequency at which both idle and max lifetime connections are checked, and also the frequency at which the minimum number of connections is checked.
ReadConnMaxIdleTime is the duration after which an idle read connection will be automatically closed by the health check.
ReadConnMaxLifetime is the duration since creation after which a read connection will be automatically closed.
ReadConnMaxLifetimeJitter is an interval to wait up to after the max lifetime to close the connection.
ReadConnsMaxOpen is the maximum size of the connection pool used for reads.
ReadConnsMinOpen is the minimum size of the connection pool used for reads.
ReadStrictMode sets whether strict mode is used for reads in the Postgres reader.
RegisterTypes registers pgSnapshot and xid8 with a pgtype.ConnInfo.
RevisionQuantization is the time bucket size to which advertised revisions will be rounded.
WatchBufferLength is the number of entries that can be stored in the watch buffer while awaiting read by the client.
WatchBufferWriteTimeout is the maximum timeout for writing to the watch buffer, after which the caller to the watch will be disconnected.
WithColumnOptimization sets the column optimization option for the datastore.
WithEnablePrometheusStats marks whether Prometheus metrics provided by the Postgres clients being used by the datastore are enabled.
WithExpirationDisabled disables support for relationship expiration.
WithQueryInterceptor adds an interceptor to all underlying postgres queries By default, no query interceptor is used.
WriteConnHealthCheckInterval is the frequency at which both idle and max lifetime connections are checked, and also the frequency at which the minimum number of connections is checked.
WriteConnMaxIdleTime is the duration after which an idle write connection will be automatically closed by the health check.
WriteConnMaxLifetime is the duration since creation after which a write connection will be automatically closed.
WriteConnMaxLifetimeJitter is an interval to wait up to after the max lifetime to close the connection.
WriteConnsMaxOpen is the maximum size of the connection pool used for writes.
WriteConnsMinOpen is the minimum size of the connection pool used for writes.

# Constants

No description provided by the author
MaxLegacyXIPDelta is the maximum allowed delta between the xmin and xmax revisions IDs on a *legacy* revision stored as a revision decimal.

# Structs

No description provided by the author
No description provided by the author

# Interfaces

Adapted from https://github.com/jackc/pgx/blob/ca022267dbbfe7a8ba7070557352a5cd08f6cb37/pgtype/uint32.go.
No description provided by the author

# Type aliases

Option provides the facility to configure how clients within the Postgres datastore interact with the running Postgres database.