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 = []schema.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. generator: extended_table Create
func DeleteExtendedTable ¶
DeleteExtendedTable deletes the extended_table matching the given key parameters. generator: extended_table DeleteOne-by-Key
func ExtendedTableExists ¶
ExtendedTableExists checks if a extended_table with the given key exists. generator: extended_table Exists
func GetExtendedTableID ¶
GetExtendedTableID return the ID of the extended_table with the given key. generator: extended_table ID
func UpdateExtendedTable ¶
UpdateExtendedTable updates the extended_table matching the given key parameters. generator: extended_table Update
Types ¶
type ExtendedTable ¶
ExtendedTable is an example of a database table. In this case named `extended_table`. The above comments will generate database queries and helpers using lxd-generate.
func GetExtendedTable ¶
GetExtendedTable returns the extended_table with the given key. generator: extended_table GetOne
func GetExtendedTables ¶
func GetExtendedTables(ctx context.Context, tx *sql.Tx, filters ...ExtendedTableFilter) ([]ExtendedTable, error)
GetExtendedTables returns all available extended_tables. generator: extended_table GetMany
type ExtendedTableFilter ¶
type ExtendedTableFilter struct {
Key *string
}
ExtendedTableFilter is a required struct for use with lxd-generate. It is used for filtering fields on database fetches. In this case we will only support filtering by Key.