Re: creating tables needed for a query on-demand
Ryan Blazecka <rblazecka-Y8iDqJfwfq2w5LPnMra/[email protected]>
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
Andy Chambers wrote: > How about putting the query inside a try .. except block? > > the problem is that since the query is coming from the user, I have no idea which table is causing the statement to fail. in addition, the table may exist, but I need to update it's contents before running the query. in this case, I wouldn't even get an error, it would just be operating on out-of-date data. I haven't tried it yet, but I'm hoping I can use the authorizer to catch this "out-of-date" case. if so, I could solve the other case by pre-creating all of the tables, but only populating them when the user actually queries against them. this still seems a little hacky though - I really don't think it's what an authorizer is intended to be used for. ;) thanx, ryan