Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Source ¶
Source represents a migration repository.
The load method is responsible for loading a set of migrations. It should return a map with all the mirations. The key of the map should be the version of the migration. The value for each key should contain the SQL statements for the migration.
func FromEmbedded ¶ added in v1.1.0
FromEmbedded creates a new embedded file based repository
It expects an embed.FS object and a valid directory path to be passed on invocation. Migration files should be named: "0001_something_something.sql". The version number should be incremented for each migration.
func FromFiles ¶
FromFiles creates a new file based repository
It expects a valid directory path to be passed on invocation. Migration files should be named: "0001_something_something.sql". The version number should be incremented for each migration.
func FromMemory ¶
FromMemory creates a new memory based repository.
The memory based repository is useful if you want to embed the migrations within your application. It expects a map of all migrations and versions to be passed on invocation.