Skip to content

The Unsafe surface: rename, builders, executors, ORM proxy and transaction-bound shape #1144

Description

@borisno2

Parent

#1122 — build spec 2 of the Prisma 8 architecture spec. Lands on the prisma-8 integration branch, not main.

What to build

context.prisma is replaced by the Unsafe surface under a name stating the bypass: Prisma's sql and raw builders untouched, query(plan) returning Prisma's streaming result and execute(plan) returning statistics, both entering the unsafe origin (the streaming result through the scope-preserving wrapper), an orm lane that is a transparent proxy entering the unsafe origin on every call and re-proxying returned collections, no bare client, no prepare, no runtime, and a transaction-bound shape on the transaction context that closes over the client's raw lane and executes through tx.

Acceptance criteria

  • Under the tripwire in throw mode, the sixteen statement shapes the spike measured execute covered: single-statement reads and creates, two-statement update/delete, three-statement nested connect through the proxy, two terminals in one transaction, a DSL plan and a raw plan through the executors
  • A foreign query throws; a plan built inside a scope and run outside throws; a lazy result held across an await is covered
  • Interleaved engine, unsafe and foreign calls over a saturated pool see exactly their own origin
  • prepare and runtime are not reachable from the surface's type or runtime value
  • Errors from the surface are raw driver errors

Blocked by


Generated by Claude Code

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

    ready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions