pgRDF has no bytea surface at all. Every loader entry point takes a file
path or text; the only &[u8] in the tree is internal (sniff_is_ntriples,
parser scanning helpers). There is no way to hand the extension a document that
is already in the database or already in the client's hands without routing it
through a path or a text round-trip.
pgrx 0.19.0 added Bytea<'fcx> — a bytea argument type with zero-copy return.
Why this matters to #36
#36 (pgrdf.export_graph / import_graph — native portable dump+restore, proven
at 120M) is, at the SQL level, a bytea in/out surface. Implemented over text or
via a temp file it inherits a copy per call and an encoding round-trip; at the
scale #36 cites, that is the difference between a usable primitive and a
demonstration.
Bytea<'fcx> is the type that makes the natural signature the fast one.
Scope
- Evaluate
Bytea<'fcx> for the export/import signature.
- Consider a
load_turtle-family overload taking bytea, which would also serve
client-side upload paths that currently have to stage a file.
Why P2
#36 is P4 and unstarted. This is preparatory — it sharpens #36's design rather
than unblocking anything now.
Relates
Serves #36.
pgRDF has no
byteasurface at all. Every loader entry point takes a filepath or
text; the only&[u8]in the tree is internal (sniff_is_ntriples,parser scanning helpers). There is no way to hand the extension a document that
is already in the database or already in the client's hands without routing it
through a path or a text round-trip.
pgrx 0.19.0 added
Bytea<'fcx>— a bytea argument type with zero-copy return.Why this matters to #36
#36 (
pgrdf.export_graph/import_graph— native portable dump+restore, provenat 120M) is, at the SQL level, a bytea in/out surface. Implemented over
textorvia a temp file it inherits a copy per call and an encoding round-trip; at the
scale #36 cites, that is the difference between a usable primitive and a
demonstration.
Bytea<'fcx>is the type that makes the natural signature the fast one.Scope
Bytea<'fcx>for the export/import signature.load_turtle-family overload takingbytea, which would also serveclient-side upload paths that currently have to stage a file.
Why P2
#36 is P4 and unstarted. This is preparatory — it sharpens #36's design rather
than unblocking anything now.
Relates
Serves #36.