The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/storage/unified/sql/sqltemplate/dialect_mysql.go

35 lines
727 B

package sqltemplate
import (
"strings"
)
// MySQL is the default implementation of Dialect for the MySQL DMBS,
// currently supporting MySQL-8.x.
var MySQL = mysql{
rowLockingClauseMap: rowLockingClauseAll,
argPlaceholderFunc: argFmtSQL92,
name: "mysql",
}
var _ Dialect = MySQL
type mysql struct {
backtickIdent
rowLockingClauseMap
argPlaceholderFunc
name
}
// MySQL always supports backticks for identifiers
// https://dev.mysql.com/doc/refman/8.4/en/identifiers.html
type backtickIdent struct{}
func (backtickIdent) Ident(s string) (string, error) {
if strings.ContainsRune(s, '`') {
return "", ErrInvalidIdentInput
}
return escapeIdentity(s, '`', func(s string) string {
return s
})
}