crary_web wrote: > For production I will need to connect as user "webserv" who has no > ownership at all only select grants, and will only have access to > views. Currently, with what I have deciphered for myself, I can't do > this. I cannot reflect a view at all, it complains about primary keys > which I can understand, but is there a way around this as it's not > practical to ask our DBA to put pks on the hundreds of views I will > possibly need to access, if he can at all.
its true that there's no built in functionality to reflect views. In the case of your views, just create Table instances manually, specifying the view names, column names, and column types explicitly. Set the "primary_key=True" flag on those columns which you'd like to consider as part of the primary key within your application. No database change is necessary. If you need to reflect an actual table in the DB, and you'd like to override what columns are considered as part of the primary key within your application, you specify those columns explicitly as in http://www.sqlalchemy.org/docs/05/metadata.html#overriding-reflected-columns . > I can reflect a table as long as I connect as the table owner which as > I stated before I will not be able to do. What configuration flag am > I missing or parameter I am not passing to make this ok? pass the "schema='someowner'" flag to each Table object. > Also. When I do get it to work I get a list of warnings while > reflection takes place (when using 0.5.7 this come from base.py): that only means SQLA doesn't have a type matched up to those columns, so it will not apply any bind param or result processing to values for that column, and will also treat it agnostically when constructing expressions.
-- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.