Documentation
¶
Index ¶
- type Container
- func (container *Container) Close() (err error)
- func (container *Container) Commit(tx *Transaction) error
- func (container *Container) NewTransaction() (tx *Transaction, err error)
- func (container *Container) Release(tx *Transaction) error
- func (container *Container) Table(table_name string) *Table
- func (container *Container) TableSchema(table_name string) (record_struct *storage.TableSchemaStructure)
- func (container *Container) Tables() (tables map[string]int32)
- func (container *Container) TakeBackup(directory string) (err error)
- type Option
- type Options
- type Table
- func (table *Table) Insert(records any) (err error)
- func (table *Table) InsertRecords(records []storage.Record) error
- func (table *Table) Iterate(fn any) error
- func (table *Table) Query(expression *query.Expression) *TableQuery
- func (table *Table) Schema() *storage.TableSchemaStructure
- func (table *Table) Sync(prototype any) error
- func (table *Table) SyncSchema(schema *storage.TableSchemaStructure) error
- func (table *Table) SyncType(structure_type reflect.Type) error
- func (table *Table) Where(conditions ...query.Condition) *TableQuery
- type TableQuery
- func (table_query *TableQuery) Columns(names ...string) *TableQuery
- func (table_query *TableQuery) Count() (records uint64, err error)
- func (table_query *TableQuery) Delete() (deleted uint64, err error)
- func (table_query *TableQuery) Find(multiple any) (err error)
- func (table_query *TableQuery) FindRecords() (records []storage.Record, err error)
- func (table_query *TableQuery) Get(single any) (found bool, err error)
- func (table_query *TableQuery) Limit(limit uint64) *TableQuery
- func (table_query *TableQuery) OrderBy(column_name string, descending bool) *TableQuery
- func (table_query *TableQuery) Update(record any) (affected_rows uint64, err error)
- func (table_query *TableQuery) UpdateColumns(values ...any) (affected_rows uint64, err error)
- func (table_query *TableQuery) UpdateRecord(mapped_record storage.Record) (affected_rows uint64, err error)
- type Transaction
- type TransactionTable
- func (tx_table *TransactionTable) Insert(records any) error
- func (tx_table *TransactionTable) InsertRecords(records []storage.Record) error
- func (tx_table *TransactionTable) Iterate(fn any) error
- func (tx_table *TransactionTable) Schema() *storage.TableSchemaStructure
- func (tx_table *TransactionTable) Where(conditions ...query.Condition) *TransactionTableQuery
- type TransactionTableQuery
- func (tx_table_query *TransactionTableQuery) Columns(names ...string) *TransactionTableQuery
- func (tx_table_query *TransactionTableQuery) Count() (records uint64, err error)
- func (tx_table_query *TransactionTableQuery) Delete() (deleted uint64, err error)
- func (tx_table_query *TransactionTableQuery) Find(multiple any) (err error)
- func (tx_table_query *TransactionTableQuery) Get(single any) (found bool, err error)
- func (tx_table_query *TransactionTableQuery) Limit(limit uint64) *TransactionTableQuery
- func (tx_table_query *TransactionTableQuery) OrderBy(column_name string, descending bool) *TransactionTableQuery
- func (tx_table_query *TransactionTableQuery) Update(record any) (affected_rows uint64, err error)
- func (tx_table_query *TransactionTableQuery) UpdateRecord(mapped_record storage.Record) (affected_rows uint64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func (*Container) Commit ¶
func (container *Container) Commit(tx *Transaction) error
func (*Container) NewTransaction ¶
func (container *Container) NewTransaction() (tx *Transaction, err error)
func (*Container) Release ¶
func (container *Container) Release(tx *Transaction) error
func (*Container) TableSchema ¶
func (container *Container) TableSchema(table_name string) (record_struct *storage.TableSchemaStructure)
func (*Container) TakeBackup ¶
Make a backup of the database as it exists currently.
type Option ¶
func WithEngine ¶
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
func (*Table) InsertRecords ¶
Insert records into the database after having converted your data to the proper format. This is the reflection-free alternative to (*Table).Insert().
func (*Table) Query ¶
func (table *Table) Query(expression *query.Expression) *TableQuery
func (*Table) Schema ¶
func (table *Table) Schema() *storage.TableSchemaStructure
func (*Table) Sync ¶
Sync schematizes a struct type and applies that schema to the underlying table. Warning: may be slow.
func (*Table) SyncSchema ¶
func (table *Table) SyncSchema(schema *storage.TableSchemaStructure) error
type TableQuery ¶
type TableQuery struct {
// contains filtered or unexported fields
}
func (*TableQuery) Columns ¶
func (table_query *TableQuery) Columns(names ...string) *TableQuery
func (*TableQuery) Count ¶
func (table_query *TableQuery) Count() (records uint64, err error)
func (*TableQuery) Delete ¶
func (table_query *TableQuery) Delete() (deleted uint64, err error)
func (*TableQuery) Find ¶
func (table_query *TableQuery) Find(multiple any) (err error)
Collect multiple records into an array passed by reference
func (*TableQuery) FindRecords ¶
func (table_query *TableQuery) FindRecords() (records []storage.Record, err error)
Collect multiple mapped records
func (*TableQuery) Get ¶
func (table_query *TableQuery) Get(single any) (found bool, err error)
Look up a single record that matches this query
func (*TableQuery) Limit ¶
func (table_query *TableQuery) Limit(limit uint64) *TableQuery
func (*TableQuery) OrderBy ¶
func (table_query *TableQuery) OrderBy(column_name string, descending bool) *TableQuery
Array the results of a query by a certain column in ascending or descending fashion
func (*TableQuery) Update ¶
func (table_query *TableQuery) Update(record any) (affected_rows uint64, err error)
func (*TableQuery) UpdateColumns ¶
func (table_query *TableQuery) UpdateColumns(values ...any) (affected_rows uint64, err error)
func (*TableQuery) UpdateRecord ¶
func (table_query *TableQuery) UpdateRecord(mapped_record storage.Record) (affected_rows uint64, err error)
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func (*Transaction) Table ¶
func (tx *Transaction) Table(table_name string) *TransactionTable
type TransactionTable ¶
type TransactionTable struct {
// contains filtered or unexported fields
}
Same as Table, just for a transaction instead of a raw query
func (*TransactionTable) Insert ¶
func (tx_table *TransactionTable) Insert(records any) error
func (*TransactionTable) InsertRecords ¶
func (tx_table *TransactionTable) InsertRecords(records []storage.Record) error
func (*TransactionTable) Iterate ¶
func (tx_table *TransactionTable) Iterate(fn any) error
func (*TransactionTable) Schema ¶
func (tx_table *TransactionTable) Schema() *storage.TableSchemaStructure
func (*TransactionTable) Where ¶
func (tx_table *TransactionTable) Where(conditions ...query.Condition) *TransactionTableQuery
type TransactionTableQuery ¶
type TransactionTableQuery struct {
// contains filtered or unexported fields
}
func (*TransactionTableQuery) Columns ¶
func (tx_table_query *TransactionTableQuery) Columns(names ...string) *TransactionTableQuery
func (*TransactionTableQuery) Count ¶
func (tx_table_query *TransactionTableQuery) Count() (records uint64, err error)
func (*TransactionTableQuery) Delete ¶
func (tx_table_query *TransactionTableQuery) Delete() (deleted uint64, err error)
func (*TransactionTableQuery) Find ¶
func (tx_table_query *TransactionTableQuery) Find(multiple any) (err error)
Collect multiple records into an array passed by reference
func (*TransactionTableQuery) Get ¶
func (tx_table_query *TransactionTableQuery) Get(single any) (found bool, err error)
Find a single record matched by the query
func (*TransactionTableQuery) Limit ¶
func (tx_table_query *TransactionTableQuery) Limit(limit uint64) *TransactionTableQuery
func (*TransactionTableQuery) OrderBy ¶
func (tx_table_query *TransactionTableQuery) OrderBy(column_name string, descending bool) *TransactionTableQuery
Array the results of a query by a certain column in ascending or descending fashion
func (*TransactionTableQuery) Update ¶
func (tx_table_query *TransactionTableQuery) Update(record any) (affected_rows uint64, err error)
func (*TransactionTableQuery) UpdateRecord ¶
func (tx_table_query *TransactionTableQuery) UpdateRecord(mapped_record storage.Record) (affected_rows uint64, err error)
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
engine/leveldb_core
Package leveldb_core implements a storage.Engine using LevelDB
|
Package leveldb_core implements a storage.Engine using LevelDB |