ANN: Dejavu 1.5.0RC1

R

Robert Brewer

The Dejavu Object-Relational Mapper (version 1.5.0RC1) is now available
and in the public domain. Get it at http://projects.amor.org/dejavu,
or from PyPI: http://www.python.org/pypi/Dejavu/1.5.0RC1.

Dejavu is an Object-Relational Mapper for Python applications. It is
designed to provide the "Model" third of an MVC application. Dejavu
avoids making decisions in the framework which are better left to
developers, and avoids forcing developers to make decisions which are
better left to deployers. In particular, deployers are allowed to mix
and match storage mechanisms, including how and when to cache objects in
memory, making it easier for deployers to tune applications to their
particular environment.

Dejavu provides:

Modeling Layer
1. A base Unit class for persisting objects to storage.
2. A base UnitProperty class for persistent object attributes.
3. ID Sequencers.
4. Associations between Unit classes.
5. Unit Engines, Rules, and Collections.
6. Aggregation and analysis tools.

Application Layer
1. Expressions: pure Python lambda querying. This is perhaps the most
appealing feature of Dejavu.
2. Sandboxes, which serve as Identity Maps, transaction boundaries,
and per-connection caches.
3. An Arena class for application-level data.

Storage Layer
1. A base StorageManager class and specification. Unlike many ORMs,
Dejavu does not require you to have complete control of the back end.
2. Specific StorageManagers for:
a. Microsoft SQL Server/MSDE
b. Microsoft Access (Jet)
c. PostgreSQL
d. MySQL
e. SQLite
f. Shelve
g. Firebird
h. RAM
i. Filesystem


What's New in 1.5:
http://projects.amor.org/dejavu/wiki/WhatsNewIn15

* Native ID sequencing.
* Distributed transactions and tested isolation levels.
* Complete database introspection and auto discovery.

* New Firebird support.
* New RAM Storage Manager.
* New psycopg2 support.
* New support for using the sqlite3 module built into Python 2.5.
* Support for typed and typeless SQLite.
* Support for SQLite :memory: databases.

* Complete numeric precision and scale support.
* Native date function support.
* Complete M x N type-adaptation.
* Bulletproof encoding support.
* New 'range' function which returns the closed interval [min(attr),
...., max(attr)].
* New 'sum' function which returns the sum of all non-None values for
the given cls.attr.
* Multiple and custom Associations.
* Improved performance (especially ADO).
* New JSON encoder/decoder.
* Short config names for Storage Managers.
* ADO: New support for the CURRENCY datatype.
* ADO: Improved string comparisons using Convert and StrComp.

Upgrading to 1.5:
See http://projects.amor.org/dejavu/wiki/UpgradeTo1.5

Documentation for 1.5:
http://projects.amor.org/docs/dejavu/1.5.0RC1/


Robert Brewer
System Architect
Amor Ministries
(e-mail address removed)
 
F

fumanchu

I am curious ... how this compare to SQLAlchemy?

The comparisons could be endless ;) but here are some of the larger
differences:

1. Dejavu uses generic "storage" concepts and syntax, while SQLAlchemy
prefers database concepts and syntax.
2. Dejavu uses Python expressions (lambdas) to query storage, whereas
SQLAlchemy uses functions and magic attributes:
* SQLAlchemy: users.select(and_(users.c.age < 40, users.c.name !=
'Mary'))
* Dejavu: recall(users, lambda u: u.age < 40 and u.name != 'Mary')
3. SQLAlchemy prefers that you write data classes, table classes and
the mappers between them. Dejavu only expects you to write a data
class. New in 1.5: you can auto-generate even the data classes if you
already have a populated database.
4. SQLAlchemy allows you to write more complicated queries (like
subqueries and aggregate columns). Dejavu doesn't provide those yet
(slated for 1.6).


Robert Brewer
System Architect
Amor Ministries
(e-mail address removed)
 
M

Michele Cella

differences:

1. Dejavu uses generic "storage" concepts and syntax, while SQLAlchemy
prefers database concepts and syntax.
2. Dejavu uses Python expressions (lambdas) to query storage, whereas
SQLAlchemy uses functions and magic attributes:
* SQLAlchemy: users.select(and_(users.c.age < 40, users.c.name !=
'Mary'))
* Dejavu: recall(users, lambda u: u.age < 40 and u.name != 'Mary')
3. SQLAlchemy prefers that you write data classes, table classes and
the mappers between them. Dejavu only expects you to write a data
class. New in 1.5: you can auto-generate even the data classes if you
already have a populated database.
4. SQLAlchemy allows you to write more complicated queries (like
subqueries and aggregate columns). Dejavu doesn't provide those yet
(slated for 1.6).

