Documentation
¶
Overview ¶
Package database provides the database access functions and schema.
Index ¶
- Variables
- func CreateExtendedTable(ctx context.Context, tx *sql.Tx, object ExtendedTable) (int64, error)
- func DeleteExtendedTable(ctx context.Context, tx *sql.Tx, key string) error
- func ExtendedTableExists(ctx context.Context, tx *sql.Tx, key string) (bool, error)
- func GetExtendedTableID(ctx context.Context, tx *sql.Tx, key string) (int64, error)
- func UpdateExtendedTable(ctx context.Context, tx *sql.Tx, key string, object ExtendedTable) error
- type ExtendedTable
- type ExtendedTableFilter
Constants ¶
This section is empty.
Variables ¶
var SchemaExtensions = []db.Update{
schemaAppend1,
schemaAppend2,
}
SchemaExtensions is a list of schema extensions that can be passed to the MicroCluster daemon. Each entry will increase the database schema version by one, and will be applied after internal schema updates.
Functions ¶
func CreateExtendedTable ¶
CreateExtendedTable adds a new extended_table to the database.
func DeleteExtendedTable ¶
DeleteExtendedTable deletes the extended_table matching the given key parameters.
func ExtendedTableExists ¶
ExtendedTableExists checks if a extended_table with the given key exists.
func GetExtendedTableID ¶
GetExtendedTableID return the ID of the extended_table with the given key.
func UpdateExtendedTable ¶
UpdateExtendedTable updates the extended_table matching the given key parameters.
Types ¶
type ExtendedTable ¶
ExtendedTable is an example of a database table. In this case named `extended_table`.
func GetExtendedTable ¶
GetExtendedTable returns the extended_table with the given key.
func GetExtendedTables ¶
func GetExtendedTables(ctx context.Context, tx *sql.Tx, filters ...ExtendedTableFilter) ([]ExtendedTable, error)
GetExtendedTables returns all available extended_tables.
type ExtendedTableFilter ¶
type ExtendedTableFilter struct {
Key *string
}
ExtendedTableFilter is used for filtering fields on database fetches. In this case we will only support filtering by Key.