PDOdb v1.3.8 — Raw WHERE segments + decimal input fix #8
Replies: 1 comment
-
Input normalization for German-style decimals (and dates next)I got tired of converting German-style input over and over again. In many of my projects the users (and forms) work with German formatting, Because this pattern keeps repeating and doesn’t add real value to do it
That way you can just pass user input as-is and let the DB layer prepare it What’s next? About whereRaw / orWhereRawI also added the requested whereRaw() / orWhereRaw() so you can inject your own Goal: less boilerplate in controllers/forms, more convenience in PDOdb, and I know some people will say “normalization doesn’t belong in the DB layer / The reason is simple: this is the only place where ALL input to the database Why it makes sense here: 1) It’s a localization problem, not a business rule. 2) The DB layer already knows the column types. 3) It stays non-breaking. 4) It reduces boilerplate in every project that uses this library. 5) It’s opt-in by detection. So yes, in a “pure” layered architecture you could say “localization stays in |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
PDOdb v1.3.8 — Raw WHERE segments + decimal input fix
This release delivers two things people kept asking for: truly flexible raw WHERE blocks for complex queries, and a reliable way to accept localized decimal input (e.g.
"12,20") without MySQL shouting about truncated data.Version 1.3.7 was skipped and not published because the initial decimal normalizer didn’t run on all code paths (notably
rawQuery()/CALL ...). This is fixed in 1.3.8.Added
whereRaw()andorWhereRaw()WHEREfragments, including grouped/nested AND/OR logic, function calls, and multi-column comparisons.?placeholders with a separate values array for proper PDO prepared binding, e.g.:get(),update(),delete(), etc.Automatic normalization of decimal-comma input
"12,20"or"1.234,50"are now converted to SQL-friendly dot-decimals before binding.CALL ...) as well, not just to inserts/updates where the column type is known.Changed
whereInt(),whereStr(), …) with raw segments and keeps the correct order.bindValue(), so MySQL/MariaDB numeric columns (DECIMAL,FLOAT,DOUBLE) no longer produceData truncated for column ...just because the client sent a comma.
Fixed
This discussion was created from the release PDOdb v1.3.8 — Raw WHERE segments + decimal input fix.
Beta Was this translation helpful? Give feedback.
All reactions