Add exists() method on Query to check assert the existence of a query
See original GitHub issueSuggested Enhancement:
Adding an exists()
method on Query
would allow to efficiently check the existence of a row or group of rows.
Would be the SQL equivalent of SELECT EXISTS(SELECT 1 FROM table WHERE ...)
Exemple:
FooTable.select { FooTable.id eq 5 }.exists()
would be converted to:
SELECT EXISTS(SELECT 1 FROM FooTable WHERE id = 5)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
The best way to write a Spring Data Exists Query
There are better ways to write a Spring Data Exists Query. Checking existence with an existsBy query method. Spring Data offers an existsBy ......
Read more >Django check for any exists for a query - python - Stack Overflow
Django provides a method called exists() to check if results exists for our query. exists() method return 'True' or 'False' Class Company(models.
Read more >The Exists Query in Spring Data - Baeldung
The existsById query is the easiest, but least flexible way of checking for an object's existence. 4. Using a Derived Query Method.
Read more >Introduction to Cypress
Important! This is the single most important guide for understanding how to test with Cypress. Read it. Understand it. Ask questions about it...
Read more >HTTP Tests - Laravel - The PHP Framework For Web Artisans
The get method makes a GET request into the application, while the assertStatus ... that you did not make assertions against exist on...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It looks quite complex to use. Why don’t to add something like:
val result: Boolean = FooTable.exists { FooTable.id eq 5 }
For example
Yes, the “FROM” part will be skiped for PSQL for Table.Dual.