Codeception / module-db

DB module for Codeception
MIT License
23 stars 24 forks source link

feat: mysql helper to grab entire rows #43

Closed JesusTheHun closed 1 year ago

JesusTheHun commented 1 year ago

This main purpose of this PR is to close #9 by adding two methods :

grabEntryFromDatabase($table, $criteria); // Fetch the first matching row
grabEntriesFromDatabase($table, $criteria); // Fetch all matching rows

I've joined some tests to cover their respective behaviour.

Also, I made two small changes :

  1. Changed the test of the existence of a key that triggered a warning, making tests fails. The logic has not been changed.
  2. Changed the call of loadDump() to pass the configuration, otherwise it would use the mysql.sock, which is not present when using a remote database (i.e: container).

If this PR goes through, I will port the modification to the branch 3.x.

JesusTheHun commented 1 year ago

@Naktibalda Thanks for your feedback. I've updated the branch according to your suggestions.

JesusTheHun commented 1 year ago

@Naktibalda Have you had a chance to review my work ?

Naktibalda commented 1 year ago

Sorry, I added these comments few days ago and forgot to submit them :)

JesusTheHun commented 1 year ago

I've resolved the points you brought up. Are you ready to merge & release ?

Naktibalda commented 1 year ago

Released as 2.1.0 and 3.1.0