Commit 0010797
feat(driver-sql,objectql): qualify cross-schema foreign keys with referencedSchema; refuse to wire the bare name (#11906)
* feat(driver-sql): qualify a cross-schema foreign key with referencedSchema (#11377)
IntrospectedForeignKey gains an optional referencedSchema, present when -
and only when - the referenced parent lives outside the session's own
resolution scope (PG: the parent's schema vs current_schemas(false);
MySQL: REFERENCED_TABLE_SCHEMA vs DATABASE(), null-safe). referencedTable
stays a bare name unconditionally. SQLite never sets the key - no schemas,
and a foreign key cannot cross an ATTACHed database.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rxnd8cyFnoU8V5y21PaTsy
* feat(objectql): refuse to wire a lookup to a foreign key carrying referencedSchema (#11377)
convertIntrospectedSchemaToObjects reads the driver's new qualification:
a foreign key whose target carries referencedSchema is loudly skipped and
flagged through options.logger (default console) - never wired to the
bare name - and the column converts as a plain field so the data stays
visible. Resolvable foreign keys keep wiring byte-identically.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rxnd8cyFnoU8V5y21PaTsy
* test(driver-sql): expect the #11377 qualification in #11324's cross-schema pins; add changeset
The #11324 fixture IS the cross-schema shape #11377 qualifies, so its two
cross-schema assertions now carry referencedSchema; presence/absence
semantics stay pinned in the #11377 file.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rxnd8cyFnoU8V5y21PaTsy
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent bb62d4d commit 0010797
6 files changed
Lines changed: 718 additions & 5 deletions
File tree
- .changeset
- packages
- drivers/driver-sql/src
- objectql/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
232 | 237 | | |
233 | 238 | | |
234 | 239 | | |
| |||
239 | 244 | | |
240 | 245 | | |
241 | 246 | | |
| 247 | + | |
242 | 248 | | |
243 | 249 | | |
244 | 250 | | |
| |||
256 | 262 | | |
257 | 263 | | |
258 | 264 | | |
| 265 | + | |
| 266 | + | |
259 | 267 | | |
260 | 268 | | |
261 | 269 | | |
| |||
0 commit comments