Skip to content
Ruby binding for DuckDB
Ruby C Shell
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
bin
ext/duckdb
lib
test
.gitignore
.travis.yml
CHANGELOG.md
Gemfile
Gemfile.lock
LICENSE
README.md
Rakefile
duckdb.gemspec

README.md

ruby-duckdb

Build Status

Description

ruby-duckdb is Ruby binding for DuckDB database engine

Requirement

You must have DuckDB engine installed in order to build/use this module.

How to Install

gem install duckdb

or you must specify the location of the include and lib files:

gem install duckdb -- --with-duckdb-include=/duckdb_include_directory --with-duckdb-lib=/duckdb_library_directory

Usage

require 'duckdb'

db = DuckDB::Database.open # database in memory
con = db.connect

con.query('CREATE TABLE users (id INTEGER, name VARCHAR(30))')

con.query("INSERT into users VALUES(1, 'Alice')")
con.query("INSERT into users VALUES(2, 'Bob')")
con.query("INSERT into users VALUES(3, 'Cathy')")

result = con.query('SELECT * from users')
result.each do |row|
  p row
end
You can’t perform that action at this time.