Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,8 @@ jobs:
needs: [changes, lockfile]
if: needs.changes.outputs.performance == 'true' && needs.changes.outputs.full == 'true'
runs-on: ubuntu-24.04
timeout-minutes: 45
# Two release builds: about 20 minutes on a warm cache, past 40 when Cargo.lock changed.
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
Expand Down
81 changes: 47 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 19 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ publish = false
rust-version = "1.88"

[workspace.dependencies]
# Reads the project env file with dotenv semantics; sqlx-postgres already depends on it.
dotenvy = "0.15.7"
argon2 = "0.5.3"
axum = { version = "0.8", default-features = false, features = ["http1", "json", "query", "tokio"] }
axum-server = { version = "0.8", default-features = false, features = ["tls-rustls-no-provider"] }
Expand Down Expand Up @@ -152,11 +154,15 @@ errno = "0.3"
windows-sys = { version = "0.61", default-features = false, features = ["Win32_System_Diagnostics_Debug"] }
# Recall's local store: SQLite compiled in, so every build has the same engine version.
rusqlite = { version = "0.37", features = ["bundled", "column_decltype"] }
rustix = { version = "1.1.4", default-features = false, features = ["fs", "process", "std", "stdio", "termios"] }
rustix = { version = "1.1.4", default-features = false, features = ["event", "fs", "process", "pty", "std", "stdio", "termios"] }
saphyr-parser = "0.1"
regex = "1"
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
serde = { version = "1", features = ["derive"] }
# Reports every field a decode ignores; a worker refuses a run request it can only partly read.
serde_ignored = "0.1"
# Names where a decode failed; with serde_ignored, a worker names any part of a run request it can't read.
serde_path_to_error = "0.1"
# Every crate relies on insertion-ordered JSON objects, which the extension has always built with.
serde_json = { version = "1", features = ["preserve_order"] }
sha2 = "0.10"
Expand Down Expand Up @@ -203,22 +209,22 @@ sqlbuild-scopes = { path = "crates/sqlbuild-scopes" }
sqlbuild-sqltext = { path = "crates/sqlbuild-sqltext" }
sqlbuild-state = { path = "crates/sqlbuild-state" }
# SQL lint Rules, quality Rules and the formatter.
sqlclean = { git = "https://github.com/sqlstack-io/sqlclean.git", rev = "bbc94e556dc51e936e86fa4c85111c87a7915fc5" }
sqlclean = { git = "https://github.com/sqlstack-io/sqlclean.git", rev = "b0728bb990b7d8ff196cb00cc20545f2fa4df555" }
# SQL change fingerprints over SQLQuack's tokenizers.
sqlquack-fingerprint = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "75d4c8486ab262a6c9c02a6c913334856367d890", features = ["bigquery", "databricks", "duckdb", "postgres", "snowflake", "sqlite", "sqlserver"] }
sqlquack-fingerprint = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "fe3d1caf5ed81981abf8abd1d00cc9d99462e6ed", features = ["bigquery", "databricks", "duckdb", "postgres", "snowflake", "sqlite", "sqlserver"] }
# Scopes, name resolution, types and lineage for the native analysis route.
sqlquack-semantics = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "75d4c8486ab262a6c9c02a6c913334856367d890", features = ["bigquery", "clickhouse", "databricks", "duckdb", "postgres", "snowflake", "sqlite", "sqlserver"] }
sqlquack-semantics = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "fe3d1caf5ed81981abf8abd1d00cc9d99462e6ed", features = ["bigquery", "clickhouse", "databricks", "duckdb", "postgres", "snowflake", "sqlite", "sqlserver"] }
# SQLQuack's Snowflake-family parser and tokenizer, reached as SQLQuack exposes them.
sqlquack-parse = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "75d4c8486ab262a6c9c02a6c913334856367d890" }
sqlquack-parse = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "fe3d1caf5ed81981abf8abd1d00cc9d99462e6ed" }
# SQLQuack's syntax tree and lossless tokens.
sqlquack-syntax = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "75d4c8486ab262a6c9c02a6c913334856367d890" }
sqlquack-syntax-bigquery = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "75d4c8486ab262a6c9c02a6c913334856367d890" }
sqlquack-syntax-clickhouse = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "75d4c8486ab262a6c9c02a6c913334856367d890" }
sqlquack-syntax-databricks = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "75d4c8486ab262a6c9c02a6c913334856367d890" }
sqlquack-syntax-duckdb = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "75d4c8486ab262a6c9c02a6c913334856367d890" }
sqlquack-syntax-postgres = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "75d4c8486ab262a6c9c02a6c913334856367d890" }
sqlquack-syntax-sqlite = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "75d4c8486ab262a6c9c02a6c913334856367d890" }
sqlquack-syntax-sqlserver = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "75d4c8486ab262a6c9c02a6c913334856367d890" }
sqlquack-syntax = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "fe3d1caf5ed81981abf8abd1d00cc9d99462e6ed" }
sqlquack-syntax-bigquery = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "fe3d1caf5ed81981abf8abd1d00cc9d99462e6ed" }
sqlquack-syntax-clickhouse = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "fe3d1caf5ed81981abf8abd1d00cc9d99462e6ed" }
sqlquack-syntax-databricks = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "fe3d1caf5ed81981abf8abd1d00cc9d99462e6ed" }
sqlquack-syntax-duckdb = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "fe3d1caf5ed81981abf8abd1d00cc9d99462e6ed" }
sqlquack-syntax-postgres = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "fe3d1caf5ed81981abf8abd1d00cc9d99462e6ed" }
sqlquack-syntax-sqlite = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "fe3d1caf5ed81981abf8abd1d00cc9d99462e6ed" }
sqlquack-syntax-sqlserver = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "fe3d1caf5ed81981abf8abd1d00cc9d99462e6ed" }
stacker = "0.1"
# Counts heap allocations in growth tests, which measure work instead of time.
stats_alloc = "0.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

