Documentation
¶
Overview ¶
Package boltdb contains the boltdb implementation of the Schemar interfaces.
Index ¶
- Variables
- type Schemar
- func (s *Schemar) CreateDatabase(tx dax.Transaction, qdb *dax.QualifiedDatabase) error
- func (s *Schemar) CreateField(tx dax.Transaction, qtid dax.QualifiedTableID, fld *dax.Field) error
- func (s *Schemar) CreateTable(tx dax.Transaction, qtbl *dax.QualifiedTable) error
- func (s *Schemar) DatabaseByID(tx dax.Transaction, qdbid dax.QualifiedDatabaseID) (*dax.QualifiedDatabase, error)
- func (s *Schemar) DatabaseByName(tx dax.Transaction, orgID dax.OrganizationID, dbname dax.DatabaseName) (*dax.QualifiedDatabase, error)
- func (s *Schemar) Databases(tx dax.Transaction, orgID dax.OrganizationID, ids ...dax.DatabaseID) ([]*dax.QualifiedDatabase, error)
- func (s *Schemar) DropDatabase(tx dax.Transaction, qdbid dax.QualifiedDatabaseID) error
- func (s *Schemar) DropField(tx dax.Transaction, qtid dax.QualifiedTableID, fldName dax.FieldName) error
- func (s *Schemar) DropTable(tx dax.Transaction, qtid dax.QualifiedTableID) error
- func (s *Schemar) SetDatabaseOptions(tx dax.Transaction, qdbid dax.QualifiedDatabaseID, opts dax.DatabaseOptions) error
- func (s *Schemar) Table(tx dax.Transaction, qtid dax.QualifiedTableID) (*dax.QualifiedTable, error)
- func (s *Schemar) TableID(tx dax.Transaction, qdbid dax.QualifiedDatabaseID, name dax.TableName) (dax.QualifiedTableID, error)
- func (s *Schemar) Tables(tx dax.Transaction, qdbid dax.QualifiedDatabaseID, ids ...dax.TableID) ([]*dax.QualifiedTable, error)
Constants ¶
This section is empty.
Variables ¶
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 ¶
NewSchemar returns a new instance of Schemar with default values.
func (*Schemar) CreateDatabase ¶
func (s *Schemar) CreateDatabase(tx dax.Transaction, qdb *dax.QualifiedDatabase) error
CreateDatabase creates the database provided. If a database with the same name already exists then an error is returned. For now, we are not going to store the tables in the schemar Database struct.
func (*Schemar) CreateField ¶
func (s *Schemar) CreateField(tx dax.Transaction, 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(tx dax.Transaction, 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) DatabaseByID ¶
func (s *Schemar) DatabaseByID(tx dax.Transaction, qdbid dax.QualifiedDatabaseID) (*dax.QualifiedDatabase, error)
func (*Schemar) DatabaseByName ¶
func (s *Schemar) DatabaseByName(tx dax.Transaction, orgID dax.OrganizationID, dbname dax.DatabaseName) (*dax.QualifiedDatabase, error)
func (*Schemar) Databases ¶
func (s *Schemar) Databases(tx dax.Transaction, orgID dax.OrganizationID, ids ...dax.DatabaseID) ([]*dax.QualifiedDatabase, error)
func (*Schemar) DropDatabase ¶
func (s *Schemar) DropDatabase(tx dax.Transaction, qdbid dax.QualifiedDatabaseID) error
DropDatabase drops the given database. If the named/IDed database does not exist then an error is returned.
func (*Schemar) DropField ¶
func (s *Schemar) DropField(tx dax.Transaction, qtid dax.QualifiedTableID, fldName dax.FieldName) error
DropField removes the field from the table.
func (*Schemar) DropTable ¶
func (s *Schemar) DropTable(tx dax.Transaction, qtid dax.QualifiedTableID) error
DropTable drops the given table. If the named/IDed table does not exist then an error is returned.
func (*Schemar) SetDatabaseOptions ¶
func (s *Schemar) SetDatabaseOptions(tx dax.Transaction, qdbid dax.QualifiedDatabaseID, opts dax.DatabaseOptions) error
SetDatabaseOptions overwrites the existing database options with those provided for the given database.
func (*Schemar) Table ¶
func (s *Schemar) Table(tx dax.Transaction, qtid dax.QualifiedTableID) (*dax.QualifiedTable, error)
Table returns the TableInfo for the given table. An error is returned if the table does not exist.
func (*Schemar) TableID ¶
func (s *Schemar) TableID(tx dax.Transaction, qdbid dax.QualifiedDatabaseID, name dax.TableName) (dax.QualifiedTableID, error)
func (*Schemar) Tables ¶
func (s *Schemar) Tables(tx dax.Transaction, qdbid dax.QualifiedDatabaseID, ids ...dax.TableID) ([]*dax.QualifiedTable, error)
Tables returns a list of Table for all existing tables. If one or more table IDs is provided, then only those will be included in the output.