Skip to content

Instantly share code, notes, and snippets.

@amotl
Created October 17, 2023 17:54
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/31701b4d4162090e9815f4c209b57cb9 to your computer and use it in GitHub Desktop.
Save amotl/31701b4d4162090e9815f4c209b57cb9 to your computer and use it in GitHub Desktop.
from crate.client import connect
def main():
conn = connect("localhost:4200")
cursor = conn.cursor()
sql = """
INSERT INTO "testdrive" ("meetingId","agency","createdAt","meetingDate","sourceType","sourceUrl","steps","title","updatedAt","videoURLs","timeline","transcription","id") VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)
ON CONFLICT (id) DO UPDATE SET "updatedAt" = ?,"timeline" = ?,"transcription" = ?,"steps"['transcribe'] = ?;
"""
args = [
'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',
'2023-10-10T20:30:00.748Z',
{ "transcribe": '2023-10-10T20:30:00.748Z' },
{ "uniqueId": '6525b448c484e452fe48df08' },
'pending',
]
cursor.execute(sql, args)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment