postgres

package
v0.0.0-alpha9 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RelationTuplesTable   = "relation_tuples"
	SchemaDefinitionTable = "schema_definitions"
	TransactionsTable     = "transactions"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RelationshipReader

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

func NewRelationshipReader

func NewRelationshipReader(database *db.Postgres) *RelationshipReader

NewRelationshipReader - Creates a new RelationshipReader

func (*RelationshipReader) GetUniqueEntityIDsByEntityType

func (r *RelationshipReader) GetUniqueEntityIDsByEntityType(ctx context.Context, typ string, t string) (ids []string, err error)

GetUniqueEntityIDsByEntityType - Gets all unique entity ids for a given entity type

func (*RelationshipReader) HeadSnapshot

func (r *RelationshipReader) HeadSnapshot(ctx context.Context) (token.SnapToken, error)

HeadSnapshot - Gets the latest token

func (*RelationshipReader) QueryRelationships

func (r *RelationshipReader) QueryRelationships(ctx context.Context, filter *base.TupleFilter, t string) (database.ITupleCollection, error)

QueryRelationships - Gets all relationships for a given filter

type RelationshipWriter

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

RelationshipWriter - Structure for Relationship Writer

func NewRelationshipWriter

func NewRelationshipWriter(database *db.Postgres) *RelationshipWriter

NewRelationshipWriter - Creates a new RelationTupleReader

func (*RelationshipWriter) DeleteRelationships

func (w *RelationshipWriter) DeleteRelationships(ctx context.Context, filter *base.TupleFilter) (token.EncodedSnapToken, error)

DeleteRelationships - Deletes a collection of relationships to the database

func (*RelationshipWriter) WriteRelationships

func (w *RelationshipWriter) WriteRelationships(ctx context.Context, collection database.ITupleCollection) (token.EncodedSnapToken, error)

WriteRelationships - Writes a collection of relationships to the database

type SchemaReader

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

SchemaReader - Structure for SchemaReader

func NewSchemaReader

func NewSchemaReader(database *db.Postgres) *SchemaReader

NewSchemaReader - Creates a new SchemaReader

func (*SchemaReader) HeadVersion

func (r *SchemaReader) HeadVersion(ctx context.Context) (version string, err error)

HeadVersion - Finds the latest version of the schema.

func (*SchemaReader) ReadSchema

func (r *SchemaReader) ReadSchema(ctx context.Context, version string) (schema *base.IndexedSchema, err error)

ReadSchema - Reads entity config from the repository.

func (*SchemaReader) ReadSchemaDefinition

func (r *SchemaReader) ReadSchemaDefinition(ctx context.Context, entityType string, version string) (*base.EntityDefinition, string, error)

ReadSchemaDefinition - Reads entity config from the repository.

type SchemaWriter

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

SchemaWriter - Structure for SchemaWriter

func NewSchemaWriter

func NewSchemaWriter(database *db.Postgres) *SchemaWriter

NewSchemaWriter creates a new SchemaWriter

func (*SchemaWriter) WriteSchema

func (w *SchemaWriter) WriteSchema(ctx context.Context, schemas []repositories.SchemaDefinition) (string, error)

WriteSchema writes a schema to the database

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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