Skip to content

Bytea<'fcx> zero-copy surface — the type #36 export_graph/import_graph wants #76

Description

@styk-tv

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2deferred / contingentcarveGraph-carve chain (C1-C6)enhancementImprovement to existing behaviour

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions