Skip to content

Add support for IS NOT NULL - #12

Merged
Naktibalda merged 3 commits into
Codeception:masterfrom
iter8-au:master
Dec 20, 2020
Merged

Add support for IS NOT NULL#12
Naktibalda merged 3 commits into
Codeception:masterfrom
iter8-au:master

Conversation

@yesdevnull

@yesdevnull yesdevnull commented Dec 3, 2020

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member
Comment thread src/Codeception/Lib/Driver/Db.php Outdated
@yesdevnull

Copy link
Copy Markdown
Contributor Author

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

@Naktibalda

Copy link
Copy Markdown
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

yesdevnull commented Dec 6, 2020

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
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

2 participants