Initial SQLite development #1

Merged
danieljsummers merged 25 commits from develop into main 2024-06-08 23:58:45 +00:00
Showing only changes of commit bcca9f5ace - Show all commits

View File

@ -19,7 +19,7 @@ class Document
*/ */
public static function insert(string $tableName, array|object $document, ?PDO $pdo = null): void public static function insert(string $tableName, array|object $document, ?PDO $pdo = null): void
{ {
Custom::nonQuery(Query::insert($tableName), Parameters::json('@data', $document), $pdo); Custom::nonQuery(Query::insert($tableName), Parameters::json(':data', $document), $pdo);
} }
/** /**
@ -32,7 +32,7 @@ class Document
*/ */
public static function save(string $tableName, array|object $document, ?PDO $pdo = null): void public static function save(string $tableName, array|object $document, ?PDO $pdo = null): void
{ {
Custom::nonQuery(Query::save($tableName), Parameters::json('@data', $document), $pdo); Custom::nonQuery(Query::save($tableName), Parameters::json(':data', $document), $pdo);
} }
/** /**
@ -47,6 +47,6 @@ class Document
public static function update(string $tableName, mixed $docId, array|object $document, ?PDO $pdo = null): void public static function update(string $tableName, mixed $docId, array|object $document, ?PDO $pdo = null): void
{ {
Custom::nonQuery(Query::update($tableName), Custom::nonQuery(Query::update($tableName),
array_merge(Parameters::id($docId), Parameters::json('@data', $document)), $pdo); array_merge(Parameters::id($docId), Parameters::json(':data', $document)), $pdo);
} }
} }