aboutsummaryrefslogtreecommitdiff
path: root/dialect.go
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2026-04-14 01:00:20 +0200
committerStefan Majewsky <majewsky@gmx.net>2026-04-14 01:00:20 +0200
commit5fb8e4a13afbc4cc3ef6e7492c020f8abf63b37f (patch)
treeb1f4fe95778920cad3fd3b02b00cd44b124bf11e /dialect.go
parentd75031ffd1667c330ccc281ea330503eaeaea88a (diff)
downloadgo-oblast-5fb8e4a13afbc4cc3ef6e7492c020f8abf63b37f.tar.gz
add MysqlDialect
Diffstat (limited to 'dialect.go')
-rw-r--r--dialect.go12
1 files changed, 12 insertions, 0 deletions
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{}