failed psql because i forgot the sort. RIP.
This commit is contained in:
31
amex-2022-10-20/3_/mvp.sh
Normal file
31
amex-2022-10-20/3_/mvp.sh
Normal file
@@ -0,0 +1,31 @@
|
||||
#! /bin/bash
|
||||
|
||||
main() {
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
local bin=../0_setup/0_setup
|
||||
local cmds=(
|
||||
'DROP TABLE IF EXISTS events'
|
||||
'
|
||||
CREATE TABLE events (
|
||||
sensor_id integer not null,
|
||||
event_type integer not null
|
||||
);
|
||||
'
|
||||
'INSERT INTO events VALUES (2, 2)'
|
||||
'INSERT INTO events VALUES (2, 4)'
|
||||
'INSERT INTO events VALUES (2, 2)'
|
||||
'INSERT INTO events VALUES (3, 2)'
|
||||
'INSERT INTO events VALUES (2, 3)'
|
||||
"$@"
|
||||
)
|
||||
|
||||
for cmd in "${cmds[@]}"; do
|
||||
echo =================
|
||||
$bin -q "$cmd"
|
||||
echo
|
||||
done
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user