boltdb

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: 11 Imported by: 0

Documentation

Overview

Package boltdb contains the boltdb implementation of the Schemar interfaces.

Index

Constants

This section is empty.

Variables

View Source
var SchemarBuckets []boltdb.Bucket = []boltdb.Bucket{
	bucketSchemar,
}

SchemarBuckets defines the buckets used by this package. It can be called during setup to create the buckets ahead of time.

Functions

This section is empty.

Types

type Schemar

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

func NewSchemar

func NewSchemar(db *boltdb.DB, logger logger.Logger) *Schemar

NewSchemar returns a new instance of Schemar with default values.

func (*Schemar) CreateField

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

CreateField creates the field provided in the given table. If a field with the same name already exists then an error is returned.

func (*Schemar) CreateTable

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

CreateTable creates the table provided. If a table with the same name already exists then an error is returned.

func (*Schemar) DropField

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

DropField removes the field from the table.

func (*Schemar) DropTable

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

DropTable drops the given table. If the named/IDed table does not exist then an error is returned.

func (*Schemar) Table

Table returns the TableInfo for the given table. An error is returned if the table does not exist.

func (*Schemar) TableID

func (*Schemar) Tables

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

Tables returns a list of Table for all existing tables. If one or more table names is provided, then only those will be included in the output.

Jump to

Keyboard shortcuts

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