MikeFletcher:

PyTable's primary strength is its schema-driven nature. A database plan (schema) is created which maps the structure of the database into a run-time introspectable data structure.

Normally the schema is created in Python code, and used to drive the creation of the database, (though facilities are available for extracting a basic schema from the database). The schema can include information regarding what classes to instantiate when retrieving records for a given table (with suitable defaults provided). The schema is used internally by DBRow objects to implement update and insert queries, for instance. In other words, the DBRow objects can look at themselves to decide what actually needs to be done to accomplish a given task (such as specifying their row uniquely in the table).

PyTable sits halfway between the raw DbApi (where you know only approximate data-type, name, and a few other minimal pieces of information) and a system such as PyDO (where the database interactions are done through an object-oriented API). PyTable is still very much about generating and running SQL code, you are not forced into the everything is an object mould, you can still run raw SQL (with some helper mechanisms to make creating complex queries easier) and integrate those queries into your row classes. The PyTable DBRow objects are simply very rich introspectable wrappers around the DB-API records (you can use non-DBRow records too).

As to BasicProperty, its purpose is to allow for defining rich attribute descriptors, similar to the property objects built in to Python 2.2 and above. Distinction being that the BasicProperty descriptors are far more involved, including default values/functions, two levels of storage hooks for customizing behaviour, the ability to auto-coerce values to/from data-types on save/restore, support for list-of types etceteras. BasicProperty is an extremely general mechanism, so it's a little hard to say what particular benefit it has without looking at particular applications.

Back to the subject at hand; In effect, PyTable is about trying to make the nitty-gritty details of dealing with an SQL-driven application easier by providing introspection facilities that let your code reason about the structure of the database (as embodied in the schema objects).

What PyTable is not:

PyTable (last edited 2009-09-29 14:59:16 by 217)

Unable to edit the page? See the FrontPage for instructions.