sqldelight icon indicating copy to clipboard operation
sqldelight copied to clipboard

Number of rows affected by the previous SQL statement - MySQL

Open nikolajakshic opened this issue 4 years ago • 1 comments

There is no support for the row_count() function in MySQL.

Quick question, Since I'm used to automatically get those numbers, is it going to be safe to run the [MySQL] SELECT row_count(); or [SQLite] SELECT changes(); after an insert/update/delete operation in a multi-threaded environment i.e. server-based applications?

nikolajakshic avatar May 22 '20 23:05 nikolajakshic

right...functions should probably be part of the dialect. Right now they're hardcoded into sqldelight so you can't run row_count() and if you run changes() it'll crash. I'll get a short term fix in to support that function in MySQL but I need to think of a better way to push dialect changes without a sqldelight update...stay tuned

AlecKazakova avatar May 23 '20 00:05 AlecKazakova