Skip to content

Conversation

@dpDesignz
Copy link
Contributor

Fixes #174
Removed check for $columnFields being empty, and added dots between table and column names in query builder

@codecov-io
Copy link

codecov-io commented Oct 27, 2019

Codecov Report

Merging #175 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@ Coverage Diff @@ ## master #175 +/- ## ========================================= Coverage 83.56% 83.56% - Complexity 788 793 +5  ========================================= Files 14 14 Lines 2002 2002 ========================================= Hits 1673 1673 Misses 329 329
Impacted Files Coverage Δ Complexity Δ
lib/Database.php 78.57% <100%> (ø) 17 <13> (+5) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e73a3de...52af9bd. Read the comment docs.

Added the ability to set a $tableAs for joins if the left table is the same as the right table. Will default to the right table name if not set.
@dpDesignz
Copy link
Contributor Author

@techno-express I've made some more adjustments to the joins to allow more flexibility. For some reason there are conflicts identified by GitHub which aren't in my original code though? Not sure if they're actually an issue or not.

Fixed issue where the right table in $onCondition needed to match $tableAs if it was set.
@TheTechsTech
Copy link
Contributor

You might want to do an local merge/update off master. I made some psr-2 fixes, commits, that is the reason for the conflicts.

Also, take a look at how some of the phpunit tests i have for help on constructing/creating your test.

@dpDesignz
Copy link
Contributor Author

Oh, that didn't show up in my sync for some reason. Will try and update my local version (still trying to work out how to do this properly. I use GitHub Desktop.) and then take a look at the changes again :)

Updated the examples for the different joins to reflect the new `$tableAs` variable in the functions
Missed a new line on the last commit. Also missed a param in the joining query description and some psr-2 changes. Also found an issue with $condition being used in $onCondition not being consistent.
@dpDesignz
Copy link
Contributor Author

@techno-express sorry for all the commits. Just getting my head around using the new GitHub desktop interface and my VS-Code config. Finally got it all sorted and fixed all the conflicts as well as some more small bugs I found. 😄

All ready for merge.

Changed $condition back to `=` in first and last $onCondition as wasn't meant to be changed.
@TheTechsTech
Copy link
Contributor

Where is the test?

Can't really merge until then, someone else might come along raising some issue related to JOINS not working, or whatever. As with others submitting issues, i eventually point them to the tests showing not an issue with library cause the phpunit tests covers that.

There is no proof showing it works.

@dpDesignz
Copy link
Contributor Author

Sorry, I haven't had a chance to look at how phpunit works and I don't have the time to learn it at this stage. Will just have to leave this for now.

@TheTechsTech
Copy link
Contributor

Ok, when you are ready, it's really not that much to learn.

You would just add a method to https://github.com/ezSQL/ezsql/blob/master/tests/mysqli/mysqliTest.php
prefixing test to it's name. The actually code would look similar to whatever you have written before.

The phpunit just have many methods to compare what you expect, to what the actually result was, like:
$this->assertEquals($somethingShouldBe, $actaulDatabaseResult); // this is the actually test.

Look at

public function testSelecting()

You would be doing the same example test, but with two tables.

Update ezSQL for new fixes
@dpDesignz dpDesignz closed this Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants