shredbx logo
shredbx shredbx shredbx shredbx Personal
  • Home
  • Lab
  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
AClaude
  • Home
  • Lab
  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
Andrei Solovev
Packages
Search packages... ⌘K
  • Data & Persistence
    • Databases 3
    • Object Storage 1
    • File Formats 2
    • Enumerations 2
    • Content 1
    • Codegen 2
  • System Integration
    • Secrets 1
    • CLI Tools 5
    • Media Processing 2
    • Adapters 2
  • UI & Components
    • Primitives 1
    • Blocks 1
    • Sections & Layouts 1
    • Entities 1
    • Media 1
    • Utilities 1
    • State & Presenter 1
    • Branding & Style 1
  • Game Engine
    • Framework 1
    • Engine 2
    • Presets 1
    • Vendor 1
Packages/ System Integration/ CLI Tools/ Migrate
Go Package

migrate

Database migration runner — up/down/status with versioned SQL files

Go Ready SI
Migration Execution
$ sbx migrate up --project sbx --env dev
[migrate] project: sbx, schema: sbx_dev
[migrate] 5 total, 3 applied, 2 pending
[migrate] applying 004_add_entity_references.up.sql...
[migrate] 004 applied — 12ms
[migrate] applying 005_create_activity_feed.up.sql...
[migrate] 005 applied — 8ms
[migrate] 2 migrations applied — schema up to date

About

Executes versioned SQL migration files against PostgreSQL databases. Tracks applied migrations in a history table, supports up/down operations, and provides status reporting with drift detection.

Public API

NameKindSignature
Migratortypetype Migrator struct
NewMigratorfuncfunc NewMigrator(pool *database.Pool, dir string) *Migrator
Upfuncfunc (m *Migrator) Up(ctx context.Context) (*MigrateResult, error)
Downfuncfunc (m *Migrator) Down(ctx context.Context) (*MigrateResult, error)
Statusfuncfunc (m *Migrator) Status(ctx context.Context) ([]MigrationStatus, error)

Dependencies

Imports (2)

database Go Ready

PostgreSQL adapter — connection pooling, schema isolation, health checks

postgresqlpgxpoolingschema-isolation
4 exports 5 deps
external Go Ready

External process runner — exec.Command wrapper with timeout, output capture, error handling

execprocess-runnertimeoutoutput-capture
5 exports 7 deps

Related Packages

database Go Ready

PostgreSQL adapter — connection pooling, schema isolation, health checks

postgresqlpgxpoolingschema-isolation
4 exports 5 deps
external Go Ready

External process runner — exec.Command wrapper with timeout, output capture, error handling

execprocess-runnertimeoutoutput-capture
5 exports 7 deps

Source

github.com/shredbx/sbx-core/pkg/migrate
migrationssqlversionedup-down
shredbx logo shredbx shredbx shredbx shredbx Andrei Solovev

Solution Architect & Lead Software Engineer

ExperiencePortfolioResearch & ExperimentsEducationCertificationSkills
GitHub ↗LinkedIn ↗Email ↗
AVAILABLE FOR NEW PROJECTS
// MY LATEST BEATS
Hobby & Interests

Lab

  • The Lab
  • Framework
  • Components
  • Packages
  • Games
  • Process (SDLC)
  • Knowledge
  • Blog

Andrei

  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
  • Lifestyle

Team

  • Team
  • Andrei
  • Claude

Legal

  • Privacy
  • Terms
  • Cookies
© 2026 shredbx.com. All rights reserved. — Andrei Solovev |