def insert(id: str, name: str, format: str, md5: str, local_audio_path: str, video_id: str, date_created: str): """ insert into videos :return: """ sql = """INSERT INTO audios (id, name, format, md5, local_audio_path, video_id, date_created) VALUES (%(id)s, %(name)s, %(format)s, %(md5)s, %(local_audio_path)s, %(video_id)s, %(date_created)s)""" params = {'id': id, 'name': name, 'format': format, 'md5': md5, 'local_audio_path': local_audio_path, 'video_id': video_id, 'date_created': date_created} db = PostgreSql() db.execute(sql, params)
def insert(id: str, name: str, live_id: str, local_video_path: str, duration: int, stage: int, segment: bool): sql = """INSERT INTO videos (id, name, live_id, local_video_path, duration, stage, segment) VALUES (%(id)s, %(name)s, %(live_id)s, %(local_video_path)s, %(duration)s, %(stage)s, %(segment)s)""" params = { 'id': id, 'name': name, 'live_id': live_id, 'local_video_path': local_video_path, 'duration': duration, 'stage': stage, 'segment': segment } db = PostgreSql() db.execute(sql, params)
def insert(id: str, name: str, format: str, md5: str, local_video_path: str, cloud_video_path: str, cloud_cover_path: str, size: int, date_created: str): sql = """INSERT INTO videos (id, name, format, md5, local_video_path, cloud_video_path, cloud_cover_path, size, date_created) VALUES (%(id)s, %(name)s, %(format)s, %(md5)s, %(local_video_path)s, %(cloud_video_path)s, %(cloud_cover_path)s, %(size)s, %(date_created)s)""" params = { 'id': id, 'name': name, 'format': format, 'md5': md5, 'local_video_path': local_video_path, 'cloud_video_path': cloud_video_path, 'cloud_cover_path': cloud_cover_path, 'size': size, 'date_created': date_created } db = PostgreSql() db.execute(sql, params)