func (db BerkeleyDB) NewCursor(txn Transaction, flags DbFlag) (*Cursor, error) {
	ret := new(Cursor)
	err := Err(C.db_cursor(db.ptr, txn.ptr, &ret.ptr, C.u_int32_t(flags)))
	if err != nil {
		return nil, err
	}
	return ret, ok
}
Beispiel #2
0
// Obtain a cursor over the database.
func (db Database) Cursor(txn Transaction) (cur Cursor, err error) {
	cur.db = db
	err = check(C.db_cursor(db.ptr, txn.ptr, &cur.ptr, 0))
	return
}