Skip to content

Commit 3693a62

Browse files
authored
chore: prepare release v0.23.0
1 parent 0a688ee commit 3693a62

2 files changed

Lines changed: 34 additions & 40 deletions

File tree

README.md

Lines changed: 32 additions & 38 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.22.3/sqlc-gen-csharp.wasm
16-
sha256: 39ec1607e7477fd1b17415409a8d71f247bdad4f6b936fcb00d21950bc057250
15+
url: https://github.com/DaredevilOSS/sqlc-gen-csharp/releases/download/v0.23.0/sqlc-gen-csharp.wasm
16+
sha256: 1378cd291333f5d6faf35982323788589b66c2545d9e9e01fe4fb6ea0b65b94c
1717
sql:
1818
# For PostgresSQL
1919
- schema: schema.sql
@@ -51,7 +51,6 @@ sql:
5151
| Override | values: A nested override value like [this](#override-option). | Yes | Allows you to override the generated C# data types for specific columns in specific queries. This option accepts a `query_name:column_name` mapping and the overriden data type. | |
5252
| useCentralPackageManagement | default: `false`<br/>values: `false`,`true` | Yes | If true, the code is generated to support central package management. |
5353
| withAsyncSuffix | default: `true`<br/>values: `false`,`true` | Yes | When true, async methods will have the "Async" suffix appended to their names (e.g., `GetAuthorAsync`). When false, async methods will not have the suffix (e.g., `GetAuthor`). |
54-
| withCancellationToken | default: `false`<br/>values: `false`,`true` | Yes | When true, every generated method takes an optional trailing `CancellationToken cancellationToken = default`, threaded into every async DB call so in-flight queries can be cancelled. See [Cancellation](#cancellation). When false (default), generated output is unchanged. |
5554

5655
### Override option
5756
Override for a specific query:
@@ -158,34 +157,6 @@ public async Task ExampleTransaction(IDbConnection connection)
158157
```
159158

160159
More info can be found in [here](https://docs.sqlc.dev/en/stable/howto/transactions.html).
161-
162-
### Cancellation
163-
Set `withCancellationToken: true` to make every generated method accept an optional
164-
`CancellationToken`. The token is threaded into every async database call, so a cancelled
165-
token interrupts the in-flight query and releases the locks that statement holds. The
166-
option is off by default; when off, generated output is identical to before.
167-
168-
```C#
169-
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5));
170-
try
171-
{
172-
var author = await queries.GetAuthor(authorId, cts.Token);
173-
}
174-
catch (OperationCanceledException)
175-
{
176-
// the query was cancelled; its statement-level locks are released
177-
}
178-
```
179-
180-
Notes:
181-
- **PostgreSQL & MySQL** interrupt the running statement server-side (Npgsql sends a cancel
182-
request; MySqlConnector issues `KILL QUERY`), releasing that statement's locks immediately.
183-
- **SQLite** runs synchronously and only honours the token *before* the statement starts;
184-
an already-running SQLite statement is not interrupted.
185-
- **Transactions:** cancelling a query inside a `WithTransaction(...)` flow releases only that
186-
statement's locks. Locks held by earlier statements in the transaction (and, on PostgreSQL,
187-
the aborted-transaction state) are released when **you** roll back — the generated code never
188-
rolls back for you.
189160
# PostgresSQL
190161
<details>
191162
<summary>:execlastid - Implementation</summary>
@@ -255,6 +226,8 @@ we consider support for the different data types separately for batch inserts an
255226
| jsonpath | ✅ | ⚠️ |
256227
| xml | ✅ | ⚠️ |
257228
| enum | ✅ | ⚠️ |
229+
| any | ✅ | ❌ |
230+
| hstore | ✅ | ❌ |
258231

259232
*** `time with time zone` is not useful and not recommended to use by Postgres themselves -
260233
see [here](https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME) -
@@ -272,6 +245,9 @@ An example of this conversion:
272245
INSERT INTO tab1 (macaddr8_field) VALUES (sqlc.narg('macaddr8_field')::macaddr8);
273246
```
274247

248+
*** `any` is a pseudo-type reported by sqlc when it cannot infer a column's type; it maps to `object` in C#.
249+
*** `hstore` is a key-value store type that maps to `object` in C#; readers use `GetValue()` to retrieve the value.
250+
275251
</details>
276252

277253
# MySQL
@@ -473,16 +449,34 @@ make test-wasm-plugin
473449
```
474450
475451
## Release flow
452+
476453
The release flow in this repo follows the semver conventions, building tag as `v[major].[minor].[patch]`.
477-
In order to create a release you need to add `[release]` somewhere in your commit message when merging to master.
478454
479-
### Version bumping (built on tags)
480-
By default, the release script will bump the patch version. Adding `[release]` to your commit message results in a new tag with `v[major].[minor].[patch]+1`.
481-
- Bump `minor` version by adding `[minor]` to your commit message resulting in a new tag with `v[major].[minor]+1.0` <br/>
482-
- Bump `major` version by adding `[major]` to your commit message resulting in a new tag with `v[major]+1.0.0` <br/>
455+
### PR Gate
456+
457+
Every PR that modifies source code, build configuration, or similar must be labeled with one of: `major`, `minor`, `patch`, or `skip-release`.
458+
459+
A bot posts a status check (`release-assistant/requirements`) that blocks merging until a version label is present.
460+
461+
### Generate Release PR
462+
463+
When Build completes on `main`, the `gen-release-pr.yml` workflow runs and:
464+
465+
1. Aggregates all unreleased, labeled PRs since the last release tag.
466+
2. Determines the release type from the labels (`major` > `minor` > `patch`).
467+
3. Computes the new version from the latest tag.
468+
4. Downloads the latest wasm artifact and computes its sha256.
469+
5. Regenerates documentation (README, quickstart) with the new version and wasm sha.
470+
6. Opens a `release-prep` PR with the regenerated docs.
471+
472+
### Release
473+
474+
When the `release-prep` PR is merged, `release.yml`:
483475
484-
### Release structure
485-
The new created tag will create a draft release with it, in the release there will be the wasm plugin embedded in the release. <br/>
476+
1. Detects the `chore: prepare release vX` commit.
477+
2. Downloads the wasm artifact from the triggering Build.
478+
3. Reconstructs release notes from merged PR titles since the previous tag.
479+
4. Creates the release (with tag) and uploads the wasm asset.
486480
487481
# Examples
488482
<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.22.3/sqlc-gen-csharp.wasm
8-
sha256: 39ec1607e7477fd1b17415409a8d71f247bdad4f6b936fcb00d21950bc057250
7+
url: https://github.com/DaredevilOSS/sqlc-gen-csharp/releases/download/v0.23.0/sqlc-gen-csharp.wasm
8+
sha256: 1378cd291333f5d6faf35982323788589b66c2545d9e9e01fe4fb6ea0b65b94c
99
sql:
1010
# For PostgresSQL
1111
- schema: schema.sql

0 commit comments

Comments
 (0)