Documentation
¶
Index ¶
- func Migrate(ds *SQLite, m Migration) error
- func MigrateToLatest(vm VersionManager, ds *SQLite) error
- func RegisterMigration(m Migration)
- type Migration
- type MigrationV1
- type MigrationV2
- type MigrationV3
- type MigrationV4
- type MigrationV5
- type SQLite
- func (ds *SQLite) Add(ctx context.Context, entity datastore.Entity) error
- func (ds *SQLite) BatchAdd(ctx context.Context, entities []datastore.Entity) error
- func (ds *SQLite) Commit(ctx context.Context) error
- func (ds *SQLite) Count(ctx context.Context, entity datastore.Entity, options *datastore.FilterOptions) (int64, error)
- func (ds *SQLite) Delete(ctx context.Context, entity datastore.Entity) error
- func (ds *SQLite) Get(ctx context.Context, entity datastore.Entity) error
- func (ds *SQLite) Init() error
- func (ds *SQLite) IsExist(ctx context.Context, entity datastore.Entity) (bool, error)
- func (ds *SQLite) List(ctx context.Context, entity datastore.Entity, options *datastore.ListOptions) ([]datastore.Entity, error)
- func (ds *SQLite) Put(ctx context.Context, entity datastore.Entity) error
- type SQLiteVersionManager
- type VersionManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MigrationV1 ¶
type MigrationV1 struct{}
MigrationV1 example
func (*MigrationV1) ExtraDataOperation ¶
func (m *MigrationV1) ExtraDataOperation(ds *SQLite) error
func (*MigrationV1) GetModifyFields ¶
func (m *MigrationV1) GetModifyFields(tableName string) map[string]string
func (*MigrationV1) Version ¶
func (m *MigrationV1) Version() string
The version should match the corresponding AOG version.
type MigrationV2 ¶
type MigrationV2 struct{}
func (*MigrationV2) ExtraDataOperation ¶
func (m *MigrationV2) ExtraDataOperation(ds *SQLite) error
func (*MigrationV2) GetModifyFields ¶
func (m *MigrationV2) GetModifyFields(tableName string) map[string]string
func (*MigrationV2) Version ¶
func (m *MigrationV2) Version() string
type MigrationV3 ¶
type MigrationV3 struct{}
func (*MigrationV3) ExtraDataOperation ¶
func (m *MigrationV3) ExtraDataOperation(ds *SQLite) error
func (*MigrationV3) GetModifyFields ¶
func (m *MigrationV3) GetModifyFields(tableName string) map[string]string
func (*MigrationV3) Version ¶
func (m *MigrationV3) Version() string
type MigrationV4 ¶
type MigrationV4 struct{}
func (*MigrationV4) ExtraDataOperation ¶
func (m *MigrationV4) ExtraDataOperation(ds *SQLite) error
func (*MigrationV4) GetModifyFields ¶
func (m *MigrationV4) GetModifyFields(tableName string) map[string]string
func (*MigrationV4) Version ¶
func (m *MigrationV4) Version() string
type MigrationV5 ¶
type MigrationV5 struct{}
func (*MigrationV5) ExtraDataOperation ¶
func (m *MigrationV5) ExtraDataOperation(ds *SQLite) error
func (*MigrationV5) GetModifyFields ¶
func (m *MigrationV5) GetModifyFields(tableName string) map[string]string
func (*MigrationV5) Version ¶
func (m *MigrationV5) Version() string
type SQLite ¶
type SQLite struct {
// contains filtered or unexported fields
}
SQLite implements the Datastore interface
func (*SQLite) Count ¶
func (ds *SQLite) Count(ctx context.Context, entity datastore.Entity, options *datastore.FilterOptions) (int64, error)
Count counts the number of records
type SQLiteVersionManager ¶
type SQLiteVersionManager struct {
// contains filtered or unexported fields
}
SQLiteVersionManager 实现 VersionManager 接口,基于 version_update_record 表
func NewSQLiteVersionManager ¶
func NewSQLiteVersionManager(ds *SQLite) *SQLiteVersionManager
func (*SQLiteVersionManager) GetCurrentVersion ¶
func (vm *SQLiteVersionManager) GetCurrentVersion() (string, error)
func (*SQLiteVersionManager) SetCurrentVersion ¶
func (vm *SQLiteVersionManager) SetCurrentVersion(version string) error
Click to show internal directories.
Click to hide internal directories.