aboutsummaryrefslogtreecommitdiff
path: root/dialect.go
diff options
context:
space:
mode:
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{}