Documentation ¶
Index ¶
- Constants
- Variables
- type DB
- func (db *DB) CreateItem(collection *blueprint.Collection, item blueprint.Item) error
- func (db *DB) CreateReferenceTable(collection1 *blueprint.Collection, collection2 *blueprint.Collection) error
- func (db *DB) CreateTable(collection *blueprint.Collection, collectionLoader *blueprint.CollectionLoader) error
- func (db *DB) CreateTables(collections []blueprint.Collection, ...) error
- func (db *DB) GetItem(collection *blueprint.Collection, id string) (blueprint.Item, error)
- func (db *DB) GetItems(collection *blueprint.Collection, limit int, offset int64) ([]blueprint.Item, error)
- func (db *DB) UpdateItem(collection *blueprint.Collection, item blueprint.Item) error
- type DatabaseType
- type SQLType
Constants ¶
View Source
const ( // SQLite3 SQLTypeSqlite3ID = "INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT" SQLTypeSqlite3Text = "TEXT" SQLTypeSqlite3Boolean = "INTEGER" SQLTypeSqlite3Integer = "INTEGER" SQLTypeSqlite3Blob = "BLOB" // PostgreSQL SQLTypePostgresID = "BIGSERIAL NOT NULL PRIMARY KEY" SQLTypePostgresUUID = "CHARACTER(36)" SQLTypePostgresText = "TEXT" SQLTypePostgresBoolean = "BOOLEAN" SQLTypePostgresBigInt = "BIGINT" SQLTypePostgresJsonb = "JSONB" // All SQLTypeReference = "REFERENCE" )
View Source
const ( DatabaseTypeSqlite3 = DatabaseType("sqlite3") DatabaseTypePostgres = DatabaseType("postgres") )
Variables ¶
View Source
var (
ErrorUnknownDatabaseType = errors.New("unknown database type")
)
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func NewSqlite3Instance ¶
func (*DB) CreateItem ¶
func (*DB) CreateReferenceTable ¶
func (db *DB) CreateReferenceTable(collection1 *blueprint.Collection, collection2 *blueprint.Collection) error
func (*DB) CreateTable ¶
func (db *DB) CreateTable(collection *blueprint.Collection, collectionLoader *blueprint.CollectionLoader) error
func (*DB) CreateTables ¶
func (db *DB) CreateTables(collections []blueprint.Collection, collectionLoader *blueprint.CollectionLoader) error
func (*DB) UpdateItem ¶
type DatabaseType ¶
type DatabaseType string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.