|
1 | 1 | [](https://github.com/DaredevilOSS/sqlc-gen-csharp/actions/workflows/main.yml)
|
2 | 2 |
|
3 |
| -# sqlc-gen-csharp |
| 3 | +# sqlc-gen-ruby |
4 | 4 | ## Usage
|
5 | 5 | ### Configuration
|
6 | 6 | ```yaml
|
7 | 7 | version: "2"
|
8 | 8 | plugins:
|
9 |
| -- name: csharp |
| 9 | +- name: ruby |
10 | 10 | wasm:
|
11 |
| - url: https://github.com/DaredevilOSS/sqlc-gen-csharp/releases/download/v0.10.0/sqlc-gen-csharp.wasm |
12 |
| - sha256: 613ae249a541ab95c97b362bd1b0b572970edcad5eb2a11806a52d3f95e0f65f |
| 11 | + url: TBD |
| 12 | + sha256: TBD |
13 | 13 | sql:
|
14 | 14 | # PostgreSQL Example
|
15 | 15 | - schema: "examples/authors/postgresql/schema.sql"
|
16 | 16 | queries: "examples/authors/postgresql/query.sql"
|
17 | 17 | engine: "postgresql"
|
18 | 18 | codegen:
|
19 |
| - - plugin: csharp |
20 |
| - out: NpgsqlExample |
| 19 | + - plugin: ruby |
| 20 | + out: examples/pg |
21 | 21 | options:
|
22 |
| - driver: Npgsql |
23 |
| - targetFramework: net8.0 |
24 |
| - generateCsproj: true |
25 |
| - filePerQuery: false |
| 22 | + driver: pg |
26 | 23 | # MySQL Example
|
27 | 24 | - schema: "examples/authors/mysql/schema.sql"
|
28 | 25 | queries: "examples/authors/mysql/query.sql"
|
29 | 26 | engine: "mysql"
|
30 | 27 | codegen:
|
31 |
| - - plugin: csharp |
32 |
| - out: MySqlConnectorExample |
| 28 | + - plugin: ruby |
| 29 | + out: examples/mysql2 |
33 | 30 | options:
|
34 |
| - driver: MySqlConnector |
| 31 | + driver: mysql2 |
35 | 32 | ```
|
36 | 33 | ### Options Documentation
|
37 |
| -| Option | Possible values | Info | |
38 |
| -|------------|---------------------------|-| |
39 |
| -| targetFramework | default: `net8.0`<br/>values: `netstandard2.0`, `netstandard2.1`, `net8.0` |Decide on the right target framework for your generated code, meaning the generated code will be compiled to the specified runtime.<br/>For more information and help deciding on the right value, refer to the [Microsoft .NET Standard documentation](https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-1-0). | |
40 |
| -| generateCsproj | default: `true`<br/>values: `false`,`true` | This option is designed to assist you with the integration of SQLC and csharp by generating a `.csproj` file. This converts the generated output to a dynamic link library (DLL), simply a project that you can easily incorporate into your build process. | |
41 |
| -| filePerQuery | default: `false`<br/>values: `false`,`true` | This option allows users control on which `.cs` files to generate, when false it's one file per `.sql` SQLC query file, and when true it's one file per query. | |
42 |
| - |
| 34 | +TBD |
43 | 35 |
|
44 | 36 | ## Supported SQL Engines
|
45 |
| -- MySQL via [MySqlConnector](https://www.nuget.org/packages/MySqlConnector) package - [MySqlConnectorDriver](MySqlConnectorDriver/MySqlConnectorDriver.csproj) |
46 |
| -- PostgreSQL via [Npgsql](https://www.nuget.org/packages/Npgsql) package - [NpgsqlDriver](NpgsqlDriver/NpgsqlDriver.csproj) |
47 |
| - |
| 37 | +- MySQL via [mysql2](https://rubygems.org/gems/mysql2) package - [Mysql2Driver](Drivers/Mysql2Driver.cs) |
| 38 | +- PostgreSQL via [pg](https://rubygems.org/gems/pg) package - [PgDriver](Drivers/PgDriver.cs) |
48 | 39 |
|
49 | 40 | ## Examples & Tests
|
50 | 41 | The below examples in here are automatically tested:
|
51 | 42 | - [MySqlConnectorExample](MySqlConnectorExample/MySqlConnectorExample.csproj)
|
52 | 43 | - [NpgsqlExample](NpgsqlExample/NpgsqlExample.csproj)
|
53 | 44 |
|
54 |
| - |
55 |
| - |
56 |
| -<br/> |
57 |
| -<br/> |
58 |
| -<br/> |
59 |
| - |
60 | 45 | # Contributing
|
61 | 46 | ## Local plugin development
|
62 | 47 | ### Prerequisites
|
|
0 commit comments