datastores

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLStore

type SQLStore struct {
	DB *sql.DB
}

SQLStore implements the RelationTupleStore interface for a sql storage adapter.

func (*SQLStore) ListRelationTuples

ListRelationTuples lists the relation tuples matching the request query and filters the response fields by the provided field mask.

func (*SQLStore) RowCount

func (s *SQLStore) RowCount(ctx context.Context, query ac.RelationTupleQuery) (int64, error)

RowCount returns the number of rows matching the relation tuple query provided.

func (*SQLStore) SubjectSets

func (s *SQLStore) SubjectSets(ctx context.Context, object ac.Object, relations ...string) ([]ac.SubjectSet, error)

SubjectSets fetches the subject sets for all of the (object, relation) pairs provided.

func (*SQLStore) TransactRelationTuples

func (s *SQLStore) TransactRelationTuples(ctx context.Context, tupleInserts []*ac.InternalRelationTuple, tupleDeletes []*ac.InternalRelationTuple) error

TransactRelationTuples applies, with the same txn, the relation tuple inserts and deletions provided. Each insertion/deletion includes a corresponding changelog entry with an operation indicating what was applied.

Jump to

Keyboard shortcuts

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