diff --git a/docs/03_Usage.md b/docs/03_Usage.md index c4a9726d..eff9f101 100644 --- a/docs/03_Usage.md +++ b/docs/03_Usage.md @@ -118,4 +118,3 @@ public async Task ExampleTransaction(IDbConnection connection) ``` More info can be found in [here](https://docs.sqlc.dev/en/stable/howto/transactions.html). - diff --git a/docs/04_Postgres.md b/docs/04_Postgres.md index 54fb2df4..f708bd91 100644 --- a/docs/04_Postgres.md +++ b/docs/04_Postgres.md @@ -85,4 +85,3 @@ INSERT INTO tab1 (macaddr8_field) VALUES (sqlc.narg('macaddr8_field')::macaddr8) ``` - diff --git a/docs/05_MySql.md b/docs/05_MySql.md index 6aef8aaa..7944f710 100644 --- a/docs/05_MySql.md +++ b/docs/05_MySql.md @@ -82,4 +82,3 @@ we consider support for the different data types separately for batch inserts an | geometrycollection | ⚠️ | ⚠️ | - diff --git a/docs/07_Benchmark.md b/docs/07_Benchmark.md index 6fba8e23..41365736 100644 --- a/docs/07_Benchmark.md +++ b/docs/07_Benchmark.md @@ -22,3 +22,4 @@
[SQLite - Writes](https://github.com/DaredevilOSS/sqlc-gen-csharp/blob/main/benchmark/BenchmarkDotNet.Artifacts/sqlite/writes/results/BenchmarkRunner.Benchmarks.SqliteWriteBenchmark-report-github.md) + diff --git a/docs/08_Examples.md b/docs/08_Examples.md deleted file mode 100644 index 2f8a3a52..00000000 --- a/docs/08_Examples.md +++ /dev/null @@ -1,576 +0,0 @@ -# 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 - -## 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 -``` - -
\ No newline at end of file diff --git a/docs/ExamplesDocGen/Program.cs b/docs/ExamplesDocGen/Program.cs index 8070dac0..71528fd8 100644 --- a/docs/ExamplesDocGen/Program.cs +++ b/docs/ExamplesDocGen/Program.cs @@ -49,6 +49,7 @@ private static string ParseConfigNode(YamlNode node) {optionsStr}``` + """; }