kikko-land / kikko

Powerful SQLite adapter for web, mobile and desktop. Build reactive UI on top of it
https://kikko-doc.netlify.app/
MIT License
134 stars 8 forks source link

Documentation on Error Handling #155

Open kdabir opened 1 year ago

kdabir commented 1 year ago

if this is a dumb question, please forgive my ignorance here :)

When using react hook useRunDbQuery, how to return SQL errors? let's say, UNIQUE constraints failure, like following

Error while executing query: INSERT INTO "products"(id, title, type) VALUES (?, ?, ?) - UNIQUE constraint failed: products.title

I see the error in console but not able to return it. I was expecting some pattern like following but don't see any clear guidance in docs.

{loading, error, data} = useRunDbQuery(...)
quolpr commented 1 year ago

@kdabir hmm, you are right. Will fix it