coocood/qbs

Faster Insert row

schmitch opened this issue · 1 comments

Currently I only read the docs and i read this:

If Id is set to a positive integer, Save would query the count of the row to find
out if the row already exists, if not then execute INSERT statement.
otherwise execute UPDATE.

This is not the best solution, since you need 3 queries to check if a row exists.
It would be way easier to just update the row. Check if the query was successfull or greater than zero and if not just insert the statement.

I will take a look at it this weekend, thank you for your feedback.