Skip to content

Commit b0508d7

Browse files
authored
Merge pull request #1037 from Streppel/feat/pgx_pool_support
Feat/pgx pool support
2 parents ed57002 + cfed992 commit b0508d7

File tree

1,511 files changed

+14357
-383
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,511 files changed

+14357
-383
lines changed

examples/booktest/mysql/db_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func TestBooks(t *testing.T) {
5454
AuthorID: int32(authorID),
5555
Isbn: "2",
5656
Title: "the second book",
57-
BookType: BooksBookTypeFICTION ,
57+
BookType: BooksBookTypeFICTION,
5858
Yr: 2016,
5959
Available: now,
6060
Tags: "cool,unique",

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/kyleconroy/sqlc
22

3-
go 1.15
3+
go 1.16
44

55
require (
66
github.com/antlr/antlr4 v0.0.0-20200209180723-1177c0b58d07

go.sum

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ
1515
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
1616
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
1717
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
18-
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
1918
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
2019
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
2120
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=

internal/codegen/golang/driver.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package golang
2+
3+
type Driver string
4+
5+
const (
6+
PgxDriver Driver = "pgx/v4"
7+
StdLibDriver Driver = "database/sql"
8+
)
9+
10+
func DriverFromString(s string) Driver {
11+
switch s {
12+
case string(PgxDriver):
13+
return PgxDriver
14+
default:
15+
return StdLibDriver
16+
}
17+
}

0 commit comments

Comments
 (0)