from orchestration.sensors._orders_conditions import landed_after

from sqlbuild.orchestration import sensor
from sqlbuild.orchestration import RunRequest, sensor

on_orders_built = sensor(
"on_orders_built_sensor",

@sensor(
description="Refresh order totals after the totals model",
when=landed_after("order_totals"),
run="orders_folder_job",
)
def on_orders_built_sensor(ctx):
return RunRequest(job="orders_folder_job")
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
"""A condition whose select is not a string literal cannot be counted and is reported."""

from sqlbuild.orchestration import node_event, sensor
from sqlbuild.orchestration import RunRequest, node_event, sensor

ORDERS_SELECTION = "stg_orders"

on_orders_computed = sensor(
"on_orders_computed_sensor",

@sensor(
description="Refresh totals when staged orders change",
when=node_event(select=ORDERS_SELECTION, kinds=["success"]),
run="orders_folder_job",
)
def on_orders_computed_sensor(ctx):
return RunRequest(job="orders_folder_job")
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
"""Starts the repair job when any of four models fails: one over the limit, bound to a name."""

from sqlbuild.orchestration import node_event, sensor
from sqlbuild.orchestration import RunRequest, node_event, sensor

ORDERS_FAILED = node_event(
select="stg_orders stg_payments int_orders order_totals", kinds=["failure"]
)

on_orders_failure = sensor(
"on_orders_failure_sensor",

@sensor(
description="Repair orders after a failure",
when=ORDERS_FAILED,
run="orders_repair_job",
)
def on_orders_failure_sensor(ctx):
return RunRequest(job="orders_repair_job")
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

from orchestration.sensors._orders_conditions import ORDERS_LANDED

from sqlbuild.orchestration import sensor
from sqlbuild.orchestration import RunRequest, sensor

on_orders_landed = sensor(
"on_orders_landed_sensor",

@sensor(
description="Refresh order totals after orders land",
when=ORDERS_LANDED,
run="orders_folder_job",
)
def on_orders_landed_sensor(ctx):
return RunRequest(job="orders_folder_job")
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

from orchestration.sensors._orders_conditions import TICK_OVERDUE

from sqlbuild.orchestration import sensor
from sqlbuild.orchestration import RunRequest, sensor

on_tick_overdue = sensor(
"on_tick_overdue_sensor",

@sensor(
description="Repair orders after an overdue tick",
when=TICK_OVERDUE,
run="orders_repair_job",
)
def on_tick_overdue_sensor(ctx):
return RunRequest(job="orders_repair_job")
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"cancelled": "import signal\nfrom sqlbuild.checks import check\nfrom sqlbuild.refs import model\n@check(depends_on=model('orders'), description='Heartbeat cancellation interrupts the driver without SIGTERM.')\ndef orders_valid(ctx):\n signal.signal(signal.SIGTERM, signal.SIG_IGN)\n ctx.query('WITH RECURSIVE pending(i) AS ((SELECT i FROM range(10000000000) AS seed(i) LIMIT 1) UNION ALL SELECT i FROM pending) SELECT sum(i) FROM pending')\n return ctx.pass_()\n",
"on_failure_job": "name = \"annual_orders_job\"\ndescription = \"Build orders.\"\nselect = \"orders\"\nschedule = { cron = \"0 0 * * *\", timezone = \"UTC\", starts_at = \"2000-01-01T00:00:00Z\" }\n",
"on_failure_destination": "name = \"refresh_inventory_job\"\ndescription = \"Refresh inventory.\"\nselect = \"inventory\"\n",
"on_failure_sensor": "from sqlbuild.orchestration import NodeEventKind, node_event, sensor\n\nfailed_orders = sensor(\n 'failed_orders_sensor',\n description='React to an actual orders check failure.',\n when=node_event(select='check:orders_valid', kinds=[NodeEventKind.FAILED]),\n run='refresh_inventory_job',\n minimum_interval_seconds=1,\n)\n",
"on_failure_sensor": "from sqlbuild.orchestration import NodeEventKind, RunRequest, node_event, sensor\n\n\n@sensor(\n description='React to an actual orders check failure.',\n when=node_event(select='check:orders_valid', kinds=[NodeEventKind.FAILED]),\n minimum_interval_seconds=1,\n)\ndef failed_orders_sensor(ctx):\n return RunRequest(job='refresh_inventory_job')\n",
"on_check_event_sensor": "from sqlbuild.orchestration import CheckEvent, CheckEventKind, RunRequest, SensorContext, check_event, sensor\n\n\n@sensor(\n description='React to any failed check on orders.',\n when=check_event(select='orders', kinds=[CheckEventKind.FAILED]),\n minimum_interval_seconds=1,\n)\ndef failed_orders_sensor(ctx: SensorContext[CheckEvent]):\n assert ctx.event.check == 'check:orders_valid' and ctx.event.status == CheckEventKind.FAILED\n return RunRequest(job='refresh_inventory_job')\n",
"inventory": "MODEL (description 'Inventory after check failure.', materialized table);\nSELECT 59 AS amount;\n"
}
Loading
Loading