-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql.Open returns *sql.DB not DBTX #71
Comments
Hi @KINGSABRI, is it still a valid issue on your side? - have you managed to fix it already? In the line Line 23 in ead5808
|
Hi @pawlobanano , thank you for your reply. I'm still having this issue. I had a look at your code, if you removed the point, you can't reference it ( Lines 23 to 28 in ead5808
|
@KINGSABRI You can still reference it, because |
did you chose pgx/v5 in the sqlc.yaml? I have the same problem like you before version: "2"
sql:
- engine: "postgresql"
queries: "./db/query"
schema: "./db/migration"
gen:
go:
package: "db"
out: "./db/sqlc"
sql_package: "pgx/v5"
emit_json_tags: true
emit_prepared_queries: false
emit_exact_table_names: false then i change it into version: "1"
packages:
- name: "db"
path: "./db/sqlc"
queries: "./db/query/"
schema: "./db/migration/"
engine: "postgresql"
emit_db_tags: true
emit_prepared_queries: false
emit_interface: false
emit_exact_table_names: false and it just works, i think it may cause by the different sql_packge used between version 1 and version 2 |
change sql_package from pgx/v5 to database/sql
|
Hi,
Thanks for the great tutorial.
In the following code,
New
function expectsDBTX
. However,sql.open
returns*sql.DB
anderror
type therefore the code failsThe same issue will happen later
Thanks!
The text was updated successfully, but these errors were encountered: