Skip to content
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

Feat/pgx pool support #1037

Merged
merged 78 commits into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
c5f3105
feat: adding support for pgx/v4
Streppel Dec 24, 2020
9e78f31
feat: adding support for pgx/v4
Streppel Dec 24, 2020
20490de
chore: merged main
victoraugustolls May 6, 2021
37b7478
creating template.go file
Streppel May 12, 2021
ec570a9
fixing wrong pq imports on on query generation
Streppel May 12, 2021
039ba4c
SQLLibrary -> driver
Streppel May 13, 2021
42ae5cd
refactor: separated template files between stdlib and pgx
victoraugustolls May 13, 2021
5edfa01
refactor: passed embed templates to own file
victoraugustolls May 13, 2021
75e7955
refactor: swapped hard coded pgx name for constant
victoraugustolls May 13, 2021
a195bca
refactor: better embed file importing
victoraugustolls May 13, 2021
1212768
refactor: better embed file importing
victoraugustolls May 14, 2021
c847d61
fix: existing tests are now passing
victoraugustolls May 14, 2021
3172143
tests: added base files for pgx testing
victoraugustolls May 15, 2021
f588d32
fix: goimports for pgx
Streppel May 15, 2021
d63d232
tests: added tests for pgx templates
victoraugustolls May 16, 2021
d2dbabb
tests: added any case for pgx
victoraugustolls May 16, 2021
3ed99d4
tests: added array_in pggx test
victoraugustolls May 23, 2021
f2690be
tests: added array_test pgx test
victoraugustolls May 23, 2021
e1ce4f6
tests: added array_text_join pgx test
victoraugustolls May 23, 2021
7d84221
tests: added case_stmt_bool pgx test
victoraugustolls May 23, 2021
2366966
tests: added cast_coalesce pgx test
victoraugustolls May 23, 2021
b2beae9
tests: added comment_on pgx test
victoraugustolls May 23, 2021
b89a5e8
tests: added composite_type pgx test
victoraugustolls May 23, 2021
e3f0b48
tests: added cte_count pgx test
victoraugustolls May 23, 2021
ac89971
tests: added cte_filter pgx test
victoraugustolls May 23, 2021
2ae324b
tests: added cte_recursive pgx test
victoraugustolls May 23, 2021
c06dd4a
tests: added datatype pgx test
victoraugustolls May 23, 2021
19d7d3d
tests: added emit_db_and_json_tags pgx test
victoraugustolls May 23, 2021
3c91fa1
tests: added emit_db_tags pgx test
victoraugustolls May 23, 2021
3c450ae
tests: added emit_empty_slices pgx test
victoraugustolls May 23, 2021
3d26254
tests: added exec_imports pgx test
victoraugustolls May 23, 2021
e2e5a0c
fix: fixed emit interface for pgx
victoraugustolls May 24, 2021
e739e39
tests: added exec_result pgx test
victoraugustolls May 24, 2021
dbe7852
tests: added func_args pgx test
victoraugustolls May 24, 2021
bc4958d
tests: added func_args_typecast pgx test
victoraugustolls May 24, 2021
855f964
tests: added func_call_cast pgx test
victoraugustolls May 24, 2021
2701894
tests: added func_return pgx test
victoraugustolls May 24, 2021
ce5f373
tests: added insert_cte pgx test
victoraugustolls May 24, 2021
36be02b
tests: added interval pgx test
victoraugustolls May 24, 2021
51d23f0
tests: added invalid_func_args pgx test
victoraugustolls May 24, 2021
552a032
tests: added invalid_params pgx test
victoraugustolls May 24, 2021
a86d852
tests: added invalid_queries_bar pgx test
victoraugustolls May 24, 2021
aa1c553
tests: added invalid_queries_foo pgx test
victoraugustolls May 24, 2021
1cf163d
tests: added ipaddr pgx test
victoraugustolls May 24, 2021
fffa3be
tests: added json_build pgx test
victoraugustolls May 24, 2021
93a5ef6
tests: added json_tags pgx test
victoraugustolls May 24, 2021
c8af620
tests: added limit pgx test
victoraugustolls May 24, 2021
a2b2aa9
tests: added lower pgx test
victoraugustolls May 24, 2021
abd9406
tests: added lower_switched_order pgx test
victoraugustolls May 24, 2021
bff463c
tests: added macaddr pgx test
victoraugustolls May 25, 2021
12331ad
tests: added materialized_views pgx test
victoraugustolls May 25, 2021
6eddf6d
tests: added mathmatical_operator pgx test
victoraugustolls May 25, 2021
8a7d747
tests: added multischema pgx test
victoraugustolls May 25, 2021
4a960f1
tests: added named_param pgx test
victoraugustolls May 25, 2021
e8399f2
tests: added missing_semicolon pgx test
victoraugustolls May 25, 2021
49de84c
tests: added output_file_names pgx test
victoraugustolls May 25, 2021
3c60b63
tests: added output_files_suffix pgx test
victoraugustolls May 25, 2021
5acca70
tests: added overrides_nullable pgx test
victoraugustolls May 25, 2021
2bb2b55
tests: added pg_advisory_xact_lock pgx test
victoraugustolls May 25, 2021
dd29048
tests: added pg_ext_ltree pgx test
victoraugustolls May 25, 2021
35e89e6
tests: added pg_extensions pgx test
victoraugustolls May 25, 2021
35e45e0
tests: added pg_generate_series pgx test
victoraugustolls May 25, 2021
adb514e
tests: added pg_user_table pgx test
victoraugustolls May 25, 2021
da20084
tests: added primary_key_later pgx test
victoraugustolls May 25, 2021
b9fd313
tests: added rename pgx test
victoraugustolls May 25, 2021
b96887d
tests: added schema_scoped_enum test for pgx
victoraugustolls May 27, 2021
f577f38
tests: added select_column_cast test for pgx
victoraugustolls May 27, 2021
f03982d
tests: added select_distinct test for pgx
victoraugustolls May 27, 2021
49d9aa8
tests: added select_exists test for pgx
victoraugustolls May 27, 2021
090a95d
tests: added select_text_array test for pgx
victoraugustolls May 27, 2021
65e00e6
tests: added sql_syntax_calling_funcs to pgx
victoraugustolls May 27, 2021
33b8c59
tests: added star_expansion_cte test to pgx
victoraugustolls May 27, 2021
9592160
tests: added star_expansion_from_cte test to pgx
victoraugustolls May 27, 2021
2145685
tests: added unknown_func test to pgx
victoraugustolls May 27, 2021
bab5cbf
Merge branch 'main' of ssh://github.com/kyleconroy/sqlc into kyleconr…
victoraugustolls May 28, 2021
95c0708
fix: fixed conflicts when updating from upstream
victoraugustolls May 28, 2021
e66b848
git push origin feat/pgx_pool_supportMerge branch 'kyleconroy-main' i…
victoraugustolls May 28, 2021
cfed992
Merge branch 'main' into feat/pgx_pool_support
Streppel Jun 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion examples/booktest/mysql/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestBooks(t *testing.T) {
AuthorID: int32(authorID),
Isbn: "2",
Title: "the second book",
BookType: BooksBookTypeFICTION ,
BookType: BooksBookTypeFICTION,
Yr: 2016,
Available: now,
Tags: "cool,unique",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/kyleconroy/sqlc

go 1.15
go 1.16

require (
github.com/antlr/antlr4 v0.0.0-20200209180723-1177c0b58d07
Expand Down
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
Expand Down
17 changes: 17 additions & 0 deletions internal/codegen/golang/driver.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package golang

type Driver string

const (
PgxDriver Driver = "pgx/v4"
StdLibDriver Driver = "database/sql"
)

func DriverFromString(s string) Driver {
switch s {
case string(PgxDriver):
return PgxDriver
default:
return StdLibDriver
}
}
Loading