Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Enable using upper/db in combination with other go database libraries #57

@gima

Description

@gima

When one needs SQL, which is not supported by upper/db, one uses sess.Driver() directly.

Consider the following:

  1. I would like to use upper/db for CRUD, because it is tedious to write by hand.
  2. I would also like to use "sql-helper-library", a third-party library which provides me with functionality that I need.
  3. Operations performed by both of the libraries need to run in a transaction.

Now there is a problem.

Both of the two libraries should use one and the same transaction.
Since the sql-helper-library uses plain database/sql, it can use sql.Tx if given.

upper/db's type Tx does not expose the underlying sql.Tx, nor can it use an externally-started sql.Tx.

Either of those options would allow upper/db to inter-operate with other golang database libraries.


I deeply request this feature: to expose and set sql.Tx in upper/db's type Database

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions