Add new termination method: exists() #438

Merged
merged 1 commit into from Aug 7, 2012

Conversation

Projects
None yet
3 participants
Owner

willdurand commented Aug 6, 2012

See #427

Owner

willdurand commented Aug 6, 2012

Ok, I tried to use EXISTS but I failed, and it seems not usable without using a subrequest. So, this way seems better because it does one fetch without hydration, etc.. Pretty fast.

This pull request passes (merged 669c33e6 into f9e3c77).

This pull request passes (merged ad903bce into f9e3c77).

Member

fzaninotto commented Aug 7, 2012

In that case, you'd better do a count and return count > 0. What happens when you test EXISTS ?

Owner

willdurand commented Aug 7, 2012

EXISTS is a clause keyword, so you have to write something like that:

SELECT * FROM table WHERE EXISTS (SELECT * FROM table WHERE title = '...')

This pull request passes (merged 754adbf into 363fce3).

Member

fzaninotto commented Aug 7, 2012

Can't you use the same logic than the one that wraps a query into a count
for Oracle?

2012/8/7 William Durand notifications@github.com

EXISTS is a clause keyword, so you have to write something like that:

SELECT * FROM table WHERE EXISTS (SELECT * FROM table WHERE title = '...')


Reply to this email directly or view it on GitHubhttps://github.com/propelorm/Propel/pull/438#issuecomment-7545803.

Owner

willdurand commented Aug 7, 2012

why?

2012/8/7 Francois Zaninotto notifications@github.com

Can't you use the same logic than the one that wraps a query into a count
for Oracle?

2012/8/7 William Durand notifications@github.com

EXISTS is a clause keyword, so you have to write something like that:

SELECT * FROM table WHERE EXISTS (SELECT * FROM table WHERE title =
'...')


Reply to this email directly or view it on GitHub<
https://github.com/propelorm/Propel/pull/438#issuecomment-7545803>.


Reply to this email directly or view it on GitHubhttps://github.com/propelorm/Propel/pull/438#issuecomment-7545929.

Member

fzaninotto commented Aug 7, 2012

To get a real SQL EXISTS query instead of a COUNT query. There ae probably performance implications, although not much important from my point of view.

@willdurand willdurand added a commit that referenced this pull request Aug 7, 2012

@willdurand willdurand Merge pull request #438 from willdurand/exists
Add new termination method: exists()
92d2677

@willdurand willdurand merged commit 92d2677 into propelorm:master Aug 7, 2012

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment