From 4148551f3e9c6c728007d77b22084d951950c11d Mon Sep 17 00:00:00 2001 From: Gohryt <38947781+Gohryt@users.noreply.github.com> Date: Wed, 24 Nov 2021 04:01:32 +0300 Subject: [PATCH] option to use pgx instead pq (#283) --- db.go | 2 +- dialect.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db.go b/db.go index affb6ed09..fd1a219bf 100644 --- a/db.go +++ b/db.go @@ -22,7 +22,7 @@ func OpenDBWithDriver(driver string, dbstring string) (*sql.DB, error) { } switch driver { - case "postgres", "sqlite3", "mysql", "sqlserver", "clickhouse": + case "postgres", "pgx", "sqlite3", "mysql", "sqlserver", "clickhouse": return sql.Open(driver, dbstring) default: return nil, fmt.Errorf("unsupported driver %s", driver) diff --git a/dialect.go b/dialect.go index 899086b53..df6978690 100644 --- a/dialect.go +++ b/dialect.go @@ -25,7 +25,7 @@ func GetDialect() SQLDialect { // SetDialect sets the SQLDialect func SetDialect(d string) error { switch d { - case "postgres": + case "postgres", "pgx": dialect = &PostgresDialect{} case "mysql": dialect = &MySQLDialect{}