smallbets / userbase

Create secure and private web apps using only static JavaScript, HTML, and CSS.
https://userbase.com
MIT License
2.29k stars 125 forks source link

getItem database API? #431

Open mrbluecoat opened 3 months ago

mrbluecoat commented 3 months ago

Sorry if this is obvious, but https://userbase.com/docs/sdk/ shows API calls for insertItem, updateItem, and deleteItem. How do you get an item from the database (i.e. read a value)?

mrbluecoat commented 3 months ago

From the example, it appears you don't retrieve a single value from the database but rather openDatabase to retrieve all values as an array then use app logic to find the desired item within the array and use it. Example: https://github.com/smallbets/userbase-samples/blob/master/ugliest-todo-electron/index.html#L149

Seems a bit excessive for a database (since getting a single value is expected functionality), or am I missing something?