Skip to content

Release v0.1.0: Modular packages and connection pooling#342

Closed
jas88 wants to merge 29 commits into
HicServices:mainfrom
jas88:feature/thread-local-connection-pooling
Closed

Release v0.1.0: Modular packages and connection pooling#342
jas88 wants to merge 29 commits into
HicServices:mainfrom
jas88:feature/thread-local-connection-pooling

Conversation

@jas88

@jas88 jas88 commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

Summary

This PR prepares the first release (v0.1.0) under the new FAnsiSql package naming structure with modular packages and adds thread-local connection pooling.

Breaking Changes

  • Package Rename: All packages renamed from HIC.* to FAnsiSql.*
    • HIC.FAnsiSqlFAnsiSql.Legacy (transitional meta-package)
    • New modular packages: FAnsiSql.Core, FAnsiSql.MySql, FAnsiSql.MicrosoftSql, FAnsiSql.Oracle, FAnsiSql.PostgreSql
  • Repository Move: Project moved from HicServices/FAnsiSql to jas88/FAnsiSql
  • Removed old monolithic package structure - deleted legacy FAnsiSql/ directory

New Features

Thread-Local Connection Pooling

  • Eliminates ephemeral connection churn by maintaining one long-lived connection per thread per server
  • DiscoveredServer.ClearCurrentThreadConnectionPool() - Clear connections for current thread
  • DiscoveredServer.ClearAllConnectionPools() - Clear all pooled connections across all threads

Migration Support

  • FAnsiSql.Legacy meta-package references all 4 DBMS implementations for easy migration from HIC.FAnsiSql

Infrastructure Changes

  • Migrated to modular package structure with separate packages per DBMS
  • Updated to .NET 9.0
  • AOT Compatibility markers (IsAotCompatible=true)
    • ⚠️ Note: Oracle.ManagedDataAccess.Core is closed-source and has AOT limitations
    • ⚠️ Note: Microsoft.Data.SqlClient has some reflection-based operations that may require runtime code generation
  • Updated dependencies:
    • Microsoft.Data.SqlClient: 5.2.2 → 6.1.2
    • Npgsql: 8.0.5 → 9.0.4
    • Oracle.ManagedDataAccess.Core: 23.6.0 → 23.26.0
    • System.Linq.Async: 6.0.1 → 6.0.3

Fixes

Test Plan

  • All 6 packages build successfully
  • Packages correctly named (FAnsiSql.*)
  • Connection pooling test updated
  • CI tests pass (will verify after PR creation)

Release Notes

This will be tagged as v0.1.0 after merge.

jas88 and others added 29 commits July 23, 2025 13:45
* Fix Oracle driver exception inconsistency in TestKeywords_Invalid

Oracle's ManagedDataAccess driver throws OracleException instead of
ArgumentException when encountering invalid connection string keywords,
while other database drivers throw ArgumentException.

Updated the test to accept either exception type using Assert.Catch<Exception>
and Assert.Multiple with an Or constraint, making the test resilient to
driver-specific exception behavior.

This resolves CI test failure:
- Expected: ArgumentException
- Actual: OracleException (ORA-50008: 'FLIBBLE' is an invalid connection string attribute)

The test now verifies:
1. Either ArgumentException OR OracleException is thrown
2. The exception message contains the invalid keyword "FLIBBLE"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix resource namespace mismatch for embedded resources

Backport fix from PR #3: The auto-generated Designer files were looking
for resources with namespace "FAnsi.*" but the actual embedded resources
used namespace "FAnsi.Core.*", causing MissingManifestResourceException.

Fixed by updating ResourceManager initialization in both:
- FAnsiStrings.Designer.cs: "FAnsi.FAnsiStrings" → "FAnsi.Core.FAnsiStrings"
- SR.Designer.cs: "FAnsi.SR" → "FAnsi.Core.SR"

This resolves the OneTimeSetUp error:
"Could not find the resource 'FAnsi.FAnsiStrings.resources' among the
resources 'FAnsi.Core.FAnsiStrings.resources'"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
This fork is not a HIC project. Removed "HIC." prefix.

