1
0
forked from Public/pics

15 Commits

Author SHA1 Message Date
d788391f4a Refactor fragile SQLite regex rewrites into driver-aware query methods
Move the ON DUPLICATE KEY UPDATE and UPDATE...AS alias SQL rewrites out
of Database::rewriteForSQLite() and into Tag::createNew() and
Tag::recount() as driver-aware branches via a new Database::getDriver()
method. This keeps dialect-specific SQL explicit at the call site rather
than buried in fragile regex transforms.

Also fix Tag::getAlbums() and Tag::getPeople() failing on SQLite when
id_parent is NULL by adding an IS NULL fallback for root-level queries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 15:40:46 +01:00
a71b8c9717 Add SQLite support as alternative database backend
Support config-driven choice between MySQL and SQLite via DB_DRIVER
constant, defaulting to MySQL for backward compatibility. All SQL
adaptation lives in Database.php (UDFs + query rewriting), so model
files need no changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

SQLite: remove FK constraints, revert 0→null sentinel changes

The SQLite schema had FOREIGN KEY constraints that don't exist in the
MySQL schema. These forced a cascade of 0→null changes to satisfy FK
enforcement. Removing them keeps the two backends behaviorally consistent
and minimises the diff. Real SQLite compat fixes (UDFs, query rewriting,
rowCount→count, Router fixes, EditAlbum guard) are preserved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 15:23:41 +01:00
8dbf1dce7b Database: start reworking the DBA to work with PDO 2025-05-13 20:51:43 +02:00
7faa59562d Database: address PHP 8.5 mysqli deprecation warning 2025-04-18 19:26:50 +02:00
fc9de822d8 Merge branch 'master' into password-reset 2025-03-02 15:00:34 +01:00
85ed6ba8d3 Replace deprecated trigger_error calls with exceptions 2025-02-13 11:38:45 +01:00
d6f39a3410 Database: patch error handling to account for exceptions thrown by mysqli_query 2024-08-27 11:46:18 +02:00
978d6461c5 Database: add fetch_object, queryObject, queryObjects methods 2023-06-12 12:49:22 +02:00
ed07668b2e Database: connect using utf8mb4 2023-04-08 14:54:55 +02:00
7897172256 Address dynamic class property deprecation warnings 2022-12-25 13:56:42 +01:00
49390c372d Use triple-equals in a few more places 2022-12-25 13:50:03 +01:00
b3808144ca Address deprecation notices for certain function signatures 2022-07-08 23:52:03 +02:00
c48ba786c1 Refactor leftover old-style arrays into new-style arrays. 2019-09-29 14:47:56 +02:00
e1df4678ac More helpful error messages for database errors. 2017-11-09 17:00:34 +01:00
ab0e4efbcb Initial commit.
This is to be the new HashRU website based on the Aaronweb.net/Kabuki CMS.
2017-11-09 17:00:22 +01:00