Opened 15 years ago
Last modified 11 years ago
#8647 closed enhancement
Streamline DB Connection API — at Version 4
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.1 |
Component: | database backend | Version: | 0.11.5 |
Severity: | normal | Keywords: | documentation |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
This patch simplifies Trac DB API to make it easier to extend and add new DB backends. It introduces abstract DatabaseConnection
class that clearly defines what required methods are used by Trac and must be implemented by Connection classes.
I've made it, because I found implicit ConnectionWrapper
behavior misleading. I used SQLiteConnection
method set as an example, but in the end my implementation failed to execute, because it didn't have commit() method - just like SQLiteConnection
. It took a while to dig through PooledConnection
to ConnectionWrapper
then to SQLiteConnection
and finally to ConnectionWrapper
again to realize that commit() method is implicitly called from bundled SQLite library when it isn't found anywhere else.
I hope this negative developer experience will find more response in tracker than it had in mailing list. =)
Change History (5)
by , 15 years ago
Attachment: | connection.wrapper.2.db.api.patch added |
---|
comment:1 by , 14 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 12 years ago
Keywords: | documentation added |
---|---|
Milestone: | → 1.1.1 |
Resolution: | wontfix |
Status: | closed → reopened |
… however, adding those methods for documenting them makes sense ;-)
comment:3 by , 12 years ago
Owner: | set to |
---|---|
Status: | reopened → new |
comment:4 by , 12 years ago
Description: | modified (diff) |
---|---|
Milestone: | 1.1.1 → 1.0.1 |
commit()
and other such methods are documented in Python DB API 2.0 (pep:0249) for the Connection Objects.
In ConnectionWrapper
, we should add the documentation for the following methods: cast
, concat
, like
, like_escape
, quote
, get_last_id
, and update_sequence
.
Not really enthusiastic about this patch which merely adds a class full of:
methods (and btw, there's a standard NotImplemented exception you might find interesting ;-) ).