Skip to content

Commit fdeb618

Browse files
authored
fix: sqlite log (#2488)
Fixes: #2391
1 parent 48f94e6 commit fdeb618

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

internal/codegen/golang/imports.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func buildImports(settings *plugin.Settings, queries []Query, uses func(string)
188188
}
189189
}
190190

191-
for typeName, _ := range pqtypeTypes {
191+
for typeName := range pqtypeTypes {
192192
if uses(typeName) {
193193
pkg[ImportSpec{Path: "github.com/sqlc-dev/pqtype"}] = struct{}{}
194194
break

internal/codegen/golang/sqlite_type.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"strings"
66

77
"github.com/kyleconroy/sqlc/internal/codegen/sdk"
8+
"github.com/kyleconroy/sqlc/internal/debug"
89
"github.com/kyleconroy/sqlc/internal/plugin"
910
)
1011

@@ -68,7 +69,10 @@ func sqliteType(req *plugin.CodeGenRequest, col *plugin.Column) string {
6869
return "sql.NullFloat64"
6970

7071
default:
71-
log.Printf("unknown SQLite type: %s\n", dt)
72+
if debug.Active {
73+
log.Printf("unknown SQLite type: %s\n", dt)
74+
}
75+
7276
return "interface{}"
7377

7478
}

0 commit comments

Comments
 (0)