commit: 2024-10-21 15:43:36

This commit is contained in:
Paul Trowbridge 2024-10-21 15:43:36 -04:00
parent a100a06ec2
commit d3b1442afc
3 changed files with 38 additions and 4 deletions

2
build_new.sh Normal file
View File

@ -0,0 +1,2 @@
$PG -t -A -f dump_new.pg.sql >> /mnt/c/Users/ptrowbridge/hc_notes/transcribe.md

View File

@ -5,6 +5,7 @@ ext AS (
-- t.filename -- t.filename
(t.mdate - ((EXTRACT(DOW FROM t.mdate) - 5 + 7) % 7) * INTERVAL '1 day')::date AS week_ending (t.mdate - ((EXTRACT(DOW FROM t.mdate) - 5 + 7) % 7) * INTERVAL '1 day')::date AS week_ending
,t.mdate ,t.mdate
,message->>'rep' rep
,message->>'text' markdown ,message->>'text' markdown
,to_char(row_number() OVER (partition by (t.mdate - ((EXTRACT(DOW FROM t.mdate) - 5 + 7) % 7) * INTERVAL '1 day')::date),'FM000') seq ,to_char(row_number() OVER (partition by (t.mdate - ((EXTRACT(DOW FROM t.mdate) - 5 + 7) % 7) * INTERVAL '1 day')::date),'FM000') seq
FROM FROM
@ -45,13 +46,14 @@ ext AS (
,w.seq || '.' || e.seq || '.' || r.flag seq ,w.seq || '.' || e.seq || '.' || r.flag seq
,CASE r.flag ,CASE r.flag
WHEN 'A' THEN '## [[]]' WHEN 'A' THEN '## [[]]'
WHEN 'B' THEN e.markdown WHEN 'B' THEN ''
WHEN 'C' THEN '' WHEN 'C' THEN e.markdown
WHEN 'D' THEN ''
END markdown END markdown
-- ,r.flag -- ,r.flag
FROM FROM
ext e ext e
CROSS JOIN (VALUES ('A'),('B'),('C')) r (flag) CROSS JOIN (VALUES ('A'),('B'),('C'),('D')) r (flag)
INNER JOIN wk w ON INNER JOIN wk w ON
w.week_ending = e.week_ending w.week_ending = e.week_ending
) )
@ -70,4 +72,5 @@ ext AS (
FROM FROM
wkh wkh
) )
SELECT * FROM stack order by seq limit 1000 -- SELECT markdown FROM stack order by seq
select * from ext

29
map.pg.sql Normal file
View File

@ -0,0 +1,29 @@
SELECT
t.filename
,substring(message->>'text',1,50)
,message
FROM
rlarp.thirtysec t
WHERE
--substring(message->>'text',1,100) ~ 'Tony Land'
message->>'rep' IS NULL
ORDER BY filename desc
SELECT
t.filename
,substring(message->>'text',1,50)
FROM
rlarp.thirtysec t
WHERE
substring(message->>'text',1,100) ~ 'Maxwell'
AND message->>'rep' IS NULL
ORDER BY filename desc
UPDATE
rlarp.thirtysec t
SET
message = message || '{"rep":"Colin Maxwell"}'::jsonb
WHERE
substring(message->>'text',1,50) ~ 'Maxwell'
AND message->>'rep' IS NULL