Commit graph

21 commits

Author SHA1 Message Date
Yorhel
8140fefbca FU::Pg: Rename q() and Q() to sql() and SQL()
Because this easily confuses syntax highlighters and some humans with
the q// string syntax. Also for consistency with the 'fu->sql()'
aliases.

The old names are still available as alias.
2025-12-04 14:16:37 +01:00
Yorhel
a7868f74bf Pg: Be more strict with boolean bind parameters
Reason for this is that, with FU::SQL, it's possible to accidentally
introduce a bind parameter when a WHERE clause was intended (i.e.
"WHERE $1"). That's pretty bad, but can easily be caught by simply not
accepting *every* possible value as boolean.
2025-06-12 16:45:09 +02:00
Yorhel
76f55f277b Pg: Add text2bin() and bin2text() conversion methods 2025-04-30 20:02:20 +02:00
Yorhel
beeefcf337 Pg: Add perl2bin() and bin2perl() conversion methods 2025-04-30 17:07:44 +02:00
Yorhel
d0c5397e2d json_parse()/pgtypes: Fix accidental creation of read-only array/hash values
&PL_sv_* shouldn't be used when constructing arrays or hashes in this
context.
2025-04-28 10:23:51 +02:00
Yorhel
15954f4ad5 Pg: Add "$hex" pseudo-type 2025-02-28 13:49:07 +01:00
Yorhel
baf0f90bd5 Pg: Add "time" type, change default format of "date" type but support "$date_str"
Using a consistent numeric interpretation for timestamps, dates and
times simplifies a bunch of operations. It certainly simplifies
conversion between the Postgres formats.
2025-02-28 13:03:16 +01:00
Yorhel
de36b90cde Fixes for longdouble perl builds
Mostly test fixes, but the Pg 'timestamp' type did have a small
conversion bug.
2025-02-27 09:35:15 +01:00
Yorhel
c7a3415485 Util: Add to_bool() and use it for JSON, Pg & query encoding
To improve interop with legacy modules.
2025-02-25 09:33:33 +01:00
Yorhel
fbbaa23842 pg: Add date type & httpdate tests
...I was hoping not to have to implement the date type, because date
conversions suck, but it turns out manned.org actually needs it.
(Only to then convert it into a Unix timestamp again, hmm, maybe this
string conversion isn't useful at all?)
2025-02-24 11:54:37 +01:00
Yorhel
18e642290d Some fixes and framework docs 2025-02-23 14:05:43 +01:00
Yorhel
6f1583ddad pg: timestamp(tz) types + more docs 2025-02-21 12:58:24 +01:00
Yorhel
33fe0d98a8 pg: Module rename + more docs 2025-02-11 11:04:03 +01:00
Yorhel
7515032261 pgtypes: Support uuid and xid8 2025-02-10 11:41:22 +01:00
Yorhel
7076714296 pgtypes: Support cidr and inet 2025-02-10 10:54:25 +01:00
Yorhel
7d71e446d0 pg: Support array types
That wasn't quite as painful as I had anticipated. \o/
2025-02-09 17:20:48 +01:00
Yorhel
7b76d94719 pg: Add dynamic type loading & support enum types
Least efficient way to support enums, really. *shrug*
2025-02-08 17:24:52 +01:00
Yorhel
2aaec6a218 pg: Add json, jsonb, jsonpath support
NOW we're really getting to the part where this module is more awesome
than DBD::Pg.

(When I started working on this module I was expecting that the Postgres
binary protocol would send jsonb in a binary format as well and that I'd
be duplicating parts of the JSON parser/formatter to make that work, but
it turns out that Postgres just uses plain json for exchange. Saves me
some trouble, I guess)
2025-02-08 15:16:47 +01:00
Yorhel
7f1c48e0cf pg: Add send/recv support for a few more easy types 2025-02-08 14:03:35 +01:00
Yorhel
30b457d2b8 pg: Support binary bind params 2025-02-08 10:35:43 +01:00
Yorhel
8f94dd0921 pg: Initial support for receiving binary results
Just the initial framework stuff and a few types to test with.
2025-02-07 15:18:45 +01:00