package postgres import "fmt" // Dialect implements migrate.Dialect for PostgreSQL. type Dialect struct{} // Placeholder returns PostgreSQL's positional bind parameter ($1, $2, …). func (Dialect) Placeholder(n int) string { return fmt.Sprintf("$%d", n) } // TableExistsQuery returns a query that checks whether a table exists in // PostgreSQL using information_schema. func (Dialect) TableExistsQuery() string { return "SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_name = $1)" }