-
Notifications
You must be signed in to change notification settings - Fork 731
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sqlite): Support emit_pointers_for_null_types (#3026)
Pointer fields work with both the popular github.com/mattn/go-sqlite3 driver and the pure-Go modernc.org/sqlite driver.
- Loading branch information
Showing
8 changed files
with
113 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
internal/endtoend/testdata/emit_pointers_for_null_types/sqlite/go/db.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
internal/endtoend/testdata/emit_pointers_for_null_types/sqlite/go/models.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
internal/endtoend/testdata/emit_pointers_for_null_types/sqlite/sql/query.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SELECT 1; |
18 changes: 18 additions & 0 deletions
18
internal/endtoend/testdata/emit_pointers_for_null_types/sqlite/sql/types.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
CREATE TABLE dt_types ( | ||
a int, | ||
b real, | ||
c bool, | ||
d date, | ||
e text, | ||
f numeric | ||
); | ||
|
||
CREATE TABLE dt_types_not_null ( | ||
a int NOT NULL, | ||
b real NOT NULL, | ||
c bool NOT NULL, | ||
d date NOT NULL, | ||
e text NOT NULL, | ||
f numeric NOT NULL | ||
); |
13 changes: 13 additions & 0 deletions
13
internal/endtoend/testdata/emit_pointers_for_null_types/sqlite/sqlc.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"version": "1", | ||
"packages": [ | ||
{ | ||
"path": "go", | ||
"engine": "sqlite", | ||
"name": "datatype", | ||
"schema": "sql/", | ||
"queries": "sql/", | ||
"emit_pointers_for_null_types": true | ||
} | ||
] | ||
} |