postgres

package
v0.0.0-...-1cdd71b Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FunctionFor

func FunctionFor(funcName string, ruleset []zanzigo.InferredRule) (string, string, error)

TODO: respect maxDepth!

func RunMigrations

func RunMigrations(databaseURL string) error

func SelectQueryFor

func SelectQueryFor(ruleset []zanzigo.InferredRule, brackets bool, placeholders ...string) (string, error)

Types

type PostgresOption

type PostgresOption interface {
	// contains filtered or unexported methods
}

func UseFunctions

func UseFunctions() PostgresOption

type PostgresStorage

type PostgresStorage struct {
	// contains filtered or unexported fields
}

func NewPostgresStorage

func NewPostgresStorage(databaseURL string, options ...PostgresOption) (*PostgresStorage, error)

func (*PostgresStorage) Close

func (s *PostgresStorage) Close() error

func (*PostgresStorage) List

func (s *PostgresStorage) List(ctx context.Context, t zanzigo.Tuple, p zanzigo.Pagination) ([]zanzigo.Tuple, uuid.UUID, error)

func (*PostgresStorage) PrepareRuleset

func (s *PostgresStorage) PrepareRuleset(object, relation string, ruleset []zanzigo.InferredRule) (zanzigo.Userdata, error)

func (*PostgresStorage) QueryChecks

func (s *PostgresStorage) QueryChecks(ctx context.Context, crs []zanzigo.Check) ([]zanzigo.MarkedTuple, error)

func (*PostgresStorage) Read

func (s *PostgresStorage) Read(ctx context.Context, t zanzigo.Tuple) (uuid.UUID, error)

func (*PostgresStorage) Write

func (s *PostgresStorage) Write(ctx context.Context, t zanzigo.Tuple) error

Jump to

Keyboard shortcuts

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