odpicr
Version, currently master branch1 version
- master branchlatestJan 12, 2024
github.com/xtokio/odpicr
ODPI-C wrapper
0 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
odpicr:
github: xtokio/odpicr
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
1.8.2- License
- MIT
- Author
- xtokio
Dependencies
Runtime Dependencies
- db*github: crystal-lang/crystal-db
README
odpicr
ODPI-C wrapper
Fork from crystal-odpi library.
Installation
ODPI-C (Linux)
# Install Unix ODBC
sudo apt install unixodbc-dev
# Install Libaio
sudo apt install libaio1
# Download latest release
https://github.com/oracle/odpi/releases
# Unzip file
tar -xvf v5.0.1.tar.gz
# Change to folder v5.0.1
cd v5.0.1
# Make and Install
sudo make
sudo make install
# Activate default path /usr/local/lib
ldconfig
-
Add the dependency to your
shard.yml:dependencies: db: github: crystal-lang/crystal-db odpicr: github: xtokio/odpicr -
Run
shards install
Usage
require "odpicr"
DB.open "odpi://user:password@host:port/SID" do |db|
db.exec "BEGIN EXECUTE IMMEDIATE 'drop table person'; EXCEPTION WHEN OTHERS THEN NULL; END;"
db.exec "create table person (name varchar(30), age int)"
db.exec "insert into person (name,age) values ('Paolino Paperino', 28)"
puts "max age:"
puts db.scalar "select max(age) from person"
puts "person:"
db.query "select name, age from person order by age desc" do |res|
puts "#{res.column_name(0)} (#{res.column_name(1)})"
res.each do
puts "#{res.read} (#{res.read})"
end
end
end
Contributing
- Fork it (https://github.com/xtokio/odpicr/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- xtokio - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Jan 12, 2024
- Crystal
1.8.2- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/xtokio/odpicr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 17, 2026
- Synced
- Aug 17, 2026
- Versions
- 1