Documentation ¶
Index ¶
- Constants
- Variables
- func AlterDatabase(rootCollection *gokvstore.Collection, database Database) error
- func AlterTable(rootCollection *gokvstore.Collection, table Table) error
- func AreColumnsEqual(c1, c2 Column) bool
- func AreConstraintsEqual(c1, c2 Constraint) bool
- func ColumnIsPrimaryKey(column Column) bool
- func CreateDatabase(rootCollection *gokvstore.Collection, database Database, ...) error
- func CreateTable(rootCollection *gokvstore.Collection, table Table, ...) error
- func DatabaseCollection(rootCollection *gokvstore.Collection, database Database) (*gokvstore.Collection, error)
- func DatabaseExists(rootCollection *gokvstore.Collection, database Database) (bool, error)
- func DropDatabase(rootCollection *gokvstore.Collection, name string) error
- func DropTable(rootCollection *gokvstore.Collection, database, name string) error
- func TableCollection(rootCollection *gokvstore.Collection, database, name string) (*gokvstore.Collection, error)
- func TableExists(rootCollection *gokvstore.Collection, database, name string) (bool, error)
- func ValueHasCorrectTypeForColumn(value any, column Column) bool
- type Column
- type ColumnDataType
- type Constraint
- type ConstraintDataType
- type Database
- type Table
Constants ¶
View Source
const ( ColumnDataTypeText ColumnDataType = "TEXT" ColumnDataTypeFloat ColumnDataType = "FLOAT" ColumnDataTypeInteger ColumnDataType = "INTEGER" ColumnDataTypeTimestamp ColumnDataType = "TIMESTAMP" ConstraintPrimaryKey ConstraintDataType = "PRIMARY_KEY" ConstraintUnique ConstraintDataType = "UNIQUE" )
Variables ¶
View Source
var ( ErrDatabaseDoesNotExists = errors.New("database does not exist") ErrDatabaseAlreadyExists = errors.New("database already exists") )
View Source
var ( ErrTableDoesNotExists = errors.New("table does not exists") ErrTableAlreadyExists = errors.New("table already exists") )
Functions ¶
func AlterDatabase ¶
func AlterDatabase(rootCollection *gokvstore.Collection, database Database) error
func AlterTable ¶
func AlterTable(rootCollection *gokvstore.Collection, table Table) error
func AreColumnsEqual ¶
func AreConstraintsEqual ¶
func AreConstraintsEqual(c1, c2 Constraint) bool
func ColumnIsPrimaryKey ¶
func CreateDatabase ¶
func CreateDatabase(rootCollection *gokvstore.Collection, database Database, createOrReplace, createIfNotExists bool) error
func CreateTable ¶
func CreateTable(rootCollection *gokvstore.Collection, table Table, createOrReplace, createIfNotExists bool) error
func DatabaseCollection ¶
func DatabaseCollection(rootCollection *gokvstore.Collection, database Database) (*gokvstore.Collection, error)
func DatabaseExists ¶
func DatabaseExists(rootCollection *gokvstore.Collection, database Database) (bool, error)
func DropDatabase ¶
func DropDatabase(rootCollection *gokvstore.Collection, name string) error
func TableCollection ¶
func TableCollection(rootCollection *gokvstore.Collection, database, name string) (*gokvstore.Collection, error)
func TableExists ¶
func TableExists(rootCollection *gokvstore.Collection, database, name string) (bool, error)
Types ¶
type Column ¶
type Column struct { Name string DataType ColumnDataType Constraints []Constraint }
type ColumnDataType ¶
type ColumnDataType string
type Constraint ¶
type Constraint struct { Type ConstraintDataType Name string Value string }
type ConstraintDataType ¶
type ConstraintDataType string
type Database ¶
func GetDatabase ¶
func GetDatabase(rootCollection *gokvstore.Collection, databaseName string) (*Database, error)
Click to show internal directories.
Click to hide internal directories.