From 693f1e135999fc31cf83b99a2530a695b20f4e1b Mon Sep 17 00:00:00 2001 From: Elliot Courant Date: Wed, 8 Dec 2021 10:00:09 -0600 Subject: [PATCH] feat: add `Dialect()` to Transaction and IDB interface --- db.go | 4 ++++ query_base.go | 1 + 2 files changed, 5 insertions(+) diff --git a/db.go b/db.go index 96a39e84a..874f093d5 100644 --- a/db.go +++ b/db.go @@ -473,6 +473,10 @@ func (tx Tx) QueryRowContext(ctx context.Context, query string, args ...interfac return row } +func (tx Tx) Dialect() schema.Dialect { + return tx.db.Dialect() +} + //------------------------------------------------------------------------------ func (tx Tx) NewValues(model interface{}) *ValuesQuery { diff --git a/query_base.go b/query_base.go index db45fb724..d7914b632 100644 --- a/query_base.go +++ b/query_base.go @@ -43,6 +43,7 @@ var ( // IDB is a common interface for *bun.DB, bun.Conn, and bun.Tx. type IDB interface { IConn + Dialect() schema.Dialect NewValues(model interface{}) *ValuesQuery NewSelect() *SelectQuery