Привет, как перевести запрос к БД вида:
select * from db_users where nnr_us = '22' order by nnr_filial, nnr_cod;
В запрос sqlalchemy?
Так-же со вторым запросом:
SELECT datname FROM pg_database;
Я перевел его так:
table_init = db.Table("pg_database", metadata, autoload=True, autoload_with=engine)
query = db.select([db.text("datname"), table_init]) # select [what] from [where] like in RAW
connection.execute(query)
Но у меня возникает ошибка вида(хотя запрос отрабатывает верно):
C:\Users\123\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sqlalchemy\dialects\postgresql\base.py:2972: SAWarning: Did not recognize type 'xid' of column 'datfrozenxid'
"Did not recognize type '%s' of column '%s'" % (attype, name)
C:\Users\123\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sqlalchemy\dialects\postgresql\base.py:2972: SAWarning: Did not recognize type 'xid' of column 'datminmxid'
"Did not recognize type '%s' of column '%s'" % (attype, name)
C:\Users\123\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sqlalchemy\dialects\postgresql\base.py:2972: SAWarning: Did not recognize type 'aclitem' of column 'datacl'
"Did not recognize type '%s' of column '%s'" % (attype, name)
C:\Users\123\AppData\Local\Programs\Python\Python37-32\lib\site-packages\sqlalchemy\engine\reflection.py:919: SAWarning: index key 'oid' was not located in columns for table 'pg_database'
"columns for table '%s'" % (flavor, c, table_name)