schemar

package
v3.26.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package schemar provides the core Schemar interface.

Index

Constants

View Source
const (
	ErrCodeTableIDInvalid    errors.Code = "TableIDInvalid"
	ErrCodeTableNameInvalid  errors.Code = "TableNameInvalid"
	ErrCodeInvalidPrimaryKey errors.Code = "InvalidPrimaryKey"

	ErrCodeFieldNameInvalid errors.Code = "FieldNameInvalid"
)

Variables

This section is empty.

Functions

func NewErrFieldNameInvalid

func NewErrFieldNameInvalid(fieldName dax.FieldName) error

func NewErrInvalidPrimaryKey

func NewErrInvalidPrimaryKey() error

func NewErrTableIDInvalid

func NewErrTableIDInvalid(tableID dax.TableID) error

func NewErrTableNameInvalid

func NewErrTableNameInvalid(tableName dax.TableName) error

Types

type NopSchemar

type NopSchemar struct{}

NopSchemar is a no-op implementation of the Schemar interface.

func NewNopSchemar

func NewNopSchemar() *NopSchemar

func (*NopSchemar) CreateField

func (s *NopSchemar) CreateField(ctx context.Context, qtid dax.QualifiedTableID, fld *dax.Field) error

func (*NopSchemar) CreateTable

func (s *NopSchemar) CreateTable(ctx context.Context, qtbl *dax.QualifiedTable) error

func (*NopSchemar) DropField

func (s *NopSchemar) DropField(ctx context.Context, qtid dax.QualifiedTableID, fld dax.FieldName) error

func (*NopSchemar) DropTable

func (s *NopSchemar) DropTable(ctx context.Context, qtid dax.QualifiedTableID) error

func (*NopSchemar) Table

func (*NopSchemar) Tables

func (s *NopSchemar) Tables(ctx context.Context, qual dax.TableQualifier, ids ...dax.TableID) ([]*dax.QualifiedTable, error)

type Schemar

type Schemar interface {
	CreateTable(context.Context, *dax.QualifiedTable) error
	DropTable(context.Context, dax.QualifiedTableID) error
	CreateField(context.Context, dax.QualifiedTableID, *dax.Field) error
	DropField(context.Context, dax.QualifiedTableID, dax.FieldName) error
	Table(context.Context, dax.QualifiedTableID) (*dax.QualifiedTable, error)
	Tables(context.Context, dax.TableQualifier, ...dax.TableID) ([]*dax.QualifiedTable, error)

	// TableID is a reverse-lookup method to get the TableID for a given
	// qualified TableName.
	TableID(context.Context, dax.TableQualifier, dax.TableName) (dax.QualifiedTableID, error)
}

Directories

Path Synopsis
Package boltdb contains the boltdb implementation of the Schemar interfaces.
Package boltdb contains the boltdb implementation of the Schemar interfaces.

Jump to

Keyboard shortcuts

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