Skip to content

feat(ODBC): nix shells for mssql and oracle #5144#5145

Merged
aleks-f merged 12 commits intomainfrom
5144-nix-odbc
Jan 5, 2026
Merged

feat(ODBC): nix shells for mssql and oracle #5144#5145
aleks-f merged 12 commits intomainfrom
5144-nix-odbc

Conversation

@aleks-f
Copy link
Copy Markdown
Member

@aleks-f aleks-f commented Dec 28, 2025

Add Nix-based ODBC Test Environments for SQL Server and Oracle

Summary

This PR introduces self-contained Nix shell environments for building and running Poco ODBC tests against SQL Server and Oracle databases. These environments use rootless Podman to manage database containers, making them easy to use locally and in CI without requiring Docker or system-level database installations.

Changes

New Files

  • Data/ODBC/mssql.nix - Nix shell environment for SQL Server ODBC tests

    • Uses Microsoft ODBC Driver 18 (msodbcsql18) from nixpkgs
    • Automatically starts SQL Server 2022 Express via Podman
    • Configures ODBC DSN for the test suite
    • Provides helper commands: build_and_test, start_mssql, stop_mssql, remove_mssql, mssql_shell
  • Data/ODBC/oracle.nix - Nix shell environment for Oracle ODBC tests

    • Downloads Oracle Instant Client automatically (supports x86_64 and ARM64)
    • Starts Oracle Free 23.5 container via Podman
    • Creates test user and configures ODBC DSN
    • Provides helper commands: build_and_test, start_oracle, stop_oracle, remove_oracle, oracle_shell
  • Data/ODBC/.gitignore - Ignores local data directories (.nix-mssql-data/, .nix-oracle-data/)

CI Integration

Added two new CI jobs in .github/workflows/ci.yml:

  • nix-gcc-make-odbc-sqlserver - Runs SQL Server ODBC tests using the nix shell
  • nix-gcc-make-odbc-oracle - Runs Oracle ODBC tests using the nix shell

Both jobs use the retry-action with 3 attempts and 90-minute timeout.

Usage

Prerequisites (Debian/Ubuntu)

# Install Nix
sh <(curl -L https://nixos.org/nix/install) --daemon

# Install uidmap for rootless Podman
sudo apt-get install uidmap

Running Tests Locally

# SQL Server
nix-shell Data/ODBC/mssql.nix --pure
build_and_test

# Oracle
nix-shell Data/ODBC/oracle.nix --pure
build_and_test

Running Tests in CI

nix-shell Data/ODBC/mssql.nix --pure --run "build_and_test"
nix-shell Data/ODBC/oracle.nix --pure --run "build_and_test"

Features

  • Self-contained: All dependencies (compilers, ODBC drivers, database containers) are managed by Nix
  • Reproducible: --pure flag ensures no interference from host environment
  • Rootless: Uses Podman in rootless mode (no root/sudo required after initial setup)
  • Cross-platform: Both shells support x86_64 and ARM64 architectures
  • CI-ready: Exit codes propagate correctly for CI integration

Notes

  • First run downloads container images and may take several minutes
  • Oracle container is ~1.5GB and takes several minutes to start
  • SQL Server container requires accepting the EULA (done automatically)
  • The Microsoft ODBC driver is unfree software; the nix shell automatically allows it

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Oracle (oracle.nix):
- Add --shm-size=1g for Oracle container (requires 1GB shared memory)
- Add container state verification before exec commands
- Add proper error handling with container log output on failure
- Add pre-flight checks in build_and_test to verify container running
- Add Podman environment info for CI debugging
- Add progress indicators during Oracle startup wait
- Exit with error in CI mode if container fails to start

MSSQL (mssql.nix):
- Add ODBCINSTINI environment variable
- Add sync command to flush ODBC configs to disk
- Add odbcinst verification commands

Temporarily disable all ci except nix #5144
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 28 out of 28 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

aleks-f and others added 6 commits December 29, 2025 04:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@aleks-f aleks-f merged commit bd09152 into main Jan 5, 2026
94 checks passed
@aleks-f aleks-f deleted the 5144-nix-odbc branch January 5, 2026 04:14
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.

CMake not using cppignore Add nix shells for mssql and oracle ODBC

2 participants