- Average Rating: GOOD
- Latest version: 0.1.5
- Price: BSD License / FREE
- Operating system: Linux
- File size: 0.07 MB
- Last update: 4 years ago
- Total downloads: 86
- Product browse:
Jakub Wroniecki (2 other programs)
- See full specifications
newer version? let us know!
suggest to a friend
add to my alerts
XRecord is a library which provides an object interface to databases. Tables are represented as classes, columns are attributes, and rows of data are class instances. If you used Python for developing database applications you may have come across one or more of ORMs, like: · full introspection, no model definition in Python required,
An Introspecting Python ORM
* many more...
XRecord is not meant to replace any of them, but rather - provide an alternative approach to Object-Relation mapping. XRecord also tries to be a thin Database Abstraction Layer - make using an RDBMS quick and easy without hiding any of its powerful features.
Why another ORM?
Its seems that the "Python ORM market" is filled with some excellent solutions, all of which do what is expected of them really well. However, while using most of them I found that they all share some design decisions, as result of which they don exactly fit my needs.
Most of existing Python ORMs require you to actually write the classes onto which rows of data will be mapped. They require you to explicitly define the foreign keys in your classes (tables) and to describe the many-to-many relationships. Since all of this information is already inside your RDBMS, I believe this to be in a little conflict with the DRY principle, of which I am a big fan. Some ORMs try to counter this problem by leaving the database (model) definition entirely in Python code, but this is just a superficial solution - even though your model is defined in Python, your data is still stored in an external database and their structures do not always have to be in sync.
Most existing Python ORMs are designed to hide all SQL from the programmer, but still allow complex queries to be performed through an abstraction layer put on top of low-level database API. This makes the code look clean, and RDBMS independent. It is common for applications to be developed and tested with SQLite, and then switched to MySQL/PostgreSQL in production, which is both elegant and convenient.
However, this approach has some issues. All of the widely used RDBMS, are highly sophisticated, projects, with thousands of man-hours put into development, testing and optimization. Most of them introduce many handy improvements to the SQL standard (non standard types, alternative syntax, etc), which may be lost when using a unified abstraction layer (which, btw, may be a source of new bugs).
So the price for the clean code, and platform independence, may be reduced functionality of your database system. When writing quick, small applications I often choose my RDBMS back-end based on one of its distinctive features, which will make my work faster, so I looked for an ORM which made using it easier, rather than more difficult.
Some may argue, that all of the aforementioned ORMs have built-in hacks (or even features :) ) to overcome all these problems. Thats true, but its just not the way they were designed to be used - so by using these hacks, you no longer have clean, engine-independent code, but sometimes its even uglier and less maintainable than the low-level API.
Common ORM features that were left out
* no object caching, no Store
* no way to customize SELECT queries without writing SQL
* no automatic database generation
* PostgeSQL (work-in-progress)
· automatic foreign key mapping, both in the referenced and referencing objects,
· automatic many-to-many relationship detection,
· optional foreign-key references caching,
· easily extend generated record classes to provide extra functionality for your objects,
· easily define FK and MTM relationships, that were left out in the database definition,
· object-mapping of any SQL statement,
· may be used without writing a single line of SQL,
· multiple-column primary keys,
· database connection objects designed for long-running applications
XRecord is a library which provides an object interface to databases. Tables are represented as classes, columns are attributes, and rows of data are class instances. If you used Python for developing database applications you may have come across one or more of ORMs, like:
· full introspection, no model definition in Python required,
Related Database APIs downloads
Tellico has transitioned from using KDE's SVN repository to the GIT repositorylinux - Freeware
EJDB is an open source and fast MongoDB-like library designed to be embedded into C, C++, Python3, NodeJS, Lua, Ruby and Java applicationslinux - Freeware
The asn1 module for the Qore Programming Language applinux - Freeware
The ncurses module for the Qore Programming Language applinux - Freeware
The Qt4 module for the Qore Programming Language applinux - Freeware