Repository navigation
fix: default targets to the only connection and infer source freshness settings - #973
Merged
Merged
Conversation
kvlonge
enabled auto-merge (squash)
October 6, 2026 12:25
kvlonge
disabled auto-merge
October 6, 2026 12:31
kvlonge
force-pushed
the
fix/config-default-connection
branch
from
October 6, 2026 13:44
fabc278 to
201c34c
Compare
kvlonge
enabled auto-merge (squash)
October 6, 2026 13:44
kvlonge
force-pushed
the
fix/config-default-connection
branch
2 times, most recently
from
October 7, 2026 07:26
5ea161b to
6283f91
Compare
A target without a connection silently used an empty inline connection, so DuckDB builds ran in memory and failed on a missing schema. When exactly one named connection is defined across the project and local files, and neither file has a top-level [connection] block, targets without a connection now use it. With several named connections, configuration loading rejects such targets. The docs also list default_target as optional.
Source freshness now implies its strategy from the keys set (column, query or neither for adapter) and takes the column strategy's type from the source's declared column type when it maps unambiguously. Explicit values keep working, and contradictions are rejected.
Commands that connect to the warehouse now stop with D001 before connecting when no connection is configured at all (no named connection, no top-level [connection] and no inline target connection), instead of silently using an empty connection that opened an in-memory DuckDB database. Compile, format, lineage, scope, rename and mv keep working without a connection, and an explicit database = ":memory:" still works. Test fixtures that relied on the empty fallback now configure an explicit connection.
`sqb test --inspect` only compiles and prints the test plan, but it resolved the connection eagerly and failed with D001 on projects without one; it now skips the connection requirement. Build validates target execution limits from the project adapter before resolving the connection, so limit errors no longer depend on a configured connection. `sqb freshness` resolves the connection only when sources are selected.
kvlonge
force-pushed
the
fix/config-default-connection
branch
from
October 7, 2026 08:03
6283f91 to
7779868
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A target without
connection =silently used an empty in-memory connection, so a build failed with "Schema dev does not exist", both when the project defined exactly one connection and when it defined none. Source freshness also required astrategyandtypethat the source already implies.Changes
[connection]block (acrosssqlbuild_project.tomlandsqlbuild_local.toml). With several named connections it fails at config load with D001, naming the target and the connections.database = ":memory:"still works. Tests that relied on the empty fallback now set a connection.strategyis inferred from the keys present (column,query, or neither for adapter), and the column strategy takestypefrom the declared column when it maps clearly. Contradictions and unmappable types are errors; explicit settings keep working.default_targetlisted as optional, the default-connection rule, and the freshness inference table.Verification
sqb debug, the D001 failures and inferred freshness.fensu checkandmake check-ci.