From 5fb8e4a13afbc4cc3ef6e7492c020f8abf63b37f Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Tue, 14 Apr 2026 01:00:20 +0200 Subject: add MysqlDialect --- dialect.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'dialect.go') diff --git a/dialect.go b/dialect.go index a2827e2..d74725e 100644 --- a/dialect.go +++ b/dialect.go @@ -39,6 +39,18 @@ type Dialect interface { InsertSuffixForAutoColumns(columns []string) string } +// MysqlDialect is the dialect of MySQL and MariaDB databases. +func MysqlDialect() Dialect { + return mysqlDialect{} +} + +type mysqlDialect struct{} + +func (mysqlDialect) Placeholder(_ int) string { return "?" } +func (mysqlDialect) QuoteIdentifier(name string) string { return "`" + name + "`" } +func (mysqlDialect) UsesLastInsertID() bool { return true } +func (mysqlDialect) InsertSuffixForAutoColumns(columns []string) string { return "" } + // PostgresDialect is the dialect of PostgreSQL databases. func PostgresDialect() Dialect { return postgresDialect{} -- cgit v1.2.3