Skip to content

Instantly share code, notes, and snippets.

@amotl
Created October 17, 2023 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amotl/05c7fa7a555f87a63dbd65a3de6ac74a to your computer and use it in GitHub Desktop.
Save amotl/05c7fa7a555f87a63dbd65a3de6ac74a to your computer and use it in GitHub Desktop.
DROP TABLE IF EXISTS "testdrive";
CREATE TABLE IF NOT EXISTS "testdrive" (
"id" TEXT NOT NULL,
"steps" OBJECT(STRICT) AS (
"transcribe" TEXT,
"parse" TEXT,
"load" TEXT
),
"timeline" OBJECT(STRICT) AS (
"transcribe" TIMESTAMP WITH TIME ZONE,
"parse" TIMESTAMP WITH TIME ZONE,
"load" TIMESTAMP WITH TIME ZONE
),
"transcription" OBJECT(STRICT) AS (
"uniqueId" TEXT,
"downloader" TEXT
),
"meetingId" TEXT,
"meetingDate" TIMESTAMP WITH TIME ZONE,
"publishedDate" TIMESTAMP WITH TIME ZONE,
"keywords" ARRAY(TEXT),
"links" ARRAY(OBJECT(STRICT) AS (
"url" TEXT
)),
"sourceType" TEXT,
"sourceUrl" TEXT,
"videoURLs" ARRAY(TEXT),
"title" TEXT,
"description" TEXT,
"agency" OBJECT(STRICT) AS (
"agencyId" BIGINT,
"name" TEXT,
"stateCode" TEXT
),
"documents" ARRAY(OBJECT(STRICT) AS (
"url" TEXT,
"requestURL" TEXT,
"type" TEXT,
"contentType" TEXT,
"contentLength" BIGINT,
"filename" TEXT
)),
"createdAt" TIMESTAMP WITH TIME ZONE,
"updatedAt" TIMESTAMP WITH TIME ZONE,
PRIMARY KEY ("id")
);
INSERT INTO "testdrive" ("meetingId","agency","createdAt","meetingDate","sourceType","sourceUrl","steps","title","updatedAt","videoURLs","timeline","transcription","id") VALUES (
'swagit-coronadousdca-10102023-517',
{
"agencyId" = 72611,
"name" = 'Coronado Unified School District',
"stateCode" = 'CA'
},
'2023-10-10T20:26:19.172Z',
'2023-10-05T12:00:00.000Z',
'swagit',
'http://coronadousdca.swagit.com/specialty',
{ "load" = 'complete', "parse" = 'incomplete', "transcribe" = 'complete' },
'KCMS 10-5 Broadcast',
'2023-10-10T21:20:53.694Z',
[
'https://admin-v2.swagit.com/podcasts/2023/10/10/10102023-518.360.mp4',
'https://stream.us-central1-b.swagit.com/vod/_definst_/admin-v2/2023/10/10/10102023-518.360.mp4/playlist.m3u8'
],
{
"transcribe" = '2023-10-10T21:10:00.642Z',
"load" = '2023-10-10T21:20:53.694Z'
},
{ "uniqueId" = '6525b448c484e452fe48df08' },
'6525b36b3d9cfcf8ec8f732b'
)
ON CONFLICT (id) DO UPDATE SET
"updatedAt" = '2023-10-10T20:30:00.748Z',
"timeline" = { "transcribe" = '2023-10-10T20:30:00.748Z' },
"transcription" = { "uniqueId" = '6525b448c484e452fe48df08' },
"steps"['transcribe'] = 'pending';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment