I would like to use SqlSoup with an existing database containing views. Access to the table is smooth, but access to viewing results in "PKNotFoundError: table" [viewname] "does not have a defined primary key ..."
Do you conclude correctly that SqlSoup does not work with database views (at least by default)? I could not find anything directly relevant on the Google, SO, or SqlAlchemy mailing list. If you were faced with this, what would you do if you want to access unrestored views? I am new to SQLAlchemy and SQLSoup.
Here is an example:
from sqlalchemy.ext.sqlsoup import SqlSoup u = SqlSoup('postgresql+psycopg2:// PUBLIC@unison-db.org :5432/unison') seq = u.pseq.filter(u.pseq.pseq_id==76).all()
This is a public database. You can run equivalent queries using psql:
psql -h unison-db.org -U PUBLIC -d unison -c 'select * from pseq where pseq_id=76' psql -h unison-db.org -U PUBLIC -d unison -c 'select * from pseqalias where pseq_id=76'
source share