Documentation ¶
Index ¶
- Constants
- type DB
- type DBManager
- func (m *DBManager) CheckMigrationRequired(curVersion, wantedVersion uint) (bool, error)
- func (m *DBManager) CheckVersion(curVersion, wantedVersion uint) error
- func (m *DBManager) Create(ctx context.Context, stmts []string, wantedVersion uint) error
- func (m *DBManager) DDL() []string
- func (m *DBManager) Drop(ctx context.Context) error
- func (m *DBManager) Export(ctx context.Context, objectKinds []string, w io.Writer) error
- func (m *DBManager) GetVersion(ctx context.Context) (uint, error)
- func (m *DBManager) Import(ctx context.Context, r io.Reader) error
- func (m *DBManager) Lock(ctx context.Context) error
- func (m *DBManager) Migrate(ctx context.Context) error
- func (m *DBManager) MigrateToVersion(ctx context.Context, newVersion uint) error
- func (m *DBManager) Setup(ctx context.Context) error
- func (m *DBManager) Unlock() error
- func (m *DBManager) WantedVersion() uint
Constants ¶
View Source
const ( MaxQueryLimit = 100 DBLockName = "dbupdate" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { DBType() sql.Type DB() *sql.DB Version() uint Do(ctx context.Context, f func(tx *sql.Tx) error) error MigrateFuncs() map[uint]sqlg.MigrateFunc DDL() []string ObjectsInfo() []sqlg.ObjectInfo UnmarshalExportObject(data []byte) (sqlg.Object, error) InsertRawObject(tx *sql.Tx, obj sqlg.Object) error SelectObject(kind string) *sq.SelectBuilder FetchObjects(tx *sql.Tx, kind string, q sq.Builder) ([]sqlg.Object, error) ObjectToExportJSON(obj sqlg.Object, e *json.Encoder) error Sequences() []sqlg.Sequence GetSequence(tx *sql.Tx, sequenceName string) (uint64, error) PopulateSequences(tx *sql.Tx) error }
type DBManager ¶
type DBManager struct {
// contains filtered or unexported fields
}
func NewDBManager ¶
func (*DBManager) CheckMigrationRequired ¶
func (*DBManager) CheckVersion ¶
func (*DBManager) MigrateToVersion ¶
func (*DBManager) WantedVersion ¶ added in v0.9.0
Click to show internal directories.
Click to hide internal directories.