Other build error/warning fixes.
Bumps [dotnet-sdk](https://github.com/dotnet/sdk) from 9.0.200 to 9.0.306.
- [Release notes](https://github.com/dotnet/sdk/releases)
- [Commits](dotnet/sdk@v9.0.200...v9.0.306)

---
updated-dependencies:
- dependency-name: dotnet-sdk
  dependency-version: 9.0.306
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
---
updated-dependencies:
- dependency-name: Microsoft.Data.SqlClient
  dependency-version: 6.1.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: Microsoft.Data.SqlClient
  dependency-version: 6.1.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
---
updated-dependencies:
- dependency-name: Npgsql
  dependency-version: 9.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: Npgsql
  dependency-version: 9.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
---
updated-dependencies:
- dependency-name: NUnit
  dependency-version: 4.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
---
updated-dependencies:
- dependency-name: NUnit3TestAdapter
  dependency-version: 5.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
---
updated-dependencies:
- dependency-name: Oracle.ManagedDataAccess.Core
  dependency-version: 23.26.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: Oracle.ManagedDataAccess.Core
  dependency-version: 23.26.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
---
updated-dependencies:
- dependency-name: System.Linq.Async
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: System.Linq.Async
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@v3...v4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
---
updated-dependencies:
- dependency-name: NUnit.Analyzers
  dependency-version: 4.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 4 to 5.
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](actions/setup-dotnet@v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-dotnet
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
---
updated-dependencies:
- dependency-name: Microsoft.NET.Test.Sdk
  dependency-version: 18.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
---
updated-dependencies:
- dependency-name: System.Linq.Async
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
---
updated-dependencies:
- dependency-name: Npgsql
  dependency-version: 9.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
---
updated-dependencies:
- dependency-name: Microsoft.Data.SqlClient
  dependency-version: 6.1.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Addresses 8 CodeQL alerts for missing documentation summaries by adding
<summary> tags to methods that were using only <include> tags.

CodeQL requires explicit <summary> tags and doesn't recognize <include>
tags as documentation. This change adds brief summaries while preserving
the existing <include> tags for detailed documentation.

Files modified:
- FAnsi.Core/Discovery/IDiscoveredServerHelper.cs
- FAnsi.Core/Discovery/DiscoveredServerHelper.cs
- FAnsi.Core/Discovery/DiscoveredServer.cs
- FAnsi.Core/Discovery/DiscoveredTable.cs
- FAnsi.Core/Discovery/IDiscoveredTableHelper.cs

Resolves CodeQL alerts: #33-40

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Combined nested if statements in FAnsiExpressionVisitor.cs for cleaner logic flow
- Replaced if-else block with ternary operator in FAnsiQueryProvider.cs for more concise code

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
---
updated-dependencies:
- dependency-name: Oracle.ManagedDataAccess.Core
  dependency-version: 23.26.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
- MySQL: Replace legacy cross-join date generation with MySQL 8.0+ recursive CTEs
- MySQL: Optimize pivot implementation by combining GROUP_CONCAT calls
- MySQL: Remove 107 lines of dead commented code
- PostgreSQL: Implement BuildPivotOnlyAggregate and BuildPivotAndAxisAggregate using FILTER clause
- Oracle: Implement BuildPivotOnlyAggregate and BuildPivotAndAxisAggregate using CASE statements

This reduces MySQL complexity from 440 to 170 lines (61% reduction) and brings PostgreSQL and Oracle to feature parity with SQL Server for pivot operations.
#23)

* Fix MySQL SET SESSION conflicts in pivot with axis queries

Combine multiple SET SESSION statements into a single statement
at the top of queries that use both recursive CTEs and pivot.
Prevents 'You have an error in your SQL syntax' errors when
both cte_max_recursion_depth and group_concat_max_len need to be set.

Fixes Test_Calendar_WithPivot(MySql,True) failure.

* Complete fix: Add skipSessionSettings parameter to GetDateAxisTableDeclaration

* Complete MySQL aggregate fixes: recursion depth and SET SESSION

- Set cte_max_recursion_depth to 50000 (up from default 1000)
- Fix date generation termination to use <= instead of <
- Combine SET SESSION statements to avoid MySQL syntax errors
- Add skipSessionSettings parameter to avoid duplicate SET statements

Fixes Test_Calendar_Day, Test_Calendar_WithPivot and year overflow issues.

* Add null validation checks to fix nullable warnings

Replace implicit assumptions with explicit precondition checks that throw
InvalidOperationException when required properties are null. This provides
better error messages and fixes all nullable reference warnings in the file.

* Fix CTE syntax: SET SESSION must be separate statement

CTEs must be in the same statement as the SELECT that uses them.
Moved SET SESSION before the CTE+SELECT statement and removed
skipSessionSettings parameter since it's no longer needed.

* Fix NUnit analyzer warnings

- Make base test classes abstract (NUnit1034)
  - DatabaseTests
  - AggregationTests
- Fix Assert.That argument order (NUnit2007)
  - Swap actual and expected values in DatatypeComputerTests
  - Actual value should be first, expected value second

* Fix MySQL calendar aggregation and resolve all build warnings

- Fix SQL format string bug in BuildAxisAggregate causing syntax errors
  - Changed {4} AS "{4}" to dataset.{3} AS "{3}" to properly select count column
  - Fixes Test_Calendar_Day and Test_Calendar_Quarter failures
- Add null-forgiving operators to MySqlBulkCopy to fix CS8602/CS8604 warnings
- Suppress IL3050 AOT warnings in query providers with UnconditionalSuppressMessage
  - IQueryProvider inherently requires dynamic code for generic type creation

* Fix MySQL pivot with axis aggregation: combine CTEs correctly

MySQL doesn't allow multiple separate WITH statements. The dateAxis
and pivotValues CTEs must be combined into a single WITH clause with
comma-separated CTE definitions.

Fixes Test_Calendar_WithPivot failure.

* Fix CTE scope: put dateAxis CTE inside dynamic SQL

CTEs only exist within a single SQL statement. Moving dateAxis
CTE definition into the CONCAT'd dynamic SQL ensures it's in scope
when the SELECT references it in the PREPARE/EXECUTE statement.

Fixes: Table 'FAnsiTests.dateAxis' doesn't exist error

* Fix MySQL pivot column ordering with ROW_NUMBER

Pivot columns were appearing alphabetically instead of by aggregate
count descending. Added ROW_NUMBER() to preserve the count-based
ordering in GROUP_CONCAT operations.

Fixes: Test_Calendar_WithPivot(MySql,False) expecting T before E
Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 4 to 5.
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](actions/setup-dotnet@v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-dotnet
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Breaking Changes:
- Rename packages from HIC.* to FAnsiSql.* (modular structure)
- Repository moved from HicServices/FAnsiSql to jas88/FAnsiSql
- Removed monolithic FAnsiSql package, replaced with modular packages

New Features:
- Thread-local connection pooling to eliminate connection churn
- Added FAnsiSql.Legacy meta-package for easy migration

Infrastructure:
- Migrated to modular package structure (FAnsiSql.Core + DBMS-specific packages)
- Updated to .NET 9.0
- AOT compatibility markers (with Oracle/MSSQL caveats)
- Updated all dependencies to latest versions
@jas88

jas88 commented Oct 21, 2025

Copy link
Copy Markdown
Contributor Author

Wrong repository - closing

@jas88 jas88 closed this Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant