aboutsummaryrefslogtreecommitdiff
path: root/pgruntime/helpers.go
blob: d68b9206b80d65cd6144ab1beb81d1cc2de3c9f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// SPDX-FileCopyrightText: 2026 Stefan Majewsky <majewsky@gmx.net>
// SPDX-License-Identifier: Apache-2.0

package pgruntime

import (
	"strings"
)

// Convenience function for preparing an identifier that needs to be inserted into a query verbatim
// (e.g. a database name for CREATE DATABASE).
func quoteIdentifier(name string) string {
	return `"` + strings.ReplaceAll(name, `"`, `""`) + `"`
}