suketa / ruby-duckdb

Ruby binding for DuckDB
https://github.com/suketa/ruby-duckdb
MIT License
159 stars 24 forks source link

Request: Add link to docs in README #754

Open DeflateAwning opened 1 month ago

DeflateAwning commented 1 month ago

Are there any docs for this library? It would be awesome if there were.

The link to the docs should go in the README, whenever it is ready!

suketa commented 1 month ago

There are no doc pages for this library now.

DeflateAwning commented 1 month ago

Creating auto-generated docs would be fantastic! Not sure how tough that is in Ruby, but it'd be quite valuable to understand what parts of the DuckDB API have been implemented here

suketa commented 1 month ago

You can use ri command to see auto-generated docs. (Not enough documented yet...)

for example,

$ ri DuckDB::Database
= DuckDB::Database < Object

(from gem duckdb-1.1.0.0)
------------------------------------------------------------------------
The Database class encapsulates a DuckDB database.

The usage is as follows:

  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
------------------------------------------------------------------------
= Class methods:

  _db_open, open

= Instance methods:

  connect