async def master_eo_timing_by_meo(self, meo: MasterEOResId) -> List[MasterEOResId]: sql = "select * from MasterEOTimingView where masterEoId=%s;" rs = await self.do_sql(sql, [meo.id()]) return [MasterEOResId.of_id(x["masterEoId"]) for x in rs]
async def __do_master_eo_resources(self, sql, params=()): rs = await self.do_sql(sql, params) return {MasterEOResourceResId.parse(x["meoResource"]): MasterEOResId.parse(x["masterEO"]) for x in rs}
async def master_eo_timing(self) -> List[MasterEOResId]: sql = "select * from MasterEOTimingView;" rs = await self.do_sql(sql) return [MasterEOResId.of_id(x["masterEoId"]) for x in rs]
async def represents(self) -> List[MasterEOResId]: sql = "select * from Represents;" rs = await self.do_sql(sql) return [MasterEOResId.parse(x["masterEO"]) for x in rs]
async def represents_by_meo(self, meo: MasterEOResId) -> List[MasterEOResId]: sql = "select * from Represents where masterEO=%s;" rs = await self.do_sql(sql, [str(meo)]) return [MasterEOResId.parse(x["masterEO"]) for x in rs]
async def vg_mmeo_from_rs_item(x) -> Tuple[VersionGroupResId, MasterEOResId]: return VersionGroupResId.of_id(x["versionGroupId"]), MasterEOResId.of_id(x["masterEOId"])
async def do_timeline_contents_sql(self, sql, params=()) -> List[Tuple[TimelineResId, MasterEOResId]]: rs = await self.do_sql(sql, params) return [(TimelineResId.of_id(x["timeline"]), MasterEOResId.parse(x["masterEO"])) for x in rs]
async def publications_result(self, sql, params=()): rs = await self.do_sql(sql, params) return {PublicationEventResId.parse(x["publicationEvent"]): MasterEOResId.parse( x["masterEO"]) for x in rs}
def create_result(x): return PublicationEventResId.parse(x["publicationEvent"]), MasterEOResId.parse(x["masterEO"])
def create_result(x): return MediaObjectResId.parse(x["mediaObject"]), MasterEOResId.parse(x["masterEO"])
async def __do_media_object_to_master_eo(self, sql, params=()): rs = await self.do_sql(sql, params) return {MediaObjectResId.parse(x["mediaObject"]): MasterEOResId.parse(x["masterEO"]) for x in rs}
async def versiongroup_metadatameos_by_meo(self, meo: MasterEOResId) -> Dict[VersionGroupResId, MasterEOResId]: return await self.vg_mmeo_result("select * from VersionGroupMetadataMeos where masterEOId=%s;", meo.id())
async def find_mastereo_to_versiongroups_by_vg(self, vgid: VersionGroupResId) -> \ Dict[MasterEOResId, VersionGroupResId]: sql = "select * from MasterEOVersionGroups where versionGroupId = %s;" rs = await self.do_sql(sql, [vgid.id()]) return {MasterEOResId.parse(x["meoResId"]): VersionGroupResId.of_id(x["versionGroupId"]) for x in rs}
async def find_tmp_mastereo_to_versiongroups_by_meo(self, resid: MasterEOResId) -> \ Dict[MasterEOResId, VersionGroupResId]: sql = "select * from TmpMasterEOVersionGroups where meoId = %s;" rs = await self.do_sql(sql, [resid.id()]) return {MasterEOResId.of_id(x["meoId"]): VersionGroupResId.of_id(x["versionGroupId"]) for x in rs}
async def media_object_name(self) -> List[MasterEOResId]: sql = "select * from MediaObjectName;" rs = await self.do_sql(sql) return [MasterEOResId.of_id(x["meoId"]) for x in rs]
def create_result(x): return TimelineResId.of_id(x["timeline"]), MasterEOResId.parse(x["masterEO"])
async def insert_tmp_meo_vg(self, meo: MasterEOResId, vg: VersionGroupResId): sql = "insert into TmpMasterEOVersionGroups(meoId,versionGroupId) values (%s,%s);" return await self.do_sql(sql, [meo.id(), vg.id()])
def create_result(x): return MasterEOResId.parse(x["meoResId"]), VersionGroupResId.of_id(x["versionGroupId"])