Documentation
¶
Index ¶
- func ApplyMigrations(tableName string, migrations []string, databasePath string) error
- func Init(atPath string) error
- func InitTable(tableName string, connection *sql.DB) error
- func IsMigrationAppliedAndValid(tableName string, migrationIndex int, migrationScript string, ...) (bool, error)
- func NewConnection(databasePath string) (*sql.DB, error)
- func RunMigration(tableName string, migrationIndex int, migrationScript string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyMigrations ¶
ApplyMigrations runs all the `migrations` on the sqlite3 database which is stored at the `databasePath`; since migrations are tied to tables, it's also requested that the `tableName` is provided
func InitTable ¶
InitTable creates 2 tables, one named `tableName` and the other named `tableName`_migrations using the provided `connection`; this way of doing things distributes the migrations so that each table is independently migratable and hence independently removable
func IsMigrationAppliedAndValid ¶
func IsMigrationAppliedAndValid( tableName string, migrationIndex int, migrationScript string, connection *sql.DB, ) (bool, error)
IsMigrationAppliedAndValid performs a check on whether the provided migration already exists in the database
func NewConnection ¶
NewConnection creates a new database connection to the sqlite3 database located at `databasePath`
Types ¶
This section is empty.