Skip to content

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

Closed
damusix wants to merge 10 commits into
masterfrom
feat/sdk-with-schema
Closed

feat(sdk): add Context.withSchema schema-scoped contexts#77
damusix wants to merge 10 commits into
masterfrom
feat/sdk-with-schema

Conversation

@damusix

@damusix damusix commented Aug 10, 2026

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.

Same change previously merged to next via #75; this is the rebase onto master.

What this solves

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

@damusix

damusix commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator Author

Redundant — this change reaches master via the v1.1.0 promotion PR #76.

@damusix damusix closed this Aug 10, 2026
@damusix
damusix deleted the feat/sdk-with-schema branch August 11, 2026 02:25
Sign up for free to 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