buildai-cli 0.3.74__tar.gz → 0.3.76__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/PKG-INFO +1 -1
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/commands/db/query.py +13 -4
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/commands/gigcamera.py +6 -2
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/pyproject.toml +1 -1
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/.gitignore +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/AGENTS.md +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/CLAUDE.md +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/buildai_bootstrap.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/__init__.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/_has_core.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/auth_local.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/commands/__init__.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/commands/api_proxy.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/commands/auth.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/commands/db/__init__.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/commands/db/broker.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/commands/db/common.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/commands/db/migrate.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/commands/db/schema.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/commands/db/status.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/commands/db/tunnel.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/commands/dev.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/commands/doctor.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/commands/processing.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/config.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/console.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/context.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/db_broker.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/guard.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/internal_api.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/main.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/nl_query/__init__.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/nl_query/dataset_tools.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/ops_init.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/output.py +0 -0
- {buildai_cli-0.3.74 → buildai_cli-0.3.76}/cli/pagination.py +0 -0
|
@@ -65,6 +65,8 @@ def _is_write_query(sql: str) -> bool:
|
|
|
65
65
|
return True
|
|
66
66
|
|
|
67
67
|
normalized = _normalize_sql(sql)
|
|
68
|
+
if normalized.startswith("WITH ") and re.search(r"\b(INSERT|UPDATE|DELETE)\b", normalized):
|
|
69
|
+
return True
|
|
68
70
|
for keyword in ("VACUUM", "REASSIGN"):
|
|
69
71
|
if normalized.startswith(keyword + " ") or normalized == keyword:
|
|
70
72
|
return True
|
|
@@ -98,14 +100,21 @@ def _is_ddl_query(sql: str) -> bool:
|
|
|
98
100
|
def _is_select_query(sql: str) -> bool:
|
|
99
101
|
"""Return whether the SQL is a row-returning query."""
|
|
100
102
|
|
|
103
|
+
import sqlparse
|
|
104
|
+
from sqlparse.tokens import DML
|
|
105
|
+
|
|
101
106
|
normalized = _normalize_sql(sql)
|
|
102
107
|
if normalized.startswith("SELECT "):
|
|
103
108
|
return True
|
|
104
109
|
if normalized.startswith("WITH "):
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
statements = sqlparse.parse(sql)
|
|
111
|
+
if statements:
|
|
112
|
+
for token in statements[0].tokens:
|
|
113
|
+
if token.is_whitespace:
|
|
114
|
+
continue
|
|
115
|
+
if token.ttype is DML:
|
|
116
|
+
return token.value.upper() == "SELECT"
|
|
117
|
+
return re.search(r"\b(INSERT|UPDATE|DELETE)\b", normalized) is None
|
|
109
118
|
return any(normalized.startswith(keyword) for keyword in ("SHOW ", "EXPLAIN ", "TABLE "))
|
|
110
119
|
|
|
111
120
|
|
|
@@ -198,14 +198,18 @@ def admin_analytics_read_model_refresh(
|
|
|
198
198
|
recent: bool = typer.Option(
|
|
199
199
|
False,
|
|
200
200
|
"--recent",
|
|
201
|
-
help="Refresh today plus the
|
|
201
|
+
help="Refresh today plus the active read-model freshness window instead of the full range.",
|
|
202
202
|
),
|
|
203
203
|
late_window_days: int = typer.Option(
|
|
204
204
|
3,
|
|
205
205
|
"--late-window-days",
|
|
206
206
|
min=0,
|
|
207
207
|
max=29,
|
|
208
|
-
help=
|
|
208
|
+
help=(
|
|
209
|
+
"Number of prior IST days refreshed with --recent. Scheduled warmers "
|
|
210
|
+
"pass 29 explicitly for the active 30-day key; ad-hoc operator runs "
|
|
211
|
+
"default to the smaller late-arrival window."
|
|
212
|
+
),
|
|
209
213
|
),
|
|
210
214
|
write: bool = typer.Option(False, "--write", help="Actually upsert read-model rows."),
|
|
211
215
|
format: Format = format_option(),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|