Skip to content

Commit

Permalink
feat: add Dialect() to Transaction and IDB interface
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotcourant committed Dec 8, 2021
1 parent b4b19c5 commit 693f1e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions query_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 693f1e1

Please sign in to comment.