PyORQ - Python Object Relational binding with Queries


SF Summary
Contact Logo


PyORQ 0.1 is intended to be a technology demo. I don't consider this industrial strength software (whatever that is). In particular, PyORQ is currently not being used in any application (although its predecessor is). Therefore, the only testing I've done with PyORQ is the unit testing.

PyORQ 0.1 features:

  • A notation for describing persistent objects, based on Python properties.
  • Automatic creation of tables, based on the persistent object definition.
  • A native Python notation to describe queries.
  • Full support for Object Oriented programming (inheritance and encapsulation).
    • Persistent objects may refer to other persistent objects and queries understand this.
    • References to objects of a particular type may also refer to subclasses of that type.
    • Queries on a type, may return subclasses of that type.
  • Interfaces to several SQL backends:
  • Bugs (undoubtedly)

The biggest shortcomings of version 0.1 are:

  • PyORQ does not check if the definition of a previously created persistent object still matches the table definition
    (Before modifying a persistent object, use db.drop_table() to remove the table).
  • No support for multiple inheritance (Don't do it).
  • Potential name-mangling problems are not checked
    (Assume that persistent attributes are case-insensitive, and you should be OK).
  • Did I mention bugs?


In upcoming versions of PyORQ I will address the shortcomings of version 0.1. In addition, I would like to:
  • Support the Python types bool and unicode
  • Support native SQL types (NUMERIC, CHAR, VARCHAR)
  • Introduce persistent lists and dictionaries.
  • Add a way for persistent objects to tell the database to create an index
  • Let the user instantiate objects using unique keys

In later versions of PyORQ I would like to address some more complicated issues, including:

  • Schema evolution.
  • Transactions.
  • Migration of existing databases.

More later.