Skip to content

Commit 62bb7c8

Browse files
committed
Merge remote-tracking branch 'upstream/config-v2' into kotlin-master
2 parents 0f04fd3 + 5f60cd7 commit 62bb7c8

File tree

297 files changed

+6500
-2487
lines changed

Some content is hidden

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

297 files changed

+6500
-2487
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,14 +331,14 @@ instead.
331331
"overrides": [
332332
{
333333
"go_type": "github.com/gofrs/uuid.UUID",
334-
"postgres_type": "uuid"
334+
"db_type": "uuid"
335335
}
336336
]
337337
}
338338
```
339339

340340
Each override document has the following keys:
341-
- `postgres_type`:
341+
- `db_type`:
342342
- The PostgreSQL type to override. Find the full list of supported types in [gen.go](https://github.com/kyleconroy/sqlc/blob/master/internal/dinosql/gen.go#L438).
343343
- `go_type`:
344344
- A fully qualified name to a Go type to use in the generated code.

examples/authors/db_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build examples
2+
13
package authors
24

35
import (

examples/authors/sqlc.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"version": "2",
3+
"sql": [
4+
{
5+
"schema": "schema.sql",
6+
"queries": "query.sql",
7+
"engine": "postgresql",
8+
"gen": {
9+
"go": {
10+
"package": "authors",
11+
"out": "."
12+
}
13+
}
14+
}
15+
]
16+
}

examples/booktest/mysql/models.go

Lines changed: 8 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/booktest/mysql/query.sql

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,13 @@ INSERT INTO books (
2525
title,
2626
yr,
2727
available,
28-
tags,
29-
is_hardcover,
30-
rating,
31-
front_cover_img,
32-
back_cover_img
28+
tags
3329
) VALUES (
3430
?,
3531
?,
3632
?,
3733
?,
3834
?,
39-
?,
40-
?,
41-
?,
42-
?,
43-
?,
4435
?
4536
);
4637

examples/booktest/mysql/query.sql.go

Lines changed: 9 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/booktest/mysql/schema.sql

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ CREATE TABLE books (
1919
title text NOT NULL DEFAULT '',
2020
yr integer NOT NULL DEFAULT 2000,
2121
available datetime NOT NULL DEFAULT NOW(),
22-
tags text NOT NULL DEFAULT '',
23-
is_hardcover BOOL NOT NULL DEFAULT 0,
24-
rating decimal(13, 2),
25-
front_cover_img varchar(255),
26-
back_cover_img varchar(255)
22+
tags text NOT NULL DEFAULT ''
2723
-- CONSTRAINT FOREIGN KEY (author_id) REFERENCES authors(author_id)
2824
) ENGINE=InnoDB;
2925

examples/booktest/sqlc.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "1",
3+
"packages": [
4+
{
5+
"name": "booktest",
6+
"path": "postgresql",
7+
"schema": "postgresql/schema.sql",
8+
"queries": "postgresql/query.sql",
9+
"engine": "postgresql"
10+
},
11+
{
12+
"name": "booktest",
13+
"path": "mysql",
14+
"schema": "mysql/schema.sql",
15+
"queries": "mysql/query.sql",
16+
"engine": "mysql"
17+
}
18+
]
19+
}

examples/jets/sqlc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": "1",
3+
"packages": [
4+
{
5+
"path": ".",
6+
"name": "jets",
7+
"schema": "schema.sql",
8+
"queries": "query-building.sql",
9+
"engine": "postgresql"
10+
}
11+
]
12+
}

examples/ondeck/sqlc.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"version": "1",
3+
"packages": [
4+
{
5+
"path": ".",
6+
"name": "ondeck",
7+
"schema": "schema",
8+
"queries": "query",
9+
"engine": "postgresql",
10+
"emit_json_tags": true,
11+
"emit_prepared_queries": true,
12+
"emit_interface": true
13+
}
14+
]
15+
}

0 commit comments

Comments
 (0)