MCPcopy
hub / github.com/rubenv/sql-migrate / ExecMaxContext

Method ExecMaxContext

migrate.go:512–518  ·  view source on GitHub ↗

Returns the number of applied migrations, but applies with an input context.

(ctx context.Context, db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, max int)

Source from the content-addressed store, hash-verified

510
511// Returns the number of applied migrations, but applies with an input context.
512func (ms MigrationSet) ExecMaxContext(ctx context.Context, db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, max int) (int, error) {
513 migrations, dbMap, err := ms.PlanMigration(db, dialect, m, dir, max)
514 if err != nil {
515 return 0, err
516 }
517 return ms.applyMigrations(ctx, dir, migrations, dbMap)
518}
519
520// Returns the number of applied migrations.
521func (ms MigrationSet) ExecVersion(db *sql.DB, dialect string, m MigrationSource, dir MigrationDirection, version int64) (int, error) {

Callers 4

ExecMethod · 0.95
ExecContextMethod · 0.95
ExecMaxMethod · 0.95
ExecMaxContextFunction · 0.80

Calls 2

PlanMigrationMethod · 0.95
applyMigrationsMethod · 0.95

Tested by

no test coverage detected