On Saturday, 24 February 2018 at 20:45:03 UTC, Joe wrote:
On Saturday, 24 February 2018 at 18:56:23 UTC, Denis F wrote:
It seems to me that this is a common misconception that it is
possible to create a good universal tool for accessing the
database in place of the many existing ones.
I don't think what is needed a "good universal tool" but a good
enough common interface. Python PEP 249 is very similar to what
I've seen in the D libraries I've looked at: there is a
Connection class of some kind, and a Cursor (or command or
query) class, each with a set of well-defined (and generally
not unexpected) methods: commit/rollback on the connection,
execute/fetch/etc. on the cursor). PEP 249 also standardizes
the exceptions and some datatypes.
Currently in dpq2 all of these things are implemented except
cursors (I think cursors became "unpopular" lately)
It's not perfect, or universal enough, but I believe it allowed
db development under Python to proceed at a faster pace than
otherwise.
If anyone really want to impliment your idea, at my first glance
at the PEP 249 I had a feeling that this is work for time less
than a 1-2 weeks. It can be a simple wrapper over dpq2,
mysql-native, sqlite3, etc.