From 72d577290ab6495ac14dc782ddeb3a842e46c15d Mon Sep 17 00:00:00 2001 From: SockworkOrange <26390445+SockworkOrange@users.noreply.github.com> Date: Sat, 27 Sep 2025 17:00:49 +0000 Subject: [PATCH] update docs --- README.md | 47 +++++++++++++++++++++++++++++++++++++++++-- docs/02_Quickstart.md | 4 ++-- docs/08_Examples.md | 32 +++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 88548523..1dbb3b35 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ version: "2" plugins: - name: csharp wasm: - url: https://github.com/DaredevilOSS/sqlc-gen-csharp/releases/download/v0.21.2/sqlc-gen-csharp.wasm - sha256: 98990c2a46b0e315c7f062f5643e3404ed4150a5ef2808c47a4e10084443506e + url: https://github.com/DaredevilOSS/sqlc-gen-csharp/releases/download/v0.21.3/sqlc-gen-csharp.wasm + sha256: a295dd8438c93c1b93d9d6d9e7706913dfade92caf19dbe86ed533214d3dc1ed sql: # For PostgresSQL - schema: schema.sql @@ -364,6 +364,17 @@ INSERT INTO tab1 (field1, field2) VALUES | text | ✅ | | blob | ✅ | +## Useful Overrides +It's possible to use the override data type functionality of the plugin thus overcoming the limited +amount of data types that are supported by SQLite. The supported overrides are specified below: + +| DB Type | C# Type Override | Supported? | Description | +|---------|------------------|------------|------------------------------------------------------------------| +| integer | DateTime | ✅ | Unix Epoch - seconds since 1-1-1970 | +| text | DateTime | ✅ | String representation of the datetime in a configurable format | +| integer | bool | ❌ | If x equals 0 -> False, otherwise -> True | +| text | bool | ❌ | Converts string to a boolean value using Convert.ToBoolean rules | + # Contributing @@ -753,6 +764,14 @@ overrides: csharp_type: type: "decimal" notNull: true +- column: "*:c_text_datetime_override" + csharp_type: + type: "DateTime" + notNull: false +- column: "*:c_integer_datetime_override" + csharp_type: + type: "DateTime" + notNull: false ``` @@ -780,6 +799,14 @@ overrides: csharp_type: type: "decimal" notNull: true +- column: "*:c_text_datetime_override" + csharp_type: + type: "DateTime" + notNull: false +- column: "*:c_integer_datetime_override" + csharp_type: + type: "DateTime" + notNull: false ``` @@ -807,6 +834,14 @@ overrides: csharp_type: type: "decimal" notNull: true +- column: "*:c_text_datetime_override" + csharp_type: + type: "DateTime" + notNull: false +- column: "*:c_integer_datetime_override" + csharp_type: + type: "DateTime" + notNull: false ``` @@ -834,6 +869,14 @@ overrides: csharp_type: type: "decimal" notNull: true +- column: "*:c_text_datetime_override" + csharp_type: + type: "DateTime" + notNull: false +- column: "*:c_integer_datetime_override" + csharp_type: + type: "DateTime" + notNull: false ``` \ No newline at end of file diff --git a/docs/02_Quickstart.md b/docs/02_Quickstart.md index 371b2b53..a37adeb8 100644 --- a/docs/02_Quickstart.md +++ b/docs/02_Quickstart.md @@ -4,8 +4,8 @@ version: "2" plugins: - name: csharp wasm: - url: https://github.com/DaredevilOSS/sqlc-gen-csharp/releases/download/v0.21.2/sqlc-gen-csharp.wasm - sha256: 98990c2a46b0e315c7f062f5643e3404ed4150a5ef2808c47a4e10084443506e + url: https://github.com/DaredevilOSS/sqlc-gen-csharp/releases/download/v0.21.3/sqlc-gen-csharp.wasm + sha256: a295dd8438c93c1b93d9d6d9e7706913dfade92caf19dbe86ed533214d3dc1ed sql: # For PostgresSQL - schema: schema.sql diff --git a/docs/08_Examples.md b/docs/08_Examples.md index de7950a8..b8dd343c 100644 --- a/docs/08_Examples.md +++ b/docs/08_Examples.md @@ -335,6 +335,14 @@ overrides: csharp_type: type: "decimal" notNull: true +- column: "*:c_text_datetime_override" + csharp_type: + type: "DateTime" + notNull: false +- column: "*:c_integer_datetime_override" + csharp_type: + type: "DateTime" + notNull: false ``` @@ -362,6 +370,14 @@ overrides: csharp_type: type: "decimal" notNull: true +- column: "*:c_text_datetime_override" + csharp_type: + type: "DateTime" + notNull: false +- column: "*:c_integer_datetime_override" + csharp_type: + type: "DateTime" + notNull: false ``` @@ -389,6 +405,14 @@ overrides: csharp_type: type: "decimal" notNull: true +- column: "*:c_text_datetime_override" + csharp_type: + type: "DateTime" + notNull: false +- column: "*:c_integer_datetime_override" + csharp_type: + type: "DateTime" + notNull: false ``` @@ -416,6 +440,14 @@ overrides: csharp_type: type: "decimal" notNull: true +- column: "*:c_text_datetime_override" + csharp_type: + type: "DateTime" + notNull: false +- column: "*:c_integer_datetime_override" + csharp_type: + type: "DateTime" + notNull: false ``` \ No newline at end of file