Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for IS NOT NULL #12

Merged
merged 3 commits into from
Dec 20, 2020
Merged

Conversation

yesdevnull
Copy link
Contributor

@yesdevnull yesdevnull commented Dec 3, 2020

Allows for correct 'value' != null comparisons in SQL.

I've tested this with MSSQL but the syntax for MySQL looks to be the same.

@Naktibalda
Copy link
Member

Please add tests for IS NULL and IS NOT NULL to https://github.com/Codeception/module-db/blob/master/tests/unit/Codeception/Lib/Driver/DbTest.php

src/Codeception/Lib/Driver/Db.php Outdated Show resolved Hide resolved
@yesdevnull
Copy link
Contributor Author

Requested changes and tests done, back to you @Naktibalda.

@Naktibalda
Copy link
Member

Thanks.

Would it be too much to ask you to document operators in Query Generation section?
https://github.com/Codeception/module-db/blob/master/src/Codeception/Module/Db.php#L198-L231

@yesdevnull
Copy link
Contributor Author

yesdevnull commented Dec 6, 2020

@Naktibalda documentation added. Let me know if you want it fleshed out further (or if you would like me to document the other operators.)

@Naktibalda
Copy link
Member

Thanks.

I looked at documentation page again and found that Supported operators are documented under seeInDatabase, dontSeeInDatabase and grabFromDatabase, but not under seeNumRecords and grabNumRecords.

Comparison expressions can be used as well:

<?php
$post = $I->grabFromDatabase('posts', ['num_comments >=' => 100]);
$user = $I->grabFromDatabase('users', ['email like' => 'miles%']);

Supported operators: <, >, >=, <=, !=, like.

I think that this section could be moved to Query Generation and a link to Query Generation should be added to docblock of each relevant method - Comparison expressions can be used as well.

What do you think?

Also Since version 2.1.9 is no longer relevant.

@Naktibalda Naktibalda merged commit 8c8076c into Codeception:master Dec 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants