Add ExecuteType parameter for reliable RETURNING clause support#13
Add ExecuteType parameter for reliable RETURNING clause support#13
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
…ffectedRows Co-authored-by: jefim <1387820+jefim@users.noreply.github.com>
|
@copilot ok, the query parsing and asking if it contains a "returning" word seems like not a very reliable thing, e.g. if some table name also contains this word. would there be a better solution? |
Co-authored-by: jefim <1387820+jefim@users.noreply.github.com>
Co-authored-by: jefim <1387820+jefim@users.noreply.github.com>
Co-authored-by: jefim <1387820+jefim@users.noreply.github.com>
You're absolutely right. I've replaced the string parsing approach with a more robust solution:
This eliminates false matches from table names or other text containing "returning". Changes in commits: bd84334, 9421ca6, 8829925 Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot We need to fix these superlinter errors 2025-11-26 07:26:21 [INFO] Stderr contents for CSHARP:/github/workspace/Frends.PostgreSQL.ExecuteQuery/Frends.PostgreSQL.ExecuteQuery.Tests/ExecuteQueryTests.cs(130,94): error WHITESPACE: Fix whitespace formatting. Replace 20 characters with ' \s\s\s\s\s\s\s\s'. [/github/workspace/Frends.PostgreSQL.ExecuteQuery/Frends.PostgreSQL.ExecuteQuery.Tests/] \s\s\s\s\s\s\s\s'. [/github/workspace/Frends.PostgreSQL.ExecuteQuery/Frends.PostgreSQL.ExecuteQuery.Tests/] \s\s\s\s\s\s\s\s'. [/github/workspace/Frends.PostgreSQL.ExecuteQuery/Frends.PostgreSQL.ExecuteQuery.Tests/] \s\s\s\s\s\s\s\s'. [/github/workspace/Frends.PostgreSQL.ExecuteQuery/Frends.PostgreSQL.ExecuteQuery.Tests/] \s\s\s\s\s\s\s\s'. [/github/workspace/Frends.PostgreSQL.ExecuteQuery/Frends.PostgreSQL.ExecuteQuery.Tests/] \s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s'. [/github/workspace/Frends.PostgreSQL.ExecuteQuery/Frends.PostgreSQL.ExecuteQuery/] \s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s'. [/github/workspace/Frends.PostgreSQL.ExecuteQuery/Frends.PostgreSQL.ExecuteQuery/] |
Co-authored-by: jefim <1387820+jefim@users.noreply.github.com>
Fixed all whitespace formatting issues. Removed trailing whitespace from blank lines in both ExecuteQueryTests.cs and ExecuteQuery.cs. Changes in commit: 4f62ec1 Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot Ok, now this looks good. We neew to bump the major version number in csproj and add an entry for this task's users in CHANGELOG.md, stating what changes have been made. |
Co-authored-by: jefim <1387820+jefim@users.noreply.github.com>
Version bumped to 2.0.0 in csproj and CHANGELOG.md updated with detailed description of all changes including:
Changes in commit: 0568b7b Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Fix INSERT RETURNING clause support in PostgreSQL ExecuteQuery
Problem
INSERT statements with RETURNING clauses only return
AffectedRowsinstead of the actual returned column values.Solution
Added an explicit
ExecuteTypeparameter (similar to MicrosoftSQL task) that allows users to control how queries are executed:This approach is more reliable than string parsing and gives users explicit control.
Changes
ExecuteTypesenum with Auto, ExecuteReader, and NonQuery optionsExecuteTypeproperty to Input class with Auto as defaultTesting
All 8 tests pass:
Why This Solution is Better
Version
This release is version 2.0.0 with full documentation in CHANGELOG.md for users to understand the new features and improvements.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.