Comment 3 for bug 132485

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

Posting some discussions that happened one month ago on the topic:

Aug 14 13:23:58 <niemeyer> radix: I think store.commit_prepared() might not be needed
Aug 14 13:24:07 <radix> you think it should just be "commit()"?
Aug 14 13:24:59 <niemeyer> radix: If the backend needs special handling for prepared statements, it can just "if self._prepared_id: ..."
Aug 14 13:26:44 <niemeyer> radix: This way the whole API change would consist of adding {store,connection}.prepare()
Aug 14 13:27:12 <radix> ok, fair enough
Aug 14 13:27:28 <niemeyer> radix: store.commit() doesn't even have to change, I think
Aug 14 13:28:16 <radix> oh
Aug 14 13:28:18 <radix> _connection.commit :)
Aug 14 13:28:24 <radix> cool
Aug 14 13:32:07 <niemeyer> radix: I wonder if we should make connection.prepare() raise an exception, or just pass.. there's a subtle difference
Aug 14 13:32:32 <niemeyer> radix: If store.prepare() raises an exception, people won't call it on unsupported databases
Aug 14 13:32:50 <niemeyer> radix: That's good, in the sense that we're warning them that the database won't support it
Aug 14 13:33:50 <niemeyer> radix: But if we make it just pass, prepare() will at least flush() changes, which even though most people don't know, it's a lot better than nothing.
Aug 14 13:26:44 <niemeyer> radix: This way the whole API change would consist of adding {store,connection}.prepare()
Aug 14 13:27:12 <radix> ok, fair enough
Aug 14 13:27:28 <niemeyer> radix: store.commit() doesn't even have to change, I think
Aug 14 13:28:16 <radix> oh
Aug 14 13:28:18 <radix> _connection.commit :)
Aug 14 13:28:24 <radix> cool
Aug 14 13:32:07 <niemeyer> radix: I wonder if we should make connection.prepare() raise an exception, or just pass.. there's a subtle difference
Aug 14 13:32:32 <niemeyer> radix: If store.prepare() raises an exception, people won't call it on unsupported databases
Aug 14 13:32:50 <niemeyer> radix: That's good, in the sense that we're warning them that the database won't support it
Aug 14 13:33:50 <niemeyer> radix: But if we make it just pass, prepare() will at least flush() changes, which even though most people don't know, it's a lot better than nothing.