What
When a name-only ref() / resolve() / .dependencies() reference matches multiple actions in different schemas or databases, prefer the single candidate in the project's defaultDatabase / defaultSchema instead of failing with "Ambiguous Action name". If no single candidate matches the defaults, the ambiguity error is preserved (still listing all candidates).
Why
Ports the behavior requested upstream in dataform-co/dataform#2146: deploying the same set of views to multiple databases (e.g. staging and production) currently forces fully-qualified refs everywhere.
This scenario is arguably more common in sqlanvil than in BigQuery-land — in Postgres, the same action name in multiple schemas of one database (e.g. staging.users and public.users) is a routine layout.
Scope
Session.resolve() and dependency fully-qualification tie-break using project defaults, narrowing only on qualification levels the reference omitted (database first, then schema).
- CLI action filters (
matchPatterns) and the JIT runtime context are intentionally unchanged — they operate on selectors / already-qualified targets, not compile-time ref() resolution.
- Disambiguation is silent: the codebase has no compile-warning facility, only
compileError.
What
When a name-only
ref()/resolve()/.dependencies()reference matches multiple actions in different schemas or databases, prefer the single candidate in the project'sdefaultDatabase/defaultSchemainstead of failing with "Ambiguous Action name". If no single candidate matches the defaults, the ambiguity error is preserved (still listing all candidates).Why
Ports the behavior requested upstream in dataform-co/dataform#2146: deploying the same set of views to multiple databases (e.g. staging and production) currently forces fully-qualified refs everywhere.
This scenario is arguably more common in sqlanvil than in BigQuery-land — in Postgres, the same action name in multiple schemas of one database (e.g.
staging.usersandpublic.users) is a routine layout.Scope
Session.resolve()and dependency fully-qualification tie-break using project defaults, narrowing only on qualification levels the reference omitted (database first, then schema).matchPatterns) and the JIT runtime context are intentionally unchanged — they operate on selectors / already-qualified targets, not compile-timeref()resolution.compileError.