@@ -126,10 +126,10 @@ func (i *importer) dbImports() fileImports {
126126
127127 sqlpkg := parseDriver (i .Options .SqlPackage )
128128 switch sqlpkg {
129- case SQLDriverPGXV4 :
129+ case opts . SQLDriverPGXV4 :
130130 pkg = append (pkg , ImportSpec {Path : "github.com/jackc/pgconn" })
131131 pkg = append (pkg , ImportSpec {Path : "github.com/jackc/pgx/v4" })
132- case SQLDriverPGXV5 :
132+ case opts . SQLDriverPGXV5 :
133133 pkg = append (pkg , ImportSpec {Path : "github.com/jackc/pgx/v5/pgconn" })
134134 pkg = append (pkg , ImportSpec {Path : "github.com/jackc/pgx/v5" })
135135 default :
@@ -172,9 +172,9 @@ func buildImports(options *opts.Options, queries []Query, uses func(string) bool
172172 for _ , q := range queries {
173173 if q .Cmd == metadata .CmdExecResult {
174174 switch sqlpkg {
175- case SQLDriverPGXV4 :
175+ case opts . SQLDriverPGXV4 :
176176 pkg [ImportSpec {Path : "github.com/jackc/pgconn" }] = struct {}{}
177- case SQLDriverPGXV5 :
177+ case opts . SQLDriverPGXV5 :
178178 pkg [ImportSpec {Path : "github.com/jackc/pgx/v5/pgconn" }] = struct {}{}
179179 default :
180180 std ["database/sql" ] = struct {}{}
@@ -189,7 +189,7 @@ func buildImports(options *opts.Options, queries []Query, uses func(string) bool
189189 }
190190
191191 if uses ("pgtype." ) {
192- if sqlpkg == SQLDriverPGXV5 {
192+ if sqlpkg == opts . SQLDriverPGXV5 {
193193 pkg [ImportSpec {Path : "github.com/jackc/pgx/v5/pgtype" }] = struct {}{}
194194 } else {
195195 pkg [ImportSpec {Path : "github.com/jackc/pgtype" }] = struct {}{}
@@ -429,7 +429,7 @@ func (i *importer) copyfromImports() fileImports {
429429 })
430430
431431 std ["context" ] = struct {}{}
432- if i .Options .SqlDriver == SQLDriverGoSQLDriverMySQL {
432+ if i .Options .SqlDriver == opts . SQLDriverGoSQLDriverMySQL {
433433 std ["io" ] = struct {}{}
434434 std ["fmt" ] = struct {}{}
435435 std ["sync/atomic" ] = struct {}{}
@@ -481,9 +481,9 @@ func (i *importer) batchImports() fileImports {
481481 std ["errors" ] = struct {}{}
482482 sqlpkg := parseDriver (i .Options .SqlPackage )
483483 switch sqlpkg {
484- case SQLDriverPGXV4 :
484+ case opts . SQLDriverPGXV4 :
485485 pkg [ImportSpec {Path : "github.com/jackc/pgx/v4" }] = struct {}{}
486- case SQLDriverPGXV5 :
486+ case opts . SQLDriverPGXV5 :
487487 pkg [ImportSpec {Path : "github.com/jackc/pgx/v5" }] = struct {}{}
488488 }
489489
0 commit comments