Documentation ¶
Index ¶
- Variables
- func IsConstraintError(err error) bool
- func KeepTables(ctx context.Context, db DB, tablesToKeep ...string) (err error)
- func LoadSchemaFromSQL(script string) (_ *dbschema.Schema, err error)
- func LoadSnapshotFromSQL(script string) (_ *dbschema.Snapshot, err error)
- func MigrateTablesToDatabase(ctx context.Context, srcDB, destDB DB, tablesToKeep ...string) error
- func QueryData(db dbschema.Queryer, schema *dbschema.Schema) (*dbschema.Data, error)
- func QuerySchema(db dbschema.Queryer) (*dbschema.Schema, error)
- func QuerySnapshot(db dbschema.Queryer) (*dbschema.Snapshot, error)
- type DB
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMigrateTables is error class for MigrateTables ErrMigrateTables = errs.Class("migrate tables:") // ErrKeepTables is error class for MigrateTables ErrKeepTables = errs.Class("keep tables:") )
Functions ¶
func IsConstraintError ¶
IsConstraintError checks if given error is about constraint violation
func KeepTables ¶
KeepTables drops all the tables except the specified tables to keep.
func LoadSchemaFromSQL ¶
LoadSchemaFromSQL inserts script into connstr and loads schema.
func LoadSnapshotFromSQL ¶
LoadSnapshotFromSQL inserts script into connstr and loads schema.
func MigrateTablesToDatabase ¶
MigrateTablesToDatabase copies the specified tables from srcDB into destDB. All tables in destDB will be dropped other than those specified in tablesToKeep.
func QuerySchema ¶
QuerySchema loads the schema from sqlite database.
Types ¶
Click to show internal directories.
Click to hide internal directories.