-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
58 lines (51 loc) · 2.06 KB
/
Justfile
File metadata and controls
58 lines (51 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
set shell := ["bash", "-euo", "pipefail", "-c"]
# Run pg_regress and then diff every expected output against results.
regress pg_version="pg18":
#!/usr/bin/env bash
set -euo pipefail
cd "{{justfile_directory()}}"
mkdir -p tests/pg_regress/results
cargo pgrx regress "{{pg_version}}" --resetdb
for expected in tests/pg_regress/expected/*.out; do
file="$(basename "$expected")"
result="tests/pg_regress/results/$file"
if [ -f "$result" ]; then
diff -u "$expected" "$result"
fi
done
test:
cd {{justfile_directory()}}
cargo test -v
# Profile cold/warm call latency.
# Example: just profile pg18
profile pg_version="pg18":
#!/usr/bin/env bash
set -euo pipefail
cd "{{justfile_directory()}}"
cargo pgrx start {{pg_version}}
cargo pgrx install --features "{{pg_version}}" --no-default-features --release
cargo pgrx connect {{pg_version}} < tests/profiling/setup_vs_exec.sql
# Profile a more realistic _pg.execute + JSON shaping workload.
# Example: just profile-pg-execute pg18
profile-pg-execute pg_version="pg18":
#!/usr/bin/env bash
set -euo pipefail
cd "{{justfile_directory()}}"
cargo pgrx start {{pg_version}}
cargo pgrx install --features "{{pg_version}}" --no-default-features --release
cargo pgrx connect {{pg_version}} < tests/profiling/pg_execute_workload.sql
# Start PostgREST against the local pgrx Postgres instance.
# Example: just postgrest
postgrest pg_version="pg18" api_port="3000" db_name="postgrest_demo":
cd "{{justfile_directory()}}"
./examples/postgrest/run.sh "{{pg_version}}" "{{api_port}}" "{{db_name}}"
# Set up the streaming demo and continuously print inserted rows plus trigger output.
# Example: just streaming
streaming pg_version="pg18" db_name="streaming_demo":
cd "{{justfile_directory()}}"
./examples/streaming/run.sh "{{pg_version}}" "{{db_name}}"
# Run the _pg.execute example that joins two tables, then queries a third.
# Example: just pg-execute
pg-execute pg_version="pg18" db_name="pg_execute_demo":
cd "{{justfile_directory()}}"
./examples/pg_execute/run.sh "{{pg_version}}" "{{db_name}}"