diff --git a/README.md b/README.md index a9491254..0740acac 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,6 @@ public async Task ExampleTransaction(IDbConnection connection) ``` More info can be found in [here](https://docs.sqlc.dev/en/stable/howto/transactions.html). - # PostgresSQL
:execlastid - Implementation @@ -379,6 +378,7 @@ amount of data types that are supported by SQLite. The supported overrides are s | text | bool | ✅ | Converts string to a boolean value using Convert.ToBoolean rules |
+ # Benchmark Results ## Read Benchmarks @@ -403,6 +403,7 @@ amount of data types that are supported by SQLite. The supported overrides are s
[SQLite - Writes](https://github.com/DaredevilOSS/sqlc-gen-csharp/blob/main/benchmark/BenchmarkDotNet.Artifacts/sqlite/writes/results/BenchmarkRunner.Benchmarks.SqliteWriteBenchmark-report-github.md) + # Contributing ## Local plugin development ### Prerequisites @@ -453,6 +454,7 @@ By default, the release script will bump the patch version. Adding `[release]` t ### Release structure The new created tag will create a draft release with it, in the release there will be the wasm plugin embedded in the release.
+ # Examples
QuickStartPostgresDalGen @@ -463,7 +465,8 @@ The new created tag will create a draft release with it, in the release there wi ```yaml ``` -
+ +
QuickStartMySqlDalGen @@ -473,7 +476,8 @@ The new created tag will create a draft release with it, in the release there wi ```yaml ``` -
+ +
QuickStartSqliteDalGen @@ -483,7 +487,8 @@ The new created tag will create a draft release with it, in the release there wi ```yaml ``` -
+ +
Npgsql @@ -534,7 +539,8 @@ overrides: notNull: false ``` -
+ +
NpgsqlDapper @@ -585,7 +591,8 @@ overrides: notNull: false ``` -
+ +
NpgsqlLegacy @@ -636,7 +643,8 @@ overrides: notNull: false ``` -
+ +
NpgsqlDapperLegacy @@ -687,7 +695,8 @@ overrides: notNull: false ``` -
+ +
MySqlConnector @@ -722,7 +731,8 @@ overrides: notNull: false ``` -
+ +
MySqlConnectorDapper @@ -757,7 +767,8 @@ overrides: notNull: false ``` -
+ +
MySqlConnectorLegacy @@ -792,7 +803,8 @@ overrides: notNull: false ``` -
+ +
MySqlConnectorDapperLegacy @@ -827,7 +839,8 @@ overrides: notNull: false ``` -
+ +
Sqlite @@ -869,7 +882,8 @@ overrides: type: "Instant" ``` -
+ +
SqliteDapper @@ -911,7 +925,8 @@ overrides: type: "Instant" ``` -
+ +
SqliteLegacy @@ -953,582 +968,8 @@ overrides: type: "Instant" ``` -
-
-SqliteDapperLegacy - -## Engine `sqlite`: [SqliteDapperLegacyExample](examples/SqliteDapperLegacyExample) -### [Schema](examples/config/sqlite/authors/schema.sql) | [Queries](examples/config/sqlite/authors/query.sql) | [End2End Test](end2end/EndToEndTestsLegacy/SqliteDapperTester.cs) -### Config -```yaml -useDapper: true -targetFramework: netstandard2.0 -generateCsproj: true -namespaceName: SqliteDapperLegacyExampleGen -overrides: -- column: "GetSqliteFunctions:max_integer" - csharp_type: - type: "int" -- column: "GetSqliteFunctions:max_varchar" - csharp_type: - type: "string" -- column: "GetSqliteFunctions:max_real" - csharp_type: - type: "decimal" -- column: "*:c_text_datetime_override" - csharp_type: - type: "DateTime" -- column: "*:c_integer_datetime_override" - csharp_type: - type: "DateTime" -- column: "*:c_text_bool_override" - csharp_type: - type: "bool" -- column: "*:c_integer_bool_override" - csharp_type: - type: "bool" -- column: "*:c_text_noda_instant_override" - csharp_type: - type: "Instant" -- column: "*:c_integer_noda_instant_override" - csharp_type: - type: "Instant" -``` - -
-
-benchmark/PostgresqlSqlcImpl - -## Engine `postgresql`: [benchmark/PostgresqlSqlcImpl](benchmark/PostgresqlSqlcImpl) -### [Schema](examples/config/postgresql/benchmark/schema.sql) | [Queries](examples/config/postgresql/benchmark/query.sql) | [End2End Test](end2end/EndToEndTests/benchmark/PostgresqlSqlcImpl.cs) -### Config -```yaml -namespaceName: PostgresSqlcImpl -``` - -
-
-benchmark/SqliteSqlcImpl - -## Engine `sqlite`: [benchmark/SqliteSqlcImpl](benchmark/SqliteSqlcImpl) -### [Schema](examples/config/sqlite/benchmark/schema.sql) | [Queries](examples/config/sqlite/benchmark/query.sql) | [End2End Test](end2end/EndToEndTests/benchmark/SqliteSqlcImpl.cs) -### Config -```yaml -namespaceName: SqliteSqlcImpl -``` - -
-
-benchmark/MysqlSqlcImpl - -## Engine `mysql`: [benchmark/MysqlSqlcImpl](benchmark/MysqlSqlcImpl) -### [Schema](examples/config/mysql/benchmark/schema.sql) | [Queries](examples/config/mysql/benchmark/query.sql) | [End2End Test](end2end/EndToEndTests/benchmark/MysqlSqlcImpl.cs) -### Config -```yaml -namespaceName: MysqlSqlcImpl -``` - -
# Examples -
-QuickStartPostgresDalGen - -## Engine `postgresql`: [QuickStartPostgresDalGen](examples/QuickStartPostgresDalGen) -### [Schema](examples/config/postgresql/authors/schema.sql) | [Queries](examples/config/postgresql/authors/query.sql) | [End2End Test](end2end/EndToEndTests/QuickStartPostgresDalGen.cs) -### Config -```yaml -``` - -
-
-QuickStartMySqlDalGen - -## Engine `mysql`: [QuickStartMySqlDalGen](examples/QuickStartMySqlDalGen) -### [Schema](examples/config/mysql/authors/schema.sql) | [Queries](examples/config/mysql/authors/query.sql) | [End2End Test](end2end/EndToEndTests/QuickStartMySqlDalGen.cs) -### Config -```yaml -``` - -
-
-QuickStartSqliteDalGen - -## Engine `sqlite`: [QuickStartSqliteDalGen](examples/QuickStartSqliteDalGen) -### [Schema](examples/config/sqlite/authors/schema.sql) | [Queries](examples/config/sqlite/authors/query.sql) | [End2End Test](end2end/EndToEndTests/QuickStartSqliteDalGen.cs) -### Config -```yaml -``` - -
-
-Npgsql - -## Engine `postgresql`: [NpgsqlExample](examples/NpgsqlExample) -### [Schema](examples/config/postgresql/authors/schema.sql) | [Queries](examples/config/postgresql/authors/query.sql) | [End2End Test](end2end/EndToEndTests/NpgsqlTester.cs) -### Config -```yaml -useDapper: false -targetFramework: net8.0 -generateCsproj: true -namespaceName: NpgsqlExampleGen -overrides: -- column: "GetPostgresFunctions:max_integer" - csharp_type: - type: "int" - notNull: false -- column: "GetPostgresFunctions:max_varchar" - csharp_type: - type: "string" - notNull: false -- column: "GetPostgresFunctions:max_timestamp" - csharp_type: - type: "DateTime" - notNull: true -- column: "GetPostgresSpecialTypesCnt:c_json" - csharp_type: - type: "JsonElement" - notNull: false -- column: "GetPostgresSpecialTypesCnt:c_jsonb" - csharp_type: - type: "JsonElement" - notNull: false -- column: "*:c_json_string_override" - csharp_type: - type: "string" - notNull: false -- column: "*:c_xml_string_override" - csharp_type: - type: "string" - notNull: false -- column: "*:c_macaddr8" - csharp_type: - type: "string" - notNull: false -- column: "*:c_timestamp_noda_instant_override" - csharp_type: - type: "Instant" - notNull: false -``` - -
-
-NpgsqlDapper - -## Engine `postgresql`: [NpgsqlDapperExample](examples/NpgsqlDapperExample) -### [Schema](examples/config/postgresql/authors/schema.sql) | [Queries](examples/config/postgresql/authors/query.sql) | [End2End Test](end2end/EndToEndTests/NpgsqlDapperTester.cs) -### Config -```yaml -useDapper: true -targetFramework: net8.0 -generateCsproj: true -namespaceName: NpgsqlDapperExampleGen -overrides: -- column: "GetPostgresFunctions:max_integer" - csharp_type: - type: "int" - notNull: false -- column: "GetPostgresFunctions:max_varchar" - csharp_type: - type: "string" - notNull: false -- column: "GetPostgresFunctions:max_timestamp" - csharp_type: - type: "DateTime" - notNull: true -- column: "GetPostgresSpecialTypesCnt:c_json" - csharp_type: - type: "JsonElement" - notNull: false -- column: "GetPostgresSpecialTypesCnt:c_jsonb" - csharp_type: - type: "JsonElement" - notNull: false -- column: "*:c_json_string_override" - csharp_type: - type: "string" - notNull: false -- column: "*:c_xml_string_override" - csharp_type: - type: "string" - notNull: false -- column: "*:c_macaddr8" - csharp_type: - type: "string" - notNull: false -- column: "*:c_timestamp_noda_instant_override" - csharp_type: - type: "Instant" - notNull: false -``` - -
-
-NpgsqlLegacy - -## Engine `postgresql`: [NpgsqlLegacyExample](examples/NpgsqlLegacyExample) -### [Schema](examples/config/postgresql/authors/schema.sql) | [Queries](examples/config/postgresql/authors/query.sql) | [End2End Test](end2end/EndToEndTestsLegacy/NpgsqlTester.cs) -### Config -```yaml -useDapper: false -targetFramework: netstandard2.0 -generateCsproj: true -namespaceName: NpgsqlLegacyExampleGen -overrides: -- column: "GetPostgresFunctions:max_integer" - csharp_type: - type: "int" - notNull: false -- column: "GetPostgresFunctions:max_varchar" - csharp_type: - type: "string" - notNull: false -- column: "GetPostgresFunctions:max_timestamp" - csharp_type: - type: "DateTime" - notNull: true -- column: "GetPostgresSpecialTypesCnt:c_json" - csharp_type: - type: "JsonElement" - notNull: false -- column: "GetPostgresSpecialTypesCnt:c_jsonb" - csharp_type: - type: "JsonElement" - notNull: false -- column: "*:c_json_string_override" - csharp_type: - type: "string" - notNull: false -- column: "*:c_xml_string_override" - csharp_type: - type: "string" - notNull: false -- column: "*:c_macaddr8" - csharp_type: - type: "string" - notNull: false -- column: "*:c_timestamp_noda_instant_override" - csharp_type: - type: "Instant" - notNull: false -``` - -
-
-NpgsqlDapperLegacy - -## Engine `postgresql`: [NpgsqlDapperLegacyExample](examples/NpgsqlDapperLegacyExample) -### [Schema](examples/config/postgresql/authors/schema.sql) | [Queries](examples/config/postgresql/authors/query.sql) | [End2End Test](end2end/EndToEndTestsLegacy/NpgsqlDapperTester.cs) -### Config -```yaml -useDapper: true -targetFramework: netstandard2.0 -generateCsproj: true -namespaceName: NpgsqlDapperLegacyExampleGen -overrides: -- column: "GetPostgresFunctions:max_integer" - csharp_type: - type: "int" - notNull: false -- column: "GetPostgresFunctions:max_varchar" - csharp_type: - type: "string" - notNull: false -- column: "GetPostgresFunctions:max_timestamp" - csharp_type: - type: "DateTime" - notNull: true -- column: "GetPostgresSpecialTypesCnt:c_json" - csharp_type: - type: "JsonElement" - notNull: false -- column: "GetPostgresSpecialTypesCnt:c_jsonb" - csharp_type: - type: "JsonElement" - notNull: false -- column: "*:c_json_string_override" - csharp_type: - type: "string" - notNull: false -- column: "*:c_xml_string_override" - csharp_type: - type: "string" - notNull: false -- column: "*:c_macaddr8" - csharp_type: - type: "string" - notNull: false -- column: "*:c_timestamp_noda_instant_override" - csharp_type: - type: "Instant" - notNull: false -``` - -
-
-MySqlConnector - -## Engine `mysql`: [MySqlConnectorExample](examples/MySqlConnectorExample) -### [Schema](examples/config/mysql/authors/schema.sql) | [Queries](examples/config/mysql/authors/query.sql) | [End2End Test](end2end/EndToEndTests/MySqlConnectorTester.cs) -### Config -```yaml -useDapper: false -targetFramework: net8.0 -generateCsproj: true -namespaceName: MySqlConnectorExampleGen -overrides: -- column: "GetMysqlFunctions:max_int" - csharp_type: - type: "int" - notNull: false -- column: "GetMysqlFunctions:max_varchar" - csharp_type: - type: "string" - notNull: false -- column: "GetMysqlFunctions:max_timestamp" - csharp_type: - type: "DateTime" - notNull: true -- column: "*:c_json_string_override" - csharp_type: - type: "string" - notNull: false -- column: "*:c_timestamp_noda_instant_override" - csharp_type: - type: "Instant" - notNull: false -``` - -
-
-MySqlConnectorDapper - -## Engine `mysql`: [MySqlConnectorDapperExample](examples/MySqlConnectorDapperExample) -### [Schema](examples/config/mysql/authors/schema.sql) | [Queries](examples/config/mysql/authors/query.sql) | [End2End Test](end2end/EndToEndTests/MySqlConnectorDapperTester.cs) -### Config -```yaml -useDapper: true -targetFramework: net8.0 -generateCsproj: true -namespaceName: MySqlConnectorDapperExampleGen -overrides: -- column: "GetMysqlFunctions:max_int" - csharp_type: - type: "int" - notNull: false -- column: "GetMysqlFunctions:max_varchar" - csharp_type: - type: "string" - notNull: false -- column: "GetMysqlFunctions:max_timestamp" - csharp_type: - type: "DateTime" - notNull: true -- column: "*:c_json_string_override" - csharp_type: - type: "string" - notNull: false -- column: "*:c_timestamp_noda_instant_override" - csharp_type: - type: "Instant" - notNull: false -``` - -
-
-MySqlConnectorLegacy - -## Engine `mysql`: [MySqlConnectorLegacyExample](examples/MySqlConnectorLegacyExample) -### [Schema](examples/config/mysql/authors/schema.sql) | [Queries](examples/config/mysql/authors/query.sql) | [End2End Test](end2end/EndToEndTestsLegacy/MySqlConnectorTester.cs) -### Config -```yaml -useDapper: false -targetFramework: netstandard2.0 -generateCsproj: true -namespaceName: MySqlConnectorLegacyExampleGen -overrides: -- column: "GetMysqlFunctions:max_int" - csharp_type: - type: "int" - notNull: false -- column: "GetMysqlFunctions:max_varchar" - csharp_type: - type: "string" - notNull: false -- column: "GetMysqlFunctions:max_timestamp" - csharp_type: - type: "DateTime" - notNull: true -- column: "*:c_json_string_override" - csharp_type: - type: "string" - notNull: false -- column: "*:c_timestamp_noda_instant_override" - csharp_type: - type: "Instant" - notNull: false -``` - -
-
-MySqlConnectorDapperLegacy - -## Engine `mysql`: [MySqlConnectorDapperLegacyExample](examples/MySqlConnectorDapperLegacyExample) -### [Schema](examples/config/mysql/authors/schema.sql) | [Queries](examples/config/mysql/authors/query.sql) | [End2End Test](end2end/EndToEndTestsLegacy/MySqlConnectorDapperTester.cs) -### Config -```yaml -useDapper: true -targetFramework: netstandard2.0 -generateCsproj: true -namespaceName: MySqlConnectorDapperLegacyExampleGen -overrides: -- column: "GetMysqlFunctions:max_int" - csharp_type: - type: "int" - notNull: false -- column: "GetMysqlFunctions:max_varchar" - csharp_type: - type: "string" - notNull: false -- column: "GetMysqlFunctions:max_timestamp" - csharp_type: - type: "DateTime" - notNull: true -- column: "*:c_json_string_override" - csharp_type: - type: "string" - notNull: false -- column: "*:c_timestamp_noda_instant_override" - csharp_type: - type: "Instant" - notNull: false -``` - -
-
-Sqlite - -## Engine `sqlite`: [SqliteExample](examples/SqliteExample) -### [Schema](examples/config/sqlite/authors/schema.sql) | [Queries](examples/config/sqlite/authors/query.sql) | [End2End Test](end2end/EndToEndTests/SqliteTester.cs) -### Config -```yaml -useDapper: false -targetFramework: net8.0 -generateCsproj: true -namespaceName: SqliteExampleGen -overrides: -- column: "GetSqliteFunctions:max_integer" - csharp_type: - type: "int" -- column: "GetSqliteFunctions:max_varchar" - csharp_type: - type: "string" -- column: "GetSqliteFunctions:max_real" - csharp_type: - type: "decimal" -- column: "*:c_text_datetime_override" - csharp_type: - type: "DateTime" -- column: "*:c_integer_datetime_override" - csharp_type: - type: "DateTime" -- column: "*:c_text_bool_override" - csharp_type: - type: "bool" -- column: "*:c_integer_bool_override" - csharp_type: - type: "bool" -- column: "*:c_text_noda_instant_override" - csharp_type: - type: "Instant" -- column: "*:c_integer_noda_instant_override" - csharp_type: - type: "Instant" -``` - -
-
-SqliteDapper - -## Engine `sqlite`: [SqliteDapperExample](examples/SqliteDapperExample) -### [Schema](examples/config/sqlite/authors/schema.sql) | [Queries](examples/config/sqlite/authors/query.sql) | [End2End Test](end2end/EndToEndTests/SqliteDapperTester.cs) -### Config -```yaml -useDapper: true -targetFramework: net8.0 -generateCsproj: true -namespaceName: SqliteDapperExampleGen -overrides: -- column: "GetSqliteFunctions:max_integer" - csharp_type: - type: "int" -- column: "GetSqliteFunctions:max_varchar" - csharp_type: - type: "string" -- column: "GetSqliteFunctions:max_real" - csharp_type: - type: "decimal" -- column: "*:c_text_datetime_override" - csharp_type: - type: "DateTime" -- column: "*:c_integer_datetime_override" - csharp_type: - type: "DateTime" -- column: "*:c_text_bool_override" - csharp_type: - type: "bool" -- column: "*:c_integer_bool_override" - csharp_type: - type: "bool" -- column: "*:c_text_noda_instant_override" - csharp_type: - type: "Instant" -- column: "*:c_integer_noda_instant_override" - csharp_type: - type: "Instant" -``` - -
-
-SqliteLegacy - -## Engine `sqlite`: [SqliteLegacyExample](examples/SqliteLegacyExample) -### [Schema](examples/config/sqlite/authors/schema.sql) | [Queries](examples/config/sqlite/authors/query.sql) | [End2End Test](end2end/EndToEndTestsLegacy/SqliteTester.cs) -### Config -```yaml -useDapper: false -targetFramework: netstandard2.0 -generateCsproj: true -namespaceName: SqliteLegacyExampleGen -overrides: -- column: "GetSqliteFunctions:max_integer" - csharp_type: - type: "int" -- column: "GetSqliteFunctions:max_varchar" - csharp_type: - type: "string" -- column: "GetSqliteFunctions:max_real" - csharp_type: - type: "decimal" -- column: "*:c_text_datetime_override" - csharp_type: - type: "DateTime" -- column: "*:c_integer_datetime_override" - csharp_type: - type: "DateTime" -- column: "*:c_text_bool_override" - csharp_type: - type: "bool" -- column: "*:c_integer_bool_override" - csharp_type: - type: "bool" -- column: "*:c_text_noda_instant_override" - csharp_type: - type: "Instant" -- column: "*:c_integer_noda_instant_override" - csharp_type: - type: "Instant" -``` - -
+ +
SqliteDapperLegacy @@ -1570,4 +1011,4 @@ overrides: type: "Instant" ``` -
\ No newline at end of file + diff --git a/docs/04_Postgres.md b/docs/04_Postgres.md index f708bd91..54fb2df4 100644 --- a/docs/04_Postgres.md +++ b/docs/04_Postgres.md @@ -85,3 +85,4 @@ INSERT INTO tab1 (macaddr8_field) VALUES (sqlc.narg('macaddr8_field')::macaddr8) ``` + diff --git a/docs/05_MySql.md b/docs/05_MySql.md index 7944f710..6aef8aaa 100644 --- a/docs/05_MySql.md +++ b/docs/05_MySql.md @@ -82,3 +82,4 @@ we consider support for the different data types separately for batch inserts an | geometrycollection | ⚠️ | ⚠️ | + diff --git a/docs/06_Sqlite.md b/docs/06_Sqlite.md index 3f6cb7cb..7d94cf4a 100644 --- a/docs/06_Sqlite.md +++ b/docs/06_Sqlite.md @@ -46,3 +46,4 @@ amount of data types that are supported by SQLite. The supported overrides are s | text | bool | ✅ | Converts string to a boolean value using Convert.ToBoolean rules | + diff --git a/docs/08_Contributing.md b/docs/08_Contributing.md index b9a26332..997d928d 100644 --- a/docs/08_Contributing.md +++ b/docs/08_Contributing.md @@ -48,3 +48,4 @@ By default, the release script will bump the patch version. Adding `[release]` t ### Release structure The new created tag will create a draft release with it, in the release there will be the wasm plugin embedded in the release.
+ diff --git a/docs/09_Examples.md b/docs/09_Examples.md index 4ae55c58..a6ae5bf5 100644 --- a/docs/09_Examples.md +++ b/docs/09_Examples.md @@ -8,7 +8,8 @@ ```yaml ``` - + +
QuickStartMySqlDalGen @@ -18,7 +19,8 @@ ```yaml ``` -
+ +
QuickStartSqliteDalGen @@ -28,7 +30,8 @@ ```yaml ``` -
+ +
Npgsql @@ -79,7 +82,8 @@ overrides: notNull: false ``` -
+ +
NpgsqlDapper @@ -130,7 +134,8 @@ overrides: notNull: false ``` -
+ +
NpgsqlLegacy @@ -181,7 +186,8 @@ overrides: notNull: false ``` -
+ +
NpgsqlDapperLegacy @@ -232,7 +238,8 @@ overrides: notNull: false ``` -
+ +
MySqlConnector @@ -267,7 +274,8 @@ overrides: notNull: false ``` -
+ +
MySqlConnectorDapper @@ -302,7 +310,8 @@ overrides: notNull: false ``` -
+ +
MySqlConnectorLegacy @@ -337,7 +346,8 @@ overrides: notNull: false ``` -
+ +
MySqlConnectorDapperLegacy @@ -372,7 +382,8 @@ overrides: notNull: false ``` -
+ +
Sqlite @@ -414,7 +425,8 @@ overrides: type: "Instant" ``` -
+ +
SqliteDapper @@ -456,7 +468,8 @@ overrides: type: "Instant" ``` -
+ +
SqliteLegacy @@ -498,7 +511,8 @@ overrides: type: "Instant" ``` -
+ +
SqliteDapperLegacy @@ -540,4 +554,4 @@ overrides: type: "Instant" ``` -
\ No newline at end of file + diff --git a/docs/scripts/generate_all_docs.sh b/docs/scripts/generate_all_docs.sh index 7187915e..86672384 100755 --- a/docs/scripts/generate_all_docs.sh +++ b/docs/scripts/generate_all_docs.sh @@ -3,5 +3,5 @@ set -e ./docs/scripts/generate_quickstart.sh > docs/02_Quickstart.md -dotnet run --project docs/ExamplesDocGen/ExampleDocGen.csproj > docs/08_Examples.md +dotnet run --project docs/ExamplesDocGen/ExampleDocGen.csproj > docs/09_Examples.md cat docs/0*.md > README.md \ No newline at end of file