Skip to content

@cipherstash/stack/wasm-inline does not export the EQL v3 schema surface #614

Description

@coderdan

Summary

@cipherstash/stack/wasm-inline re-exports the v2 schema builders and nothing from eql/v3:

// packages/stack/src/wasm-inline.ts:102-106
export {
  encryptedColumn,
  encryptedField,
  encryptedTable,
} from '@/schema'

There is no re-export of types or encryptedTable from @/eql/v3, and grep -c "eql/v3" packages/stack/src/wasm-inline.ts returns 0.

So on the Edge / WASM runtimes — Supabase Edge Functions, Cloudflare Workers, Deno — a user can only declare v2 schemas, even though the database is on EQL v3 and every other entry point offers the v3 surface (./eql/v3, ./eql/v3/drizzle, ./supabase).

Expected

wasm-inline re-exports the v3 schema surface alongside the v2 one, so an Edge Function can declare a v3 table:

import { Encryption, AccessKeyStrategy } from "@cipherstash/stack/wasm-inline"
import { encryptedTable, types } from "@cipherstash/stack/wasm-inline"  // ← v3 types, currently unavailable

const patients = encryptedTable("patients", {
  email: types.TextSearch("email"),
})

The names collide (encryptedTable exists in both @/schema and @/eql/v3), so this needs a decision on the export shape — a v3 namespace object, a separate ./wasm-inline/v3 entry, or making wasm-inline re-export ./eql/v3 under distinct names.

Why it matters

The whole point of the wasm-inline entry is that the same encrypt/decrypt code runs in Deno with no native bindings. If it only reaches the v2 schema builders, the Edge story is stuck a generation behind the rest of the SDK, and an Edge Function cannot write to the public.eql_v3_* columns that encryptedSupabaseV3 reads.

Related

encryptedSupabaseV3 itself is not available on the edge build either, since ./supabase is a separate entry that pulls in the Node introspection path (pg). Worth deciding whether that is in scope here or a separate issue — introspection needs a direct Postgres connection, which an Edge Function may not have.

Impact on docs

/integrations/supabase/edge-functions documents the core Encryption client with v2 schema builders, which is currently the only thing that works there. It carried a callout saying wrapper support on the edge was "being confirmed"; that has been removed, but the page remains a generation behind the rest of the Supabase section until this is resolved.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions