[ZODB-Dev] I want Object Gadfly

Jeff Kowalczyk jtk at yahoo.com
Sat Jul 19 02:00:36 EDT 2003


I suggested once (to a thud/crickets) that a python rendition of ADO.NET's
DataSet would be an interesting way for SQL-trained users to relate
collections of objects. I haven't used .NET at all since discovering
Python, but I still suspect ADO.NET ideas would be a natural fit with
Python.

At the time I was thinking of DataSets as relatable containers for Z2
Catalog query results. Perhaps it would work just as well with objects of
a like interface filling a given DataTable. The interface slots could be
used to infer the DataTable columns.

- DataSet and related classes (DataTable, DataView, DataRelation, etc.)
  comprise an in-memory relational database. The classes can be
  manipulated by API methods or built by the DataProvider when returning
  SQL results.

- Default model is disconnected data, DataTables are .fill()'d and can
  give changed rows when it's time to update the original data source.

- A Pythonic implementation could possibly treat class methods as a
  callable column type, to provide a convenient roundtrip to get the
  source object, call the method, and resync the affected DataRow(s)
  to the source object.

- DataRelations and DataTable/View filtering approximate SQL-like
  operations. From the first day I learned about the DataSet, I thought
  there was a niche for a meta-OLEDB provider (implementing a full SQL
  engine) that used filled DataTables as its DataSource. This has
  fox-chasing-its-tail issues, but would represent ultimate flexibility
  for ad-hoc use of existing DataSet code.

- Relational DataSets can be created uniformly from a variety of souces
  (XML, etc.), and schema can be inferred or manually defined. This would
  be an excellent way to get data in and out of Zope or Python objects.

- It would also have *broad* appeal to .NET users coming to Python.

There is now an abundance of C# source code to refer to thanks to the
progress of the Mono implementation. http://go-mono.org/ado-net.html
http://www.ondotnet.com/topics/dotnet/ado.net (OReilly) I wish I had the
skill or time to bring ADO.NET to open-source python, but it sounds like a
very big job.




More information about the ZODB-Dev mailing list