Skip to content

feat(sdk): add Context.withSchema schema-scoped contexts - #75

Merged
damusix merged 10 commits into
nextfrom
feat/sdk-with-schema
Aug 10, 2026
Merged

feat(sdk): add Context.withSchema schema-scoped contexts#75
damusix merged 10 commits into
nextfrom
feat/sdk-with-schema

Conversation

@damusix

Copy link
Copy Markdown
Collaborator

Summary

  • ctx.withSchema<SDB, SProcs, SFuncs, STvfs>(name) derives a schema-scoped Context sharing the parent's connection, pool, and lifecycle — the query builder, proc/func/tvf, transactions, and impersonation all resolve against the schema, with fresh generics typing the schema's slice. Re-deriving replaces rather than stacks; dotted routine names keep the caller's qualification; raw sql fragments stay untouched by design.
  • Proven live by a three-schema fixture per dialect (schemas on postgres/mssql, databases on mysql, ATTACHed databases on sqlite) with interleaved cross-context isolation assertions, plus compiled-SQL unit coverage.
  • Ships a @noormdev/sdk minor changeset and documentation across the SDK README, API reference, and dev guide.

What this solves

Multi-schema users had to hand-qualify every query and routine call; one missed call site silently targeted the default schema.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@damusix