Inject ambient context into Go calls
This commit is contained in:
parent
acb42a5702
commit
5085ae51aa
8 changed files with 112 additions and 9 deletions
|
|
@ -79,7 +79,8 @@ fun accountQuery(): GotlinSQLQuery {
|
|||
func TestGeneratedQueryCanBePassedToVariadicPGXCall(t *testing.T) {
|
||||
code := compileSQL(t, accountRowSource+`
|
||||
import pgxpool "github.com/jackc/pgx/v5/pgxpool"
|
||||
fun execute(pool: *pgxpool.Pool, ctx: Context, customerId: String) {
|
||||
import context
|
||||
fun execute(pool: *pgxpool.Pool, ctx: context.Context, customerId: String) {
|
||||
val query = sql.from<AccountRow>().where { it.customerId == customerId }.build()
|
||||
pool.query(ctx, query.sql, *query.args)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue