Skip to content

Commit 49e78fd

Browse files
update docs (#265)
Co-authored-by: SockworkOrange <26390445+SockworkOrange@users.noreply.github.com>
1 parent 5c676bb commit 49e78fd

2 files changed

Lines changed: 17 additions & 10 deletions

File tree

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ version: "2"
1212
plugins:
1313
- name: csharp
1414
wasm:
15-
url: https://github.com/DaredevilOSS/sqlc-gen-csharp/releases/download/v0.19.0/sqlc-gen-csharp.wasm
16-
sha256: 82e1a2dfc44ba5052c1e310aa2cda82d2825b8dc57000ce4dd6519249e5ea0fe
15+
url: https://github.com/DaredevilOSS/sqlc-gen-csharp/releases/download/v0.20.0/sqlc-gen-csharp.wasm
16+
sha256: 3d0a7d09a93b6135c4e043acbbd862d28e2535f20a43292a842a75ac37f35aa0
1717
sql:
1818
# For PostgresSQL
1919
- schema: schema.sql
@@ -158,8 +158,16 @@ More info can be found in [here](https://docs.sqlc.dev/en/stable/howto/transacti
158158
<details>
159159
<summary>:execlastid - Implementation</summary>
160160

161-
Implemented via a `RETURNING` clause, allowing the `INSERT` command to return the newly created id, which can be of any
162-
data type that can have a unique constraint.
161+
Implemented via a `RETURNING` clause, allowing the `INSERT` command to return the newly created id.
162+
The data types that can be used as id data types for this annotation are:
163+
1. uuid
164+
2. bigint
165+
3. integer
166+
4. smallint (less recommended due to small id range, but possible)
167+
168+
```sql
169+
INSERT INTO tab1 (field1, field2) VALUES ('a', 1) RETURNING id_field;
170+
```
163171
</details>
164172

165173
<details>
@@ -312,13 +320,12 @@ we consider support for the different data types separately for batch inserts an
312320
<summary>:execlastid - Implementation</summary>
313321

314322
## :execlastid - Implementation
315-
Implemented via a `RETURNING` clause, allowing the `INSERT` command to return the newly created id, which can be of any
316-
data type that can have a unique constraint.
317-
323+
Implemented via a `RETURNING` clause, allowing the `INSERT` command to return the newly created id.
324+
Only integer data type is supported as id for this annotation.
325+
318326
```sql
319327
INSERT INTO tab1 (field1, field2) VALUES ('a', 1) RETURNING id_field;
320328
```
321-
322329
</details>
323330

324331
<details>

docs/02_Quickstart.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ version: "2"
44
plugins:
55
- name: csharp
66
wasm:
7-
url: https://github.com/DaredevilOSS/sqlc-gen-csharp/releases/download/v0.19.0/sqlc-gen-csharp.wasm
8-
sha256: 82e1a2dfc44ba5052c1e310aa2cda82d2825b8dc57000ce4dd6519249e5ea0fe
7+
url: https://github.com/DaredevilOSS/sqlc-gen-csharp/releases/download/v0.20.0/sqlc-gen-csharp.wasm
8+
sha256: 3d0a7d09a93b6135c4e043acbbd862d28e2535f20a43292a842a75ac37f35aa0
99
sql:
1010
# For PostgresSQL
1111
- schema: schema.sql

0 commit comments

Comments
 (0)