question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

delete update insert return types?

See original GitHub issue

Hi, Im failing to find how to get the return types of the mutator functions. Generated functions always return Unit, and looking inside, driver.execute returns Unit

Is this possible?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

5reactions
AlecStrongcommented, Feb 2, 2019

yes, so it would look something like

insert:
INSERT INTO ...

rowid: SELECT last_insert_rowid();
myQueries.transaction {
  myQueries.insert(...)
  val id = myQueries.rowid()
}
2reactions
AlecStrongcommented, Feb 2, 2019

yea its normal for all the jdbc drivers so i think android adopted it. It’s non-default behavior for for at least some SQL engines and they end up doing the select changes() every time you do an update/delete. At least right now I’d rather have every query be explicit, and if something nicer makes more sense we can change later.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Return type for update, insert and/or delete #1482
To look up the number of rows affected by an update or delete: SELECT changes();. You can put these queries in ...
Read more >
SQL INSERT, SQL UPDATE, SQL DELETE – Oh My!
INSERT , UPDATE , and DELETE , as well as SELECT and MERGE, are known as Data Manipulation Language (DML) statements, which let...
Read more >
4. Inserting, Updating, Deleting - SQL Cookbook [Book]
Use a join between NEW_SAL and EMP to find and return the new COMM values to the UPDATE statement. It is quite common...
Read more >
what do @Insert, @Update, @Delete, or @Query do?
Return types. @Insert can return either nothing or a Long that represents the row id of where the item was inserted or -1...
Read more >
SQLite INSERT, UPDATE, DELETE Query with Example
The data modification clauses in SQLite are INSERT, UPDATE, and DELETE statements. It is used for inserting new rows, updating existing ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found