Commit graph

17 commits

Author SHA1 Message Date
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
867543267f Fixes for perl 5.36 with multiplicity + memleak in $st->kv methods
I always keep messing up the aTHX_ and pTHX_ stuff because my system
perl isn't built with multiplicity, and I still haven't found a
satisfactory way of finding SV leaks. Valgrind can't track those :(
2025-02-13 06:26:58 +01:00
Yorhel
87d99e412b pg: Add support for record/composite types
This is simply magical. \o/

Vendored in khashl.h. I wouldn't have used it if this were the only
place where I'd need a custom hash table, but it should come in handy
for other tasks as well, especially when I get to implementing an LRU
for prepared statement caching.

(Can all be done with Perl HV's, but they're less efficient and more
cumbersome for these tasks)
2025-02-11 16:04:10 +01:00
Yorhel
d95ff76d43 pg: Add support for domain types
+ refactor things a bit so that send & recv functions use the same
context struct, because the way they're setup is pretty much the same
for both. This also adds recursive type resolution for bind parameters.
2025-02-10 14:27:39 +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
b66610e25a pgtypes: Cleaner error reporting 2025-02-10 09:46:11 +01:00
Yorhel
d5f593387a Abstract and cleanup ugly byte swapping code
These macros don't assume alignment and may be somewhat inefficient with
all that copying. I'm hoping GCC is able to optimize that crap somewhat.

Also the pg type receive functions can not, in fact, assume that their
input buffers are properly aligned. That won't necessarily be the case
for array elements.
2025-02-10 07:35:34 +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
166744dd51 pg: Rework txn implementation + statement config API
I liked the Perl implementation of transactions, but managing state
between Perl and C is a bit cumbersome, so I've moved the whole thing
into C.

Also added a few statement configuration methods that currently don't do
anything yet.
2025-02-07 18:30:36 +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