Skip to content

Commit 098db98

Browse files
committed
fix: update SQL queries for correct ordering and join conditions in documentation
- Changed order by clause from created_at to started_at in run-flow query - Improved indentation and formatting in step status and queued tasks queries - Corrected join conditions to ensure accurate step status and dependency retrievals - Enhanced readability and consistency across SQL snippets in documentation
1 parent 65ff3d7 commit 098db98

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

pkgs/website/src/content/docs/getting-started/run-flow.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ In the SQL Editor, run this query:
141141
```sql
142142
SELECT * FROM pgflow.runs
143143
WHERE flow_slug = 'greet_user'
144-
ORDER BY created_at DESC
144+
ORDER BY started_at DESC
145145
LIMIT 1;
146146
```
147147

pkgs/website/src/content/docs/how-to/monitor-flow-execution.mdx

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,15 @@ Run statuses include:
4343
To check the status of individual steps within a run:
4444

4545
```sql
46-
SELECT step_slug, status, remaining_deps, remaining_tasks, output
46+
47+
SELECT ss.step_slug, ss.status, ss.remaining_deps, ss.remaining_tasks, st.output
4748
FROM pgflow.step_states ss
48-
LEFT JOIN pgflow.step_tasks st ON ss.run_id = st.run_id AND ss.step_slug = st.step_slug AND st.status = 'completed'
49+
LEFT JOIN
50+
pgflow.step_tasks st
51+
ON
52+
ss.run_id = st.run_id
53+
AND ss.step_slug = st.step_slug
54+
AND st.status = 'completed'
4955
WHERE ss.run_id = 'your-run-id-here';
5056
```
5157

@@ -70,13 +76,13 @@ Step statuses include:
7076
To see all tasks that are currently queued for execution:
7177

7278
```sql
73-
SELECT
74-
run_id,
75-
step_slug,
76-
status,
77-
attempts_count,
78-
message_id,
79-
queued_at
79+
SELECT
80+
run_id,
81+
step_slug,
82+
status,
83+
attempts_count,
84+
message_id,
85+
queued_at
8086
FROM pgflow.step_tasks
8187
WHERE status = 'queued'
8288
ORDER BY queued_at ASC;
@@ -120,8 +126,8 @@ SELECT
120126
st.queued_at,
121127
st.failed_at
122128
FROM pgflow.step_states ss
123-
JOIN pgflow.step_tasks st ON
124-
ss.run_id = st.run_id AND
129+
JOIN pgflow.step_tasks st ON
130+
ss.run_id = st.run_id AND
125131
ss.step_slug = st.step_slug
126132
WHERE ss.run_id = 'your-run-id-here'
127133
AND ss.status = 'failed';
@@ -148,8 +154,8 @@ SELECT
148154
steps.step_slug,
149155
array_agg(deps.dep_slug) as dependencies
150156
FROM pgflow.steps steps
151-
LEFT JOIN pgflow.deps deps ON
152-
steps.flow_slug = deps.flow_slug AND
157+
LEFT JOIN pgflow.deps deps ON
158+
steps.flow_slug = deps.flow_slug AND
153159
steps.step_slug = deps.step_slug
154160
WHERE steps.flow_slug = 'your_flow_slug'
155161
GROUP BY steps.step_slug;

0 commit comments

Comments
 (0)