MCPcopy Create free account
hub / github.com/Permify/permify / NewDataReader

Function NewDataReader

internal/storage/postgres/data_reader.go:34–39  ·  view source on GitHub ↗

NewDataReader is a constructor function for DataReader. It initializes a new DataReader with a given database, a logger, and sets transaction options to be read-only with Repeatable Read isolation level.

(database *db.Postgres)

Source from the content-addressed store, hash-verified

32// NewDataReader is a constructor function for DataReader.
33// It initializes a new DataReader with a given database, a logger, and sets transaction options to be read-only with Repeatable Read isolation level.
34func NewDataReader(database *db.Postgres) *DataReader {
35 return &DataReader{
36 database: database, // Set the database to the passed in PostgreSQL instance
37 txOptions: pgx.TxOptions{IsoLevel: pgx.RepeatableRead, AccessMode: pgx.ReadOnly}, // Set the transaction options
38 }
39}
40
41// QueryRelationships reads relation tuples from the storage based on the given filter.
42func (r *DataReader) QueryRelationships(ctx context.Context, tenantID string, filter *base.TupleFilter, snap string, pagination database.CursorPagination) (it *database.TupleIterator, err error) {

Callers 3

gc_test.goFile · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected