From 40b6a3c73d1204f937684af22a946741436c24a4 Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Tue, 17 Nov 2020 22:38:30 +0900 Subject: [PATCH 01/29] Removed on push fixCodeQLError not needed anymore --- .github/workflows/codeql-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 3c63d81..4fc9244 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -2,7 +2,7 @@ name: "CodeQL" on: push: - branches: [main,fixCodeQLError] + branches: [main] pull_request: # The branches below must be a subset of the branches above branches: [main] From c5f2ae5e12667896cb7ab8d13194b5df9d45ed07 Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Sat, 21 Nov 2020 16:04:56 +0900 Subject: [PATCH 02/29] Switch Data Provider for SQLServer to Microsoft.Data.SqlClient from System.Data.SqlClient --- DirectSQL/DirectSQL.csproj | 2 +- DirectSQL/SqlServer/SqlServerDatabase.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DirectSQL/DirectSQL.csproj b/DirectSQL/DirectSQL.csproj index eb549fa..99a5995 100644 --- a/DirectSQL/DirectSQL.csproj +++ b/DirectSQL/DirectSQL.csproj @@ -17,7 +17,7 @@ This .NET library is very thin database framework on top of System.Data. - + diff --git a/DirectSQL/SqlServer/SqlServerDatabase.cs b/DirectSQL/SqlServer/SqlServerDatabase.cs index 9a346a6..40e85b8 100644 --- a/DirectSQL/SqlServer/SqlServerDatabase.cs +++ b/DirectSQL/SqlServer/SqlServerDatabase.cs @@ -1,6 +1,6 @@ using System; -using System.Data.SqlClient; +using Microsoft.Data.SqlClient; namespace DirectSQL.SqlServer { From e52ed7997715946173af1b9d3be01110421e81a1 Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Sat, 21 Nov 2020 16:08:00 +0900 Subject: [PATCH 03/29] Versioned 3.11.0 --- DirectSQL/DirectSQL.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DirectSQL/DirectSQL.csproj b/DirectSQL/DirectSQL.csproj index 99a5995..da92275 100644 --- a/DirectSQL/DirectSQL.csproj +++ b/DirectSQL/DirectSQL.csproj @@ -3,7 +3,7 @@ net5.0 true - 3.10.0 + 3.11.0 LICENSE https://github.com/DirectSQL/DirectSQL/ From 3288bd60620d7e7c9850e5cdd2a781a00f6e86dc Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Thu, 25 Feb 2021 18:07:56 +0900 Subject: [PATCH 04/29] Update target to net6.0 --- DirectSQL/DirectSQL.csproj | 2 +- TestSqlLiteDatabase/TestSqlLiteDatabase.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DirectSQL/DirectSQL.csproj b/DirectSQL/DirectSQL.csproj index da92275..5d650e2 100644 --- a/DirectSQL/DirectSQL.csproj +++ b/DirectSQL/DirectSQL.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 true 3.11.0 diff --git a/TestSqlLiteDatabase/TestSqlLiteDatabase.csproj b/TestSqlLiteDatabase/TestSqlLiteDatabase.csproj index be30cb2..df205d8 100644 --- a/TestSqlLiteDatabase/TestSqlLiteDatabase.csproj +++ b/TestSqlLiteDatabase/TestSqlLiteDatabase.csproj @@ -1,7 +1,7 @@ - net5 + net6.0 false From ea862e6c2cc45c64b2b58cb8e306d4d92b85afec Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Thu, 25 Feb 2021 18:15:36 +0900 Subject: [PATCH 05/29] Update dotnetcore.yml to net6 preview --- .github/workflows/dotnetcore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 80dd223..4c0bfd0 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -12,7 +12,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 5.0.100 + dotnet-version: 6.0.100-preview source-url: https://nuget.pkg.github.com/directsql/index.json env: NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} From 89f15292ec39cb340cf91e6303ddb9bd9e241171 Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Thu, 25 Feb 2021 18:24:04 +0900 Subject: [PATCH 06/29] Added .1.21103.13 to net6 version in dotnetcore.yml --- .github/workflows/dotnetcore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 4c0bfd0..4ac4073 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -12,7 +12,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.100-preview + dotnet-version: 6.0.100-preview.1.21103.13 source-url: https://nuget.pkg.github.com/directsql/index.json env: NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} From 7f026d809e4d2e849c3d7eeb0ee940b2932c56f7 Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Sat, 24 Jul 2021 22:11:58 +0900 Subject: [PATCH 07/29] Commit to trigger build From 9cd54a5a292754b88429bf96ed7bedc4cef82287 Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Tue, 9 Nov 2021 22:17:13 +0900 Subject: [PATCH 08/29] Removed preview --- .github/workflows/dotnetcore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 4ac4073..4def06b 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -12,7 +12,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.100-preview.1.21103.13 + dotnet-version: 6.0.100 source-url: https://nuget.pkg.github.com/directsql/index.json env: NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} From 61f4c0335ada7b1dfcf4e5a007405c4beadb41b4 Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Tue, 9 Nov 2021 22:22:20 +0900 Subject: [PATCH 09/29] Bumped to 3.12.0 --- DirectSQL/DirectSQL.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DirectSQL/DirectSQL.csproj b/DirectSQL/DirectSQL.csproj index 5d650e2..04f1b2b 100644 --- a/DirectSQL/DirectSQL.csproj +++ b/DirectSQL/DirectSQL.csproj @@ -3,7 +3,7 @@ net6.0 true - 3.11.0 + 3.12.0 LICENSE https://github.com/DirectSQL/DirectSQL/ From b6c441e3cba5c0fc12c953560842f30178fed1b5 Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Thu, 19 May 2022 21:33:01 +0900 Subject: [PATCH 10/29] Update net in global.json to 6.0.100 --- global.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index 7abee74..126149e 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "5.0.100", + "version": "6.0.100", "rollForward": "latestMajor" } -} \ No newline at end of file +} From f0e4847cbc2b0fb48d8be7e4b21de09f47781f25 Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Fri, 20 May 2022 23:10:01 +0900 Subject: [PATCH 11/29] upgrade version of codeql to v2 --- .github/workflows/codeql-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 4fc9244..0c36c50 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -59,4 +59,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 From 6c0b80ab028feda2626b0007ea1b4ae0cd2bcfa4 Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Fri, 11 Nov 2022 20:21:01 +0900 Subject: [PATCH 12/29] Update Microsoft.Data.SqlClient to 2.1.2 --- DirectSQL/DatabaseDictionary.cs | 12 ++++++++++++ DirectSQL/DirectSQL.csproj | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 DirectSQL/DatabaseDictionary.cs diff --git a/DirectSQL/DatabaseDictionary.cs b/DirectSQL/DatabaseDictionary.cs new file mode 100644 index 0000000..95ccd52 --- /dev/null +++ b/DirectSQL/DatabaseDictionary.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DirectSQL +{ + internal class DatabaseDictionary + { + } +} diff --git a/DirectSQL/DirectSQL.csproj b/DirectSQL/DirectSQL.csproj index 04f1b2b..690439f 100644 --- a/DirectSQL/DirectSQL.csproj +++ b/DirectSQL/DirectSQL.csproj @@ -17,7 +17,7 @@ This .NET library is very thin database framework on top of System.Data. - + From 37ccd6493d7dfb78b5066b1212519c3c4b3cb414 Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Fri, 11 Nov 2022 20:22:37 +0900 Subject: [PATCH 13/29] Labeled 3.13.0 --- DirectSQL/DirectSQL.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DirectSQL/DirectSQL.csproj b/DirectSQL/DirectSQL.csproj index 690439f..491f42e 100644 --- a/DirectSQL/DirectSQL.csproj +++ b/DirectSQL/DirectSQL.csproj @@ -3,7 +3,7 @@ net6.0 true - 3.12.0 + 3.13.0 LICENSE https://github.com/DirectSQL/DirectSQL/ From 62575d73c5371c1f7c659a49bb3bb591a05e475a Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Sun, 20 Nov 2022 12:22:43 +0900 Subject: [PATCH 14/29] Update dotnetcore.yml Update to dotnet7 --- .github/workflows/dotnetcore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 4def06b..0e9349d 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -12,7 +12,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.100 + dotnet-version: 7.0.100 source-url: https://nuget.pkg.github.com/directsql/index.json env: NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} From baac33dcb179f9d5c5f8070bf71ee4c5484097b7 Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Sun, 20 Nov 2022 12:26:55 +0900 Subject: [PATCH 15/29] Updated project target to net7.0 --- DirectSQL/DirectSQL.csproj | 2 +- TestSqlLiteDatabase/TestSqlLiteDatabase.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DirectSQL/DirectSQL.csproj b/DirectSQL/DirectSQL.csproj index 491f42e..1ce362a 100644 --- a/DirectSQL/DirectSQL.csproj +++ b/DirectSQL/DirectSQL.csproj @@ -1,7 +1,7 @@  - net6.0 + net7.0 true 3.13.0 diff --git a/TestSqlLiteDatabase/TestSqlLiteDatabase.csproj b/TestSqlLiteDatabase/TestSqlLiteDatabase.csproj index df205d8..f5ecf13 100644 --- a/TestSqlLiteDatabase/TestSqlLiteDatabase.csproj +++ b/TestSqlLiteDatabase/TestSqlLiteDatabase.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 false From ec9a63cea5184cbc6ae466516faf7cdd41e221ac Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Sun, 20 Nov 2022 12:31:26 +0900 Subject: [PATCH 16/29] Updated sdk version in global.json --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 126149e..e23437b 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.100", + "version": "7.0.100", "rollForward": "latestMajor" } } From 9a9d584aecd48bc47b61db50709c46d10adef1be Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Sun, 20 Nov 2022 12:35:40 +0900 Subject: [PATCH 17/29] Update DirectSQL.csproj Labled to 3.14.0 --- DirectSQL/DirectSQL.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DirectSQL/DirectSQL.csproj b/DirectSQL/DirectSQL.csproj index 1ce362a..067271f 100644 --- a/DirectSQL/DirectSQL.csproj +++ b/DirectSQL/DirectSQL.csproj @@ -3,7 +3,7 @@ net7.0 true - 3.13.0 + 3.14.0 LICENSE https://github.com/DirectSQL/DirectSQL/ From 88dc9b4a5492df78a773808d37afddca2f3ec3bc Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Thu, 30 Nov 2023 20:58:53 +0900 Subject: [PATCH 18/29] Update dotnetcore.yml Update dotnet-version to 8.0.0 --- .github/workflows/dotnetcore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 0e9349d..00cd0a4 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -12,7 +12,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 7.0.100 + dotnet-version: 8.0.0 source-url: https://nuget.pkg.github.com/directsql/index.json env: NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} From 55701bea7c0bd8c495fd2606e0e17ee6976252be Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Thu, 30 Nov 2023 21:00:00 +0900 Subject: [PATCH 19/29] Update dotnetcore.yml 8.0.000 --- .github/workflows/dotnetcore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 00cd0a4..4e2860c 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -12,7 +12,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 8.0.0 + dotnet-version: 8.0.000 source-url: https://nuget.pkg.github.com/directsql/index.json env: NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} From 7078e42feafb935f0de8655262106ad8422a2dfe Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Thu, 30 Nov 2023 21:01:58 +0900 Subject: [PATCH 20/29] Update dotnetcore.yml 8.0.100 --- .github/workflows/dotnetcore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 4e2860c..10d68f7 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -12,7 +12,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 8.0.000 + dotnet-version: 8.0.100 source-url: https://nuget.pkg.github.com/directsql/index.json env: NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} From 0354225691d679ad64a04a62011af864c5e57364 Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Thu, 30 Nov 2023 21:03:56 +0900 Subject: [PATCH 21/29] Update TestSqlLiteDatabase.csproj net8.0 in TestSqlLiteDatabase --- TestSqlLiteDatabase/TestSqlLiteDatabase.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestSqlLiteDatabase/TestSqlLiteDatabase.csproj b/TestSqlLiteDatabase/TestSqlLiteDatabase.csproj index f5ecf13..cd44017 100644 --- a/TestSqlLiteDatabase/TestSqlLiteDatabase.csproj +++ b/TestSqlLiteDatabase/TestSqlLiteDatabase.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false From 8cc020c89332c800766f13c916c29d40bc886f20 Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Thu, 30 Nov 2023 21:04:27 +0900 Subject: [PATCH 22/29] Update DirectSQL.csproj net8.0 for DirectSQL.csproj --- DirectSQL/DirectSQL.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DirectSQL/DirectSQL.csproj b/DirectSQL/DirectSQL.csproj index 067271f..5c57802 100644 --- a/DirectSQL/DirectSQL.csproj +++ b/DirectSQL/DirectSQL.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 true 3.14.0 From fa267ebe1b4c797b0984db44098302e13ff101c9 Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Thu, 30 Nov 2023 21:06:11 +0900 Subject: [PATCH 23/29] Update DirectSQL.csproj Package version to 3.15.0 --- DirectSQL/DirectSQL.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DirectSQL/DirectSQL.csproj b/DirectSQL/DirectSQL.csproj index 5c57802..54aaace 100644 --- a/DirectSQL/DirectSQL.csproj +++ b/DirectSQL/DirectSQL.csproj @@ -3,7 +3,7 @@ net8.0 true - 3.14.0 + 3.15.0 LICENSE https://github.com/DirectSQL/DirectSQL/ From 01c0850c8d94fb5855c5b2b1f89b7d9e7c4405be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jan 2024 19:42:01 +0000 Subject: [PATCH 24/29] Bump Microsoft.Data.SqlClient from 2.1.2 to 2.1.7 in /DirectSQL Bumps [Microsoft.Data.SqlClient](https://github.com/dotnet/sqlclient) from 2.1.2 to 2.1.7. - [Release notes](https://github.com/dotnet/sqlclient/releases) - [Changelog](https://github.com/dotnet/SqlClient/blob/main/CHANGELOG.md) - [Commits](https://github.com/dotnet/sqlclient/compare/v2.1.2...v2.1.7) --- updated-dependencies: - dependency-name: Microsoft.Data.SqlClient dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- DirectSQL/DirectSQL.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DirectSQL/DirectSQL.csproj b/DirectSQL/DirectSQL.csproj index 54aaace..a893fd0 100644 --- a/DirectSQL/DirectSQL.csproj +++ b/DirectSQL/DirectSQL.csproj @@ -17,7 +17,7 @@ This .NET library is very thin database framework on top of System.Data. - + From a8810018e6571b13c83ceb2f33c5f1dd5514c75c Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Thu, 30 Apr 2026 14:14:06 +0900 Subject: [PATCH 25/29] Add Copilot repository instructions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/copilot-instructions.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/copilot-instructions.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..2ef9b3c --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,29 @@ +# DirectSQL Copilot Instructions + +## Build and test + +- Build the solution from the repo root with `dotnet build --configuration Release`. +- Run the full test suite with `dotnet test --configuration Release`. +- Run a single MSTest with `dotnet test TestSqlLiteDatabase/TestSqlLiteDatabase.csproj --filter FullyQualifiedName~TestSqlLiteDatabase.QueryTest.TestQuery`. +- The projects target `net8.0`. CI uses .NET 8.0.100, and `global.json` allows rolling forward from 7.0.100 to a newer major SDK. +- `DirectSQL/DirectSQL.csproj` has `GeneratePackageOnBuild=true`, so builds also produce a NuGet package in `DirectSQL/bin//`. +- In the current dependency set, SQLite tests fail on macOS before assertions run because `System.Data.SQLite.Core` cannot load `SQLite.Interop.dll`. + +## High-level architecture + +- `DirectSQL/Database.cs` is the core of the library. It owns connection lifecycle (`Process`, `ProcessAsync`), transaction wrappers, parameter creation/conversion, and the provider-agnostic SQL helpers (`ExecuteNonQuery`, `ExecuteScalar`, `Query`, `LoadSqlResult`, and the `FormattableString` overloads). +- Each database-specific entry point is a thin subclass of `Database<...>` under `DirectSQL/SqlLite`, `DirectSQL/SqlServer`, `DirectSQL/npgsql`, `DirectSQL/MySql`, `DirectSQL/DB2`, and `DirectSQL/Odbc`. These classes mostly capture a connection string and implement `CreateConnection()`. +- `DirectSQL/SqlResult.cs` wraps the active `IDataReader` and exposes the current row as `dynamic`, tuple arrays, typed projections, and enumerable loaders. This is the main abstraction for reading query results. +- The normal execution flow is: instantiate a concrete provider database -> enter `Process(...)` / `ProcessAsync(...)` to get an open connection -> call static query helpers on the provider type -> let `Database.cs` build the command and parameters -> read rows through `SqlResult`. +- `LoadSqlResult*` convenience APIs are thin wrappers over `Query(...)` that materialize the cursor into `dynamic[]`; they do not introduce a separate query pipeline. +- Error handling is centralized in `Database.Transaction(...)` and `Database.TransactionAsync(...)`: exceptions from the callback are wrapped in `DatabaseException`, while the low-level command and reader behavior remains straight ADO.NET. +- `TestSqlLiteDatabase` is the only test project and doubles as the main executable specification of library behavior. Most usage patterns in the README are mirrored there. + +## Key conventions + +- Treat the concrete `*Database` class as the entry point for connection management, then use static methods on that same concrete type inside the callback. The common pattern is `db.Process((conn, tran) => { SqlLiteDatabase.Query(...); })`, not instance methods for query execution. +- Transaction callbacks are manual-commit. `Process((conn, tran) => ...)` and `Database.Transaction(...)` provide a transaction object, but the library does not commit for you; tests that need persistence call `tran.Commit()` explicitly and use `tran.Rollback()` explicitly for rollback scenarios. The library only rolls back automatically when it catches an exception and rethrows `DatabaseException`. +- `SqlResult` is cursor-based. Call `result.Next()` before reading `ResultValues` or `ResultTuples`; attempting to read row values before the first `Next()` or after the cursor is exhausted raises the underlying reader error. `ResultValues` and `ResultTuples` are cached for the current row and reset on the next `Next()`. +- Prefer the built-in parameter helpers over handwritten command setup. The codebase uses tuple parameters like `new (string, object)[] { ("@val1", value) }` and `CreateParameter(...)` when an explicit `DbType` is needed. +- Prefer the `FormattableString` helpers when authoring inline SQL in code. `ExecuteFormattableNonQuery`, `ExecuteFormattableScalar`, `QueryFormattable`, and `LoadFormattableSqlResult` rewrite interpolated values into generated bound parameters like `@0`, `@1`, and tests assert against that rewritten SQL. +- The async APIs are wrappers around synchronous ADO.NET work via `Task.Run`, not provider-native async I/O. Keep that in mind when changing behavior or adding new async surfaces. From d378fd39ddcdb514dae34eaa8a36f683e88f50dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 05:24:06 +0000 Subject: [PATCH 26/29] Bump Npgsql from 4.0.3 to 4.0.14 --- updated-dependencies: - dependency-name: Npgsql dependency-version: 4.0.14 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- DirectSQL/DirectSQL.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DirectSQL/DirectSQL.csproj b/DirectSQL/DirectSQL.csproj index a893fd0..c3ec1d2 100644 --- a/DirectSQL/DirectSQL.csproj +++ b/DirectSQL/DirectSQL.csproj @@ -15,7 +15,7 @@ This .NET library is very thin database framework on top of System.Data. - + From ff87f44e462ede73c40d0888a9dfd4ed61eb3d2c Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Sun, 3 May 2026 11:47:37 +0900 Subject: [PATCH 27/29] Update GitHub Actions to use latest checkout and setup-dotnet --- .github/workflows/dotnetcore.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 10d68f7..88beb2b 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -8,9 +8,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v6 - name: Setup .NET Core - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v5 with: dotnet-version: 8.0.100 source-url: https://nuget.pkg.github.com/directsql/index.json From 8e49b981330c781f7312f9464ddd30d6a536f450 Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Sun, 3 May 2026 11:51:02 +0900 Subject: [PATCH 28/29] Bump version from 3.15.0 to 3.16.0 --- DirectSQL/DirectSQL.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DirectSQL/DirectSQL.csproj b/DirectSQL/DirectSQL.csproj index c3ec1d2..08faa6e 100644 --- a/DirectSQL/DirectSQL.csproj +++ b/DirectSQL/DirectSQL.csproj @@ -3,7 +3,7 @@ net8.0 true - 3.15.0 + 3.16.0 LICENSE https://github.com/DirectSQL/DirectSQL/ From 2575b7a6b1cb4348b6d46418e6172363a7155c61 Mon Sep 17 00:00:00 2001 From: Tomohito Nakayama Date: Mon, 4 May 2026 16:10:36 +0900 Subject: [PATCH 29/29] Replace constructor invocation to Empty --- DirectSQL/Database.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DirectSQL/Database.cs b/DirectSQL/Database.cs index fd06f7a..ce2747f 100644 --- a/DirectSQL/Database.cs +++ b/DirectSQL/Database.cs @@ -278,7 +278,7 @@ T transaction { return ExecuteNonQuery( sql, - new ValueTuple[0], + Array.Empty<(string, object)>(), connection, transaction ); @@ -298,7 +298,7 @@ C connection { return ExecuteNonQuery( sql, - new ValueTuple[0], + Array.Empty<(string, object)>(), connection ); } @@ -393,7 +393,7 @@ public static object ExecuteScalar( { return ExecuteScalar( sql, - new ValueTuple[0], + Array.Empty<(string, object)>(), connection, transaction ); @@ -412,7 +412,7 @@ public static object ExecuteScalar( { return ExecuteScalarCore( sql, - new P[0], + Array.Empty

(), connection, DefaultTransaction.defaultTransaction );