Skip to content

Commit

Permalink
added comment for --!syntax_pg instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
asmyasnikov committed Oct 25, 2023
1 parent d80fece commit a9d9d4b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/dialect/dialectquery/ydb.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ func (c *Ydb) GetMigrationByVersion(tableName string) string {
}

func (c *Ydb) ListMigrations(tableName string) string {
// "--!syntax_pg" enables query processing with PostgreSQL-compatible syntax.
// YQL by design strictly forbids the execution of SELECT statements without columns from ORDER BY clause.
// In PostgreSQL-compatible mode, SELECT statements can be processed without columns from ORDER BY clause.
q := `--!syntax_pg
SELECT version_id, is_applied FROM %s ORDER BY tstamp DESC`
return fmt.Sprintf(q, tableName)
Expand Down

0 comments on commit a9d9d4b

Please sign in to comment.