diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2026-04-14 01:00:20 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2026-04-14 01:00:20 +0200 |
| commit | 5fb8e4a13afbc4cc3ef6e7492c020f8abf63b37f (patch) | |
| tree | b1f4fe95778920cad3fd3b02b00cd44b124bf11e /dialect.go | |
| parent | d75031ffd1667c330ccc281ea330503eaeaea88a (diff) | |
| download | go-oblast-5fb8e4a13afbc4cc3ef6e7492c020f8abf63b37f.tar.gz | |
add MysqlDialect
Diffstat (limited to 'dialect.go')
| -rw-r--r-- | dialect.go | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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{} |
