1 |
async def is_table_exists(self, table_name: str, schema_name: str = 'public') -> bool: result = await self.db.execute('select exists(select from pg_tables where schemaname=$1 and tablename=$2)',schema_name, table_name, fetchval=True) return result async def initialize(self): if self.db.pool is None: await self.db.create_pool() if not await self.is_table_exists(table_name='fractal'): try: result = await self.create_fractal_table() logger.info(f'Created fractal table: {result}') except Exception as e: logger.error(e) await self.get_symbol_id() |
Комментарии