failed psql because i forgot the sort. RIP.

This commit is contained in:
bel
2022-10-20 08:53:08 -06:00
parent b5273549e0
commit 2321c171c2
4 changed files with 38 additions and 6 deletions

BIN
amex-2022-10-20/3_/db.db Normal file

Binary file not shown.

View File

@@ -1,3 +0,0 @@
module 3_
go 1.18

31
amex-2022-10-20/3_/mvp.sh Normal file
View 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 "$@"