Fixing clickhouse dialect placeholders (#333)

Co-authored-by: v.zanfir <v.zanfir@corp.mail.ru>
pull/340/head
kafkiansky 2022-04-24 05:49:57 +03:00 committed by GitHub
parent 6fc031a28a
commit c05d3375c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -310,13 +310,13 @@ func (m ClickHouseDialect) dbVersionQuery(db *sql.DB) (*sql.Rows, error) {
}
func (m ClickHouseDialect) insertVersionSQL() string {
return fmt.Sprintf("INSERT INTO %s (version_id, is_applied) VALUES (?, ?)", TableName())
return fmt.Sprintf("INSERT INTO %s (version_id, is_applied) VALUES ($1, $2)", TableName())
}
func (m ClickHouseDialect) migrationSQL() string {
return fmt.Sprintf("SELECT tstamp, is_applied FROM %s WHERE version_id = ? ORDER BY tstamp DESC LIMIT 1", TableName())
return fmt.Sprintf("SELECT tstamp, is_applied FROM %s WHERE version_id = $1 ORDER BY tstamp DESC LIMIT 1", TableName())
}
func (m ClickHouseDialect) deleteVersionSQL() string {
return fmt.Sprintf("ALTER TABLE %s DELETE WHERE version_id = ?", TableName())
return fmt.Sprintf("ALTER TABLE %s DELETE WHERE version_id = $1", TableName())
}