Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ceyhunkerti/oracle_tocsv
oracle query to csv fast extraction utility
https://github.com/ceyhunkerti/oracle_tocsv
csv extraction oci odpi-c oracle zig
Last synced: 27 days ago
JSON representation
oracle query to csv fast extraction utility
- Host: GitHub
- URL: https://github.com/ceyhunkerti/oracle_tocsv
- Owner: ceyhunkerti
- Created: 2024-12-15T13:37:48.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2025-01-01T18:46:21.000Z (29 days ago)
- Last Synced: 2025-01-01T19:35:58.352Z (29 days ago)
- Topics: csv, extraction, oci, odpi-c, oracle, zig
- Language: Zig
- Homepage:
- Size: 44.9 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Oracle to CSV Extraction Utility
- Extracts data from an oracle query and outputs to csv.
- ~3.7x faster than a plugin based JDBC implementation. (with same parameters.)## Build from source
You may need to setup instant client paths if you don't have it already.
- Download oracle instant client from [here](https://www.oracle.com/database/technologies/instant-client/downloads.html)
- Extract it to a path and set the `LD_LIBRARY_PATH`.
```sh
export LD_LIBRARY_PATH=/path/to/instantclient_[version]
```- Install [zig](https://ziglang.org).
- You may need to install `libaio` required by oracle client.
```sh
sudo apt install libaio1
```- todo: implement this in Makefile and remove Justfile.
- Download ODPI-C and place the extracted resources to `project-root/lib/odpi`- Build the binary.
```sh
zig build -Doptimize=ReleaseFast
```- See the binary `ox` at `zig-out/bin/`.
## Running
```sh
zig-out/bin/ox run \
# change below to actual connection string.
--connection-string "localhost:1521/ORCLCDB" \
--username oracle_username \
# optional (auth mode if you need SYSDBA)
--auth-mode SYSDBA \
--password oracle_password \
# You can use multi line strings see examples folder.
--sql "SELECT * FROM my_schema.my_table_name" \
# output-file can be an absolute path.
--output-file "output.csv" \
--fetch-size 10000
```# todo
- Documentation
- Add benchmark results