fixes to allow update and delete to work

- ensure cursor is in the correct mode
- add db implementation