From f8405c4c2ca598d345c0ef33951214080f5c771e Mon Sep 17 00:00:00 2001 From: sau00 Date: Fri, 17 Apr 2020 15:01:54 +0700 Subject: [PATCH] Add dialect name functions to dialects (clickhouse like) --- dialect/mysql.go | 4 ++++ dialect/postgresql.go | 4 ++++ dialect/sqlite3.go | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/dialect/mysql.go b/dialect/mysql.go index a4d097a..e83beb8 100644 --- a/dialect/mysql.go +++ b/dialect/mysql.go @@ -80,6 +80,10 @@ func (d mysql) Limit(offset, limit int64) string { return fmt.Sprintf("LIMIT %d,%d", offset, limit) } +func (d mysql) String() string { + return "mysql" +} + func (d mysql) Prewhere() string { return "" } diff --git a/dialect/postgresql.go b/dialect/postgresql.go index 8b085eb..76b4b0f 100644 --- a/dialect/postgresql.go +++ b/dialect/postgresql.go @@ -51,6 +51,10 @@ func (d postgreSQL) Limit(offset, limit int64) string { return fmt.Sprintf("LIMIT %d OFFSET %d", limit, offset) } +func (d postgreSQL) String() string { + return "postgres" +} + func (d postgreSQL) Prewhere() string { return "" } diff --git a/dialect/sqlite3.go b/dialect/sqlite3.go index 60b18a2..4b0d8ad 100644 --- a/dialect/sqlite3.go +++ b/dialect/sqlite3.go @@ -54,6 +54,10 @@ func (d sqlite3) Limit(offset, limit int64) string { return fmt.Sprintf("LIMIT %d OFFSET %d", limit, offset) } +func (d sqlite3) String() string { + return "sqlite3" +} + func (d sqlite3) Prewhere() string { return "" }