// NewCursor ... func (db *Database) NewCursor() (cursor *Cursor, err error) { cursor = &Cursor{parent: db} res := C.unqlite_kv_cursor_init(db.handle, &cursor.handle) if res != C.UNQLITE_OK { err = UnQLiteError(res) } runtime.SetFinalizer(cursor, (*Cursor).Close) return }
func (u *Unqlite) NewCursor() (*Cursor, error) { var cur Cursor e := C.unqlite_kv_cursor_init(u.db, &(cur.c)) return &cur, code2Error(e) }