Version
1.19.1
What happened?
-
What happened?
When use query_parameter_limit config, the generated code does not import the package.
And emit_interface=true, the generated Querier interface does not import the sql.NullTime or time package.
-
config:
query_parameter_limit: 2
emit_interface: true
-- name: MarkNoticeDone :exec
UPDATE `notice`
SET `status`='done',
`notice_at`=?
WHERE `id` = ?;
-- name: CreateNotice :exec
INSERT INTO `notice` (`cnt`, `created_at`)
VALUES (?, ?);
notice.sql.go:
import (
"context"
"database/sql" // this line not gen
"encoding/json"
"time"
)
func (q *Queries) MarkNoticeDone(ctx context.Context, noticeAt sql.NullTime, iD uint64) error {
_, err := q.exec(ctx, q.markNoticeDoneStmt, markNoticeDone, noticeAt, iD)
return err
}
querier.go:
import (
"context"
"database/sql" // this line not gen
"time" // this line not gen
)
type Querier interface {
CreateNotice(ctx context.Context, cnt string, createdAt time.Time) error
MarkNoticeDone(ctx context.Context, noticeAt sql.NullTime, iD uint64) error
}
What operating system are you using?
macOS
What database engines are you using?
MySQL
What type of code are you generating?
Go
Version
1.19.1
What happened?
What happened?
When use
query_parameter_limitconfig, the generated code does not import the package.And
emit_interface=true, the generatedQuerier interfacedoes not import thesql.NullTimeortimepackage.config:
notice.sql.go:
querier.go:
What operating system are you using?
macOS
What database engines are you using?
MySQL
What type of code are you generating?
Go