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 Insert::orReplace #115

Merged
merged 2 commits into from
Feb 19, 2017
Merged

add Insert::orReplace #115

merged 2 commits into from
Feb 19, 2017

Conversation

pavarnos
Copy link
Contributor

@pavarnos pavarnos commented Jan 1, 2017

originally added a useReplace() as suggested by #100, but then found sqlite has an orReplace() function and it will be very handy to have the same signature for both dbms when writing unit tests: can switch out mysql for sqlite and not have to add code to check which you are using.

$actual = $this->query->__toString();
$expect = sprintf($this->expected_sql_with_flag, '');
$expect = preg_replace('|INSERT |ms', 'REPLACE', $expect);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would have been good if you could write the raw query itself than using a preg_replace. What I mean is something as https://github.com/auraphp/Aura.SqlQuery/pull/115/files#diff-f685026c17cbf1227a63eb3b344b96a4R27 .

@pmjones pmjones mentioned this pull request Jan 24, 2017
@pmjones pmjones merged commit 97fb06c into auraphp:3.x Feb 19, 2017
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.

3 participants