Change param prefix from @ to :

This commit is contained in:
2024-06-04 20:59:24 -04:00
parent 7390ae0f61
commit 3d45bbcabc
13 changed files with 175 additions and 54 deletions

View File

@@ -20,7 +20,7 @@ class PatchTest extends TestCase
{
try {
Configuration::$mode = Mode::PgSQL;
$this->assertEquals("UPDATE doc_table SET data = data || @data WHERE data->>'id' = @id",
$this->assertEquals("UPDATE doc_table SET data = data || :data WHERE data->>'id' = :id",
Patch::byId('doc_table'), 'Patch UPDATE statement is not correct');
} finally {
Configuration::$mode = null;
@@ -32,7 +32,7 @@ class PatchTest extends TestCase
{
try {
Configuration::$mode = Mode::SQLite;
$this->assertEquals("UPDATE my_table SET data = json_patch(data, json(@data)) WHERE data->>'id' = @id",
$this->assertEquals("UPDATE my_table SET data = json_patch(data, json(:data)) WHERE data->>'id' = :id",
Patch::byId('my_table'), 'Patch UPDATE statement is not correct');
} finally {
Configuration::$mode = null;
@@ -52,8 +52,8 @@ class PatchTest extends TestCase
{
try {
Configuration::$mode = Mode::PgSQL;
$this->assertEquals("UPDATE that SET data = data || @data WHERE data->>'something' < @some",
Patch::byFields('that', [Field::LT('something', 17, '@some')]),
$this->assertEquals("UPDATE that SET data = data || :data WHERE data->>'something' < :some",
Patch::byFields('that', [Field::LT('something', 17, ':some')]),
'Patch UPDATE statement is not correct');
} finally {
Configuration::$mode = null;
@@ -66,8 +66,8 @@ class PatchTest extends TestCase
try {
Configuration::$mode = Mode::SQLite;
$this->assertEquals(
"UPDATE a_table SET data = json_patch(data, json(@data)) WHERE data->>'something' > @it",
Patch::byFields('a_table', [Field::GT('something', 17, '@it')]),
"UPDATE a_table SET data = json_patch(data, json(:data)) WHERE data->>'something' > :it",
Patch::byFields('a_table', [Field::GT('something', 17, ':it')]),
'Patch UPDATE statement is not correct');
} finally {
Configuration::$mode = null;