Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ version: "2"
plugins:
- name: csharp
wasm:
url: https://github.com/DaredevilOSS/sqlc-gen-csharp/releases/download/v0.19.0/sqlc-gen-csharp.wasm
sha256: 82e1a2dfc44ba5052c1e310aa2cda82d2825b8dc57000ce4dd6519249e5ea0fe
url: https://github.com/DaredevilOSS/sqlc-gen-csharp/releases/download/v0.20.0/sqlc-gen-csharp.wasm
sha256: 3d0a7d09a93b6135c4e043acbbd862d28e2535f20a43292a842a75ac37f35aa0
sql:
# For PostgresSQL
- schema: schema.sql
Expand Down Expand Up @@ -158,8 +158,16 @@ More info can be found in [here](https://docs.sqlc.dev/en/stable/howto/transacti
<details>
<summary>:execlastid - Implementation</summary>

Implemented via a `RETURNING` clause, allowing the `INSERT` command to return the newly created id, which can be of any
data type that can have a unique constraint.
Implemented via a `RETURNING` clause, allowing the `INSERT` command to return the newly created id.
The data types that can be used as id data types for this annotation are:
1. uuid
2. bigint
3. integer
4. smallint (less recommended due to small id range, but possible)

```sql
INSERT INTO tab1 (field1, field2) VALUES ('a', 1) RETURNING id_field;
```
</details>

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

## :execlastid - Implementation
Implemented via a `RETURNING` clause, allowing the `INSERT` command to return the newly created id, which can be of any
data type that can have a unique constraint.

Implemented via a `RETURNING` clause, allowing the `INSERT` command to return the newly created id.
Only integer data type is supported as id for this annotation.
```sql
INSERT INTO tab1 (field1, field2) VALUES ('a', 1) RETURNING id_field;
```

</details>

<details>
Expand Down
4 changes: 2 additions & 2 deletions docs/02_Quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ version: "2"
plugins:
- name: csharp
wasm:
url: https://github.com/DaredevilOSS/sqlc-gen-csharp/releases/download/v0.19.0/sqlc-gen-csharp.wasm
sha256: 82e1a2dfc44ba5052c1e310aa2cda82d2825b8dc57000ce4dd6519249e5ea0fe
url: https://github.com/DaredevilOSS/sqlc-gen-csharp/releases/download/v0.20.0/sqlc-gen-csharp.wasm
sha256: 3d0a7d09a93b6135c4e043acbbd862d28e2535f20a43292a842a75ac37f35aa0
sql:
# For PostgresSQL
- schema: schema.sql
Expand Down