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

@@ -24,8 +24,8 @@ class Patch
public static function update(string $tableName, string $whereClause): string
{
$setValue = match (Configuration::$mode) {
Mode::PgSQL => 'data || @data',
Mode::SQLite => 'json_patch(data, json(@data))',
Mode::PgSQL => 'data || :data',
Mode::SQLite => 'json_patch(data, json(:data))',
default => throw new DocumentException('Database mode not set; cannot make patch statement')
};
return "UPDATE $tableName SET data = $setValue WHERE $whereClause";