Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrRecordNotFound for record not being found ErrRecordNotFound = errors.New("record not found") )
Functions ¶
This section is empty.
Types ¶
type Collection ¶
Collection represents a table in rethinkdb. Term should be set to r.Table("CollectionName") db will be set to the db that Collection was initialized with.
func (*Collection) Insert ¶
func (c *Collection) Insert(arg ...interface{}) ([]string, error)
Insert will insert from one to many records and will return their IDs.
func (*Collection) One ¶
func (c *Collection) One(i interface{}, id string) error
One return single record from the DB.
func (*Collection) Update ¶
func (c *Collection) Update(arg interface{}, id string) error
Update will update a single record.
type DB ¶
DB represents a connection to the DB and allows you to run queriedb.
func Connect ¶
func Connect(connectOpts r.ConnectOpts) (DB, error)
Connect establishes connection with rethinkDB
func NewDBFromSession ¶
NewDBFromSession returns a new DB from an existing gorethink session.
func (*DB) CreateTables ¶
CreateTables will create all tables in rethinkdb
func (*DB) NewCollection ¶
func (db *DB) NewCollection(name string) *Collection
NewCollection returns a new collection with the db set.
Click to show internal directories.
Click to hide internal directories.