Documentation ¶
Overview ¶
Package schemar provides the core Schemar interface.
Index ¶
- Constants
- func NewErrDatabaseIDInvalid(databaseID dax.DatabaseID) error
- func NewErrDatabaseNameInvalid(databaseName dax.DatabaseName) error
- func NewErrFieldNameInvalid(fieldName dax.FieldName) error
- func NewErrInvalidPrimaryKey() error
- func NewErrTableIDInvalid(tableID dax.TableID) error
- func NewErrTableNameInvalid(tableName dax.TableName) error
- type NopSchemar
- func (s *NopSchemar) CreateDatabase(tx dax.Transaction, qtbl *dax.QualifiedDatabase) error
- func (s *NopSchemar) CreateField(tx dax.Transaction, qtid dax.QualifiedTableID, fld *dax.Field) error
- func (s *NopSchemar) CreateTable(tx dax.Transaction, qtbl *dax.QualifiedTable) error
- func (s *NopSchemar) DatabaseByID(dax.Transaction, dax.QualifiedDatabaseID) (*dax.QualifiedDatabase, error)
- func (s *NopSchemar) DatabaseByName(dax.Transaction, dax.OrganizationID, dax.DatabaseName) (*dax.QualifiedDatabase, error)
- func (s *NopSchemar) Databases(dax.Transaction, dax.OrganizationID, ...dax.DatabaseID) ([]*dax.QualifiedDatabase, error)
- func (s *NopSchemar) DropDatabase(tx dax.Transaction, qdbid dax.QualifiedDatabaseID) error
- func (s *NopSchemar) DropField(tx dax.Transaction, qtid dax.QualifiedTableID, fld dax.FieldName) error
- func (s *NopSchemar) DropTable(tx dax.Transaction, qtid dax.QualifiedTableID) error
- func (s *NopSchemar) SetDatabaseOption(tx dax.Transaction, qdbid dax.QualifiedDatabaseID, option string, value string) error
- func (s *NopSchemar) Table(tx dax.Transaction, qtid dax.QualifiedTableID) (*dax.QualifiedTable, error)
- func (s *NopSchemar) TableID(dax.Transaction, dax.QualifiedDatabaseID, dax.TableName) (dax.QualifiedTableID, error)
- func (s *NopSchemar) Tables(tx dax.Transaction, qdbid dax.QualifiedDatabaseID, ids ...dax.TableID) ([]*dax.QualifiedTable, error)
- type Schemar
Constants ¶
View Source
const ( ErrCodeDatabaseIDInvalid errors.Code = "DatabaseIDInvalid" ErrCodeDatabaseNameInvalid errors.Code = "DatabaseNameInvalid" ErrCodeTableIDInvalid errors.Code = "TableIDInvalid" ErrCodeTableNameInvalid errors.Code = "TableNameInvalid" ErrCodeInvalidPrimaryKey errors.Code = "InvalidPrimaryKey" ErrCodeFieldNameInvalid errors.Code = "FieldNameInvalid" )
Variables ¶
This section is empty.
Functions ¶
func NewErrDatabaseIDInvalid ¶
func NewErrDatabaseIDInvalid(databaseID dax.DatabaseID) error
func NewErrDatabaseNameInvalid ¶
func NewErrDatabaseNameInvalid(databaseName dax.DatabaseName) error
func NewErrFieldNameInvalid ¶
func NewErrInvalidPrimaryKey ¶
func NewErrInvalidPrimaryKey() error
func NewErrTableIDInvalid ¶
func NewErrTableNameInvalid ¶
Types ¶
type NopSchemar ¶
type NopSchemar struct{}
NopSchemar is a no-op implementation of the Schemar interface.
func NewNopSchemar ¶
func NewNopSchemar() *NopSchemar
func (*NopSchemar) CreateDatabase ¶
func (s *NopSchemar) CreateDatabase(tx dax.Transaction, qtbl *dax.QualifiedDatabase) error
func (*NopSchemar) CreateField ¶
func (s *NopSchemar) CreateField(tx dax.Transaction, qtid dax.QualifiedTableID, fld *dax.Field) error
func (*NopSchemar) CreateTable ¶
func (s *NopSchemar) CreateTable(tx dax.Transaction, qtbl *dax.QualifiedTable) error
func (*NopSchemar) DatabaseByID ¶
func (s *NopSchemar) DatabaseByID(dax.Transaction, dax.QualifiedDatabaseID) (*dax.QualifiedDatabase, error)
func (*NopSchemar) DatabaseByName ¶
func (s *NopSchemar) DatabaseByName(dax.Transaction, dax.OrganizationID, dax.DatabaseName) (*dax.QualifiedDatabase, error)
func (*NopSchemar) Databases ¶
func (s *NopSchemar) Databases(dax.Transaction, dax.OrganizationID, ...dax.DatabaseID) ([]*dax.QualifiedDatabase, error)
func (*NopSchemar) DropDatabase ¶
func (s *NopSchemar) DropDatabase(tx dax.Transaction, qdbid dax.QualifiedDatabaseID) error
func (*NopSchemar) DropField ¶
func (s *NopSchemar) DropField(tx dax.Transaction, qtid dax.QualifiedTableID, fld dax.FieldName) error
func (*NopSchemar) DropTable ¶
func (s *NopSchemar) DropTable(tx dax.Transaction, qtid dax.QualifiedTableID) error
func (*NopSchemar) SetDatabaseOption ¶ added in v3.32.0
func (s *NopSchemar) SetDatabaseOption(tx dax.Transaction, qdbid dax.QualifiedDatabaseID, option string, value string) error
func (*NopSchemar) Table ¶
func (s *NopSchemar) Table(tx dax.Transaction, qtid dax.QualifiedTableID) (*dax.QualifiedTable, error)
func (*NopSchemar) TableID ¶
func (s *NopSchemar) TableID(dax.Transaction, dax.QualifiedDatabaseID, dax.TableName) (dax.QualifiedTableID, error)
func (*NopSchemar) Tables ¶
func (s *NopSchemar) Tables(tx dax.Transaction, qdbid dax.QualifiedDatabaseID, ids ...dax.TableID) ([]*dax.QualifiedTable, error)
type Schemar ¶
type Schemar interface { CreateDatabase(dax.Transaction, *dax.QualifiedDatabase) error DropDatabase(dax.Transaction, dax.QualifiedDatabaseID) error DatabaseByName(tx dax.Transaction, orgID dax.OrganizationID, dbname dax.DatabaseName) (*dax.QualifiedDatabase, error) DatabaseByID(dax.Transaction, dax.QualifiedDatabaseID) (*dax.QualifiedDatabase, error) SetDatabaseOption(tx dax.Transaction, qdbid dax.QualifiedDatabaseID, option string, value string) error // Databases returns a list of databases. If the list of DatabaseIDs is // empty, all databases will be returned. If greater than zero DatabaseIDs // are passed in the second argument, only databases matching those IDs will // be returned. Databases(dax.Transaction, dax.OrganizationID, ...dax.DatabaseID) ([]*dax.QualifiedDatabase, error) CreateTable(dax.Transaction, *dax.QualifiedTable) error DropTable(dax.Transaction, dax.QualifiedTableID) error CreateField(dax.Transaction, dax.QualifiedTableID, *dax.Field) error DropField(dax.Transaction, dax.QualifiedTableID, dax.FieldName) error Table(dax.Transaction, dax.QualifiedTableID) (*dax.QualifiedTable, error) // Tables returns a list of tables. If the qualifiers DatabaseID is empty, // all tables in the org will be returned. If the OrganizationID is empty, // all tables will be returned. If both are populated, only tables in that // database will be returned. If greater than zero table IDs are passed in // the third argument, only tables matching those IDs will be returned. Tables(dax.Transaction, dax.QualifiedDatabaseID, ...dax.TableID) ([]*dax.QualifiedTable, error) // TableID is a reverse-lookup method to get the TableID for a given // qualified TableName. TableID(dax.Transaction, dax.QualifiedDatabaseID, dax.TableName) (dax.QualifiedTableID, error) }
Click to show internal directories.
Click to hide internal directories.