| 1 | # Shared CGO Packages |
| 2 | |
| 3 | The `pkg/` directory houses low-level building blocks that require CGO and are shared by multiple protocols/modules. |
| 4 | |
| 5 | Current packages: |
| 6 | |
| 7 | | Package | Description | |
| 8 | |---------|-------------| |
| 9 | | `dbdriver/` | Thin wrappers around IBM’s DB2 CLI driver (dynamic loading, environment setup). | |
| 10 | | `odbcbridge/` | Lightweight bridge that exposes ODBC handles to Go code with safe conversions. | |
| 11 | | `odbcwrapper/` | Higher-level helpers for executing queries and scanning results through the bridge. | |
| 12 | |
| 13 | These packages are intentionally small and focus on ABI boundaries. Business logic belongs in `protocols/` and `modules/`. |
| 14 | |
| 15 | When touching CGO code remember to: |
| 16 | |
| 17 | - Keep build tags accurate (`//go:build cgo`). |
| 18 | - Free allocated C resources even on error paths. |
| 19 | - Document any required compile-time flags or environment variables. |