mirror of
https://github.com/turbot/steampipe.git
synced 2026-02-15 13:00:08 -05:00
15 lines
415 B
Go
15 lines
415 B
Go
package db
|
|
|
|
import "fmt"
|
|
|
|
func PgEscapeName(name string) string {
|
|
return fmt.Sprintf(`"%s"`, name)
|
|
}
|
|
|
|
// PgEscapeString escapes strings which are to be inserted
|
|
// use a custom escape tag to avoid chance of clash with the escaped text
|
|
// https://medium.com/@lnishada/postgres-dollar-quoting-6d23e4f186ec
|
|
func PgEscapeString(str string) string {
|
|
return fmt.Sprintf(`$steampipe_escape$%s$steampipe_escape$`, str)
|
|
}
|