5. Dejavu supports model evolution (very much like rails's ActiveRecord
migrations)

I will add that I've never been able to (easily) wrap my head around
ORMs like SQLObject and SQLAlchemy, while they are both great pieces of
software and SQLAlchemy is impressively well documented (like every
other things powered by Michael Bayer) they are trying to reinvent an
ad-hoc query language on top of SQL using python that you need to
learn, that's why my favorite Dejavu feature it's the way you build
queries (using common python constructs like lambda) and define models
(using python types like str, unicode... or your own).

I really encourage anyone to check it out, it's not getting the
publicity it deserves but this doesn't mean it's not good at what it
does, and Robert is like a quality assurance. ;-)

Ciao
Michele
 
O

olive

Looks interesting...

Do you consider a StorageManagers for Oracle ?

Olive.

The Dejavu Object-Relational Mapper (version 1.5.0RC1) is now available
and in the public domain. Get it athttp://projects.amor.org/dejavu,
or from PyPI:http://www.python.org/pypi/Dejavu/1.5.0RC1.

Dejavu is an Object-Relational Mapper for Python applications. It is
designed to provide the "Model" third of an MVC application. Dejavu
avoids making decisions in the framework which are better left to
developers, and avoids forcing developers to make decisions which are
better left to deployers. In particular, deployers are allowed to mix
and match storage mechanisms, including how and when to cache objects in
memory, making it easier for deployers to tune applications to their
particular environment.

Dejavu provides:

Modeling Layer
1. A base Unit class for persisting objects to storage.
2. A base UnitProperty class for persistent object attributes.
3. ID Sequencers.
4. Associations between Unit classes.
5. Unit Engines, Rules, and Collections.
6. Aggregation and analysis tools.

Application Layer
1. Expressions: pure Python lambda querying. This is perhaps the most
appealing feature of Dejavu.
2. Sandboxes, which serve as Identity Maps, transaction boundaries,
and per-connection caches.
3. An Arena class for application-level data.

Storage Layer
1. A base StorageManager class and specification. Unlike many ORMs,
Dejavu does not require you to have complete control of the back end.
2. Specific StorageManagers for:
a. Microsoft SQL Server/MSDE
b. Microsoft Access (Jet)
c. PostgreSQL
d. MySQL
e. SQLite
f. Shelve
g. Firebird
h. RAM
i. Filesystem

What's New in 1.5:http://projects.amor.org/dejavu/wiki/WhatsNewIn15

* Native ID sequencing.
* Distributed transactions and tested isolation levels.
* Complete database introspection and auto discovery.

* New Firebird support.
* New RAM Storage Manager.
* New psycopg2 support.
* New support for using the sqlite3 module built into Python 2.5.
* Support for typed and typeless SQLite.
* Support for SQLite :memory: databases.

* Complete numeric precision and scale support.
* Native date function support.
* Complete M x N type-adaptation.
* Bulletproof encoding support.
* New 'range' function which returns the closed interval [min(attr),
..., max(attr)].
* New 'sum' function which returns the sum of all non-None values for
the given cls.attr.
* Multiple and custom Associations.
* Improved performance (especially ADO).
* New JSON encoder/decoder.
* Short config names for Storage Managers.
* ADO: New support for the CURRENCY datatype.
* ADO: Improved string comparisons using Convert and StrComp.

Upgrading to 1.5:
Seehttp://projects.amor.org/dejavu/wiki/UpgradeTo1.5

Documentation for 1.5:http://projects.amor.org/docs/dejavu/1.5.0RC1/

Robert Brewer
System Architect
Amor Ministries
(e-mail address removed)
 
F

fumanchu

Do you consider a StorageManagers for Oracle ?

Yes, and in fact, I already have a ticket for it:
http://projects.amor.org/dejavu/ticket/59. I've downloaded Oracle 10.2g
XE and played with it a little, but hit some snags right away due to
its different interface. I think now that I've done a Firebird backend,
I'll be a little better able to tackle an Oracle adapter. But I don't
use Oracle every day, so any help is most welcome.


Robert Brewer
System Architect
Amor Ministries
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Dejavu 1.2.6, a Python ORM 0
Dejavu 1.3, a Python ORM 0
SQLObject 1.5.2 0
SQLObject 1.5.1 0
SQLObject 1.4.0 0
SQLObject 1.2.2 0
SQLObject 1.3.2 and 1.2.4 0
[ANN] IPython 0.11 is officially out 2

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top