Documentation ¶
Index ¶
- type Clickhouse
- func (c *Clickhouse) CreateTable(tableName string) string
- func (c *Clickhouse) DeleteVersion(tableName string) string
- func (c *Clickhouse) GetLatestVersion(tableName string) string
- func (c *Clickhouse) GetMigrationByVersion(tableName string) string
- func (c *Clickhouse) InsertVersion(tableName string) string
- func (c *Clickhouse) ListMigrations(tableName string) string
- type Mysql
- func (m *Mysql) CreateTable(tableName string) string
- func (m *Mysql) DeleteVersion(tableName string) string
- func (m *Mysql) GetLatestVersion(tableName string) string
- func (m *Mysql) GetMigrationByVersion(tableName string) string
- func (m *Mysql) InsertVersion(tableName string) string
- func (m *Mysql) ListMigrations(tableName string) string
- type Postgres
- func (p *Postgres) CreateTable(tableName string) string
- func (p *Postgres) DeleteVersion(tableName string) string
- func (p *Postgres) GetLatestVersion(tableName string) string
- func (p *Postgres) GetMigrationByVersion(tableName string) string
- func (p *Postgres) InsertVersion(tableName string) string
- func (p *Postgres) ListMigrations(tableName string) string
- func (p *Postgres) TableExists(tableName string) string
- type Querier
- type QueryController
- type Redshift
- func (r *Redshift) CreateTable(tableName string) string
- func (r *Redshift) DeleteVersion(tableName string) string
- func (r *Redshift) GetLatestVersion(tableName string) string
- func (r *Redshift) GetMigrationByVersion(tableName string) string
- func (r *Redshift) InsertVersion(tableName string) string
- func (r *Redshift) ListMigrations(tableName string) string
- type Sqlite3
- func (s *Sqlite3) CreateTable(tableName string) string
- func (s *Sqlite3) DeleteVersion(tableName string) string
- func (s *Sqlite3) GetLatestVersion(tableName string) string
- func (s *Sqlite3) GetMigrationByVersion(tableName string) string
- func (s *Sqlite3) InsertVersion(tableName string) string
- func (s *Sqlite3) ListMigrations(tableName string) string
- type Sqlserver
- func (s *Sqlserver) CreateTable(tableName string) string
- func (s *Sqlserver) DeleteVersion(tableName string) string
- func (s *Sqlserver) GetLatestVersion(tableName string) string
- func (s *Sqlserver) GetMigrationByVersion(tableName string) string
- func (s *Sqlserver) InsertVersion(tableName string) string
- func (s *Sqlserver) ListMigrations(tableName string) string
- type Starrocks
- func (m *Starrocks) CreateTable(tableName string) string
- func (m *Starrocks) DeleteVersion(tableName string) string
- func (m *Starrocks) GetLatestVersion(tableName string) string
- func (m *Starrocks) GetMigrationByVersion(tableName string) string
- func (m *Starrocks) InsertVersion(tableName string) string
- func (m *Starrocks) ListMigrations(tableName string) string
- type Tidb
- func (t *Tidb) CreateTable(tableName string) string
- func (t *Tidb) DeleteVersion(tableName string) string
- func (t *Tidb) GetLatestVersion(tableName string) string
- func (t *Tidb) GetMigrationByVersion(tableName string) string
- func (t *Tidb) InsertVersion(tableName string) string
- func (t *Tidb) ListMigrations(tableName string) string
- type Turso
- type Vertica
- func (v *Vertica) CreateTable(tableName string) string
- func (v *Vertica) DeleteVersion(tableName string) string
- func (v *Vertica) GetLatestVersion(tableName string) string
- func (v *Vertica) GetMigrationByVersion(tableName string) string
- func (v *Vertica) InsertVersion(tableName string) string
- func (v *Vertica) ListMigrations(tableName string) string
- type Ydb
- func (c *Ydb) CreateTable(tableName string) string
- func (c *Ydb) DeleteVersion(tableName string) string
- func (c *Ydb) GetLatestVersion(tableName string) string
- func (c *Ydb) GetMigrationByVersion(tableName string) string
- func (c *Ydb) InsertVersion(tableName string) string
- func (c *Ydb) ListMigrations(tableName string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clickhouse ¶
type Clickhouse struct{}
func (*Clickhouse) CreateTable ¶
func (c *Clickhouse) CreateTable(tableName string) string
func (*Clickhouse) DeleteVersion ¶
func (c *Clickhouse) DeleteVersion(tableName string) string
func (*Clickhouse) GetLatestVersion ¶ added in v3.21.0
func (c *Clickhouse) GetLatestVersion(tableName string) string
func (*Clickhouse) GetMigrationByVersion ¶
func (c *Clickhouse) GetMigrationByVersion(tableName string) string
func (*Clickhouse) InsertVersion ¶
func (c *Clickhouse) InsertVersion(tableName string) string
func (*Clickhouse) ListMigrations ¶
func (c *Clickhouse) ListMigrations(tableName string) string
type Mysql ¶
type Mysql struct{}
func (*Mysql) CreateTable ¶
func (*Mysql) DeleteVersion ¶
func (*Mysql) GetLatestVersion ¶ added in v3.21.0
func (*Mysql) GetMigrationByVersion ¶
func (*Mysql) InsertVersion ¶
func (*Mysql) ListMigrations ¶
type Postgres ¶
type Postgres struct{}
func (*Postgres) CreateTable ¶
func (*Postgres) DeleteVersion ¶
func (*Postgres) GetLatestVersion ¶ added in v3.21.0
func (*Postgres) GetMigrationByVersion ¶
func (*Postgres) InsertVersion ¶
func (*Postgres) ListMigrations ¶
func (*Postgres) TableExists ¶ added in v3.23.1
type Querier ¶
type Querier interface { // CreateTable returns the SQL query string to create the db version table. CreateTable(tableName string) string // InsertVersion returns the SQL query string to insert a new version into the db version table. InsertVersion(tableName string) string // DeleteVersion returns the SQL query string to delete a version from the db version table. DeleteVersion(tableName string) string // GetMigrationByVersion returns the SQL query string to get a single migration by version. // // The query should return the timestamp and is_applied columns. GetMigrationByVersion(tableName string) string // ListMigrations returns the SQL query string to list all migrations in descending order by id. // // The query should return the version_id and is_applied columns. ListMigrations(tableName string) string // GetLatestVersion returns the SQL query string to get the last version_id from the db version // table. Returns a nullable int64 value. GetLatestVersion(tableName string) string }
Querier is the interface that wraps the basic methods to create a dialect specific query.
type QueryController ¶ added in v3.23.1
type QueryController struct{ Querier }
func NewQueryController ¶ added in v3.23.1
func NewQueryController(querier Querier) *QueryController
NewQueryController returns a new QueryController that wraps the given Querier.
func (*QueryController) TableExists ¶ added in v3.23.1
func (c *QueryController) TableExists(tableName string) string
TableExists returns the SQL query string to check if the version table exists. If the Querier does not implement this method, it will return an empty string.
Returns a boolean value.
type Redshift ¶
type Redshift struct{}
func (*Redshift) CreateTable ¶
func (*Redshift) DeleteVersion ¶
func (*Redshift) GetLatestVersion ¶ added in v3.21.0
func (*Redshift) GetMigrationByVersion ¶
func (*Redshift) InsertVersion ¶
func (*Redshift) ListMigrations ¶
type Sqlite3 ¶
type Sqlite3 struct{}
func (*Sqlite3) CreateTable ¶
func (*Sqlite3) DeleteVersion ¶
func (*Sqlite3) GetLatestVersion ¶ added in v3.21.0
func (*Sqlite3) GetMigrationByVersion ¶
func (*Sqlite3) InsertVersion ¶
func (*Sqlite3) ListMigrations ¶
type Sqlserver ¶
type Sqlserver struct{}
func (*Sqlserver) CreateTable ¶
func (*Sqlserver) DeleteVersion ¶
func (*Sqlserver) GetLatestVersion ¶ added in v3.21.0
func (*Sqlserver) GetMigrationByVersion ¶
func (*Sqlserver) InsertVersion ¶
func (*Sqlserver) ListMigrations ¶
type Starrocks ¶ added in v3.23.0
type Starrocks struct{}
func (*Starrocks) CreateTable ¶ added in v3.23.0
func (*Starrocks) DeleteVersion ¶ added in v3.23.0
func (*Starrocks) GetLatestVersion ¶ added in v3.23.0
func (*Starrocks) GetMigrationByVersion ¶ added in v3.23.0
func (*Starrocks) InsertVersion ¶ added in v3.23.0
func (*Starrocks) ListMigrations ¶ added in v3.23.0
type Tidb ¶
type Tidb struct{}
func (*Tidb) CreateTable ¶
func (*Tidb) DeleteVersion ¶
func (*Tidb) GetLatestVersion ¶ added in v3.21.0
func (*Tidb) GetMigrationByVersion ¶
func (*Tidb) InsertVersion ¶
func (*Tidb) ListMigrations ¶
type Vertica ¶
type Vertica struct{}
func (*Vertica) CreateTable ¶
func (*Vertica) DeleteVersion ¶
func (*Vertica) GetLatestVersion ¶ added in v3.21.0
func (*Vertica) GetMigrationByVersion ¶
func (*Vertica) InsertVersion ¶
func (*Vertica) ListMigrations ¶
type Ydb ¶ added in v3.16.0
type Ydb struct{}
func (*Ydb) CreateTable ¶ added in v3.16.0
func (*Ydb) DeleteVersion ¶ added in v3.16.0
func (*Ydb) GetLatestVersion ¶ added in v3.21.0
func (*Ydb) GetMigrationByVersion ¶ added in v3.16.0
func (*Ydb) InsertVersion ¶ added in v3.16.0
func (*Ydb) ListMigrations ¶ added in v3.16.0
Click to show internal directories.
Click to hide internal directories.