Skip to content

OpenSystemsLab/rethinkdb.nim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RethinkDB driver for Nim

Installation

$ nimble install rethinkdb

Accessing ReQL

r

Initiate new RethinkDB Client

import rethinkdb
var r = newRethinkclient([address = "127.0.0.1",] [port = Port(28015),] [auth = "",] [db = ""])

connect

Create a connection to database server, using infomation from RethinkClient

r.connect()

repl

Set the default connection to make REPL use easier. Allows calling .run() on queries without specifying a connection.

r.repl()
#or
r.connect().repl()

close

Close an open connetion

r.close()

reconnect

Close and reopen a connection

r.reconnect()

use

Change the defalt database on this connection

r.use(db_name)

run

Run a query on a connection, returning a JsonNode.

var r = newRethinkclient()
r.connect().repl()
r.table("test").run()

Manipulating databases

  • dbCreate
  • dbDrop
  • dbList

Manipulating tables

  • tableCreate
  • tableDrop
  • tableList
  • indexCreate
  • indexDrop
  • indexList
  • indexRename
  • indexStatus
  • indexWait
  • changes

Writing data

  • insert
  • update
  • replace
  • delete
  • sync

Selecting data

  • db
  • table
  • get
  • getAll
  • between
  • filter