Skip to content

feat(c/db2): add initial connection-only Db2 driver#4286

Open
nishantchandraa wants to merge 1 commit intoapache:mainfrom
nishantchandraa:feature/db2-driver-connection-only-clean
Open

feat(c/db2): add initial connection-only Db2 driver#4286
nishantchandraa wants to merge 1 commit intoapache:mainfrom
nishantchandraa:feature/db2-driver-connection-only-clean

Conversation

@nishantchandraa
Copy link
Copy Markdown

Summary

This PR introduces an initial C/C++ ADBC driver for IBM Db2, intentionally scoped to connection management only so maintainers can review a small, focused baseline.

Included in this PR

  • New Db2 driver skeleton integrated into C/C++ build and packaging wiring
    • CMake option and subdirectory integration
    • Meson integration
    • Driver config and pkg-config metadata
  • DB2 database/connection lifecycle implementation
    • Database init/release (SQLHENV management)
    • Connection init/release (SQLHDBC allocation, connect, disconnect)
    • Default autocommit behavior on connection init
  • Connection option handling
    • uri support
    • per-field options: database, hostname, port, uid, pwd
    • standard username / password synonyms
    • explicit precedence: uri overrides conflicting per-field options
  • Connection-level validation/error behavior
    • malformed port rejected (1-65535 required)
    • empty UID/PWD rejected
    • SQLSTATE-to-ADBC status mapping for connection/auth failures
  • Minimal connection-focused tests and docs
    • lifecycle and concurrent-connection flow
    • missing/unknown option handling
    • invalid credentials handling
    • unreachable endpoint mapping
    • option precedence and validation behavior
    • DB2 driver docs + index inclusion

Explicitly out of scope

  • Statement execution
  • Result fetching/cursor handling
  • Metadata APIs (GetInfo, GetObjects, schemas/catalog)
  • Transaction APIs beyond default connection behavior
  • Bulk ingest and advanced type mapping
  • Performance optimizations

Validation

Tested against a live Db2 instance on localhost:50000:

  • adbc-driver-db2-test: 15/15 passed
  • ctest -L driver-db2: pass

Coverage includes:

  • database/connection init+release
  • autocommit default and concurrent connection flow
  • invalid credentials
  • malformed port
  • empty UID/PWD
  • unreachable host/port error mapping
  • uri precedence over per-field options

Notes for reviewers

This PR is intentionally narrow to establish a clean, reviewable baseline for DB2 support in ADBC. Follow-up PRs will add statement execution, metadata, transaction functionality, and broader feature parity incrementally.

Introduce the IBM DB2 C/C++ driver skeleton with connection lifecycle support, option parsing, and connection-level error handling to establish a small, reviewable baseline. Add focused connection-flow tests and minimal build/docs wiring while deferring execution and metadata APIs to follow-up work.
@nishantchandraa nishantchandraa marked this pull request as draft April 30, 2026 10:33
@nishantchandraa nishantchandraa marked this pull request as ready for review April 30, 2026 17:59
@nishantchandraa nishantchandraa marked this pull request as draft May 1, 2026 05:35
@nishantchandraa nishantchandraa marked this pull request as ready for review May 1, 2026 05:39
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