Comments (3)
🗞️ This is related to issue #4578
Where the rows affected is not exposed(intentionally) from the driver (jdbc) implementation - so only Unit
is returned.
The changes
function is built into Sqlite, so won't work for other databases
As you mentioned, Postgresql can't use Returning
with an aggregate function e.g RETURNING COUNT(*)
For SqlDelight, you can use a CTE like this for your query
delete:
WITH deleted_rows AS (
DELETE FROM MyTable RETURNING *
)
SELECT COUNT(*) FROM deleted_rows;
Generates a query that returns the rows deleted
val count = sample.testQueries.delete().executeAsOne()
from sqldelight.
this did not work for me, it does not successfully delete
from sqldelight.
🤔 I am not sure why that doesn't work
However, I can only provide a fully working Postgresql example https://github.com/griffio/sqldelight-postgres-example
See if that helps to solve issue
from sqldelight.
Related Issues (20)
- Cannot convert the provided notation to an object of type Dependency HOT 1
- Table not created on desktop without awaiting the result of Schema.create HOT 3
- java.lang.IllegalStateException in SqliteParserUtil.kt:114
- Unable to run `ALTER TABLE <> DROP CONSTRAINT <> RESTRICT;` when using postgresql HOT 2
- AndroidSqliteDriver fails to create single Table when not In-memory
- java.util.NoSuchElementException in UpsertClauseMixin.kt:47
- Keywords as column name - generated code missing double quotes for INSERT statement HOT 6
- java.lang.RuntimeException in SqlDelightFileViewProviderFactory.kt:76
- java.lang.Throwable in SqlDelightFileViewProviderFactory.kt:91
- Kotlin Multiplatform build fails on macOS HOT 4
- Changes in the database are not observed when using a context other than Dispatchers.Main
- K2 Support HOT 1
- not able to create .sq file in kotlin multiplatfrom project
- Cannot use a simple migration statement HOT 3
- SQLDelight Plugin does not work with Android Studio Koala HOT 2
- verify DB migration failure on windows for KMP project HOT 1
- R2dbcPreparedStatement parameters are incorrectly generated when tuple object substitution is used HOT 1
- java.lang.RuntimeException in SqlDelightGotoDeclarationHandler.kt:124
- Enable creation of a database interface with dependencies only, no .sq files
- Queries impacted by a trigger don't reemit
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqldelight.