if theyre the types that dont like ORMs, you might also want to stress that SA can be used to construct straight SQL in a database-neutral fashion, and the orm package need not be used (functions like mapper(), relation() etc. all come from sqlalchemy.orm). ive seen a lot of projects that prefer to use it in this manner, where the ultimate result is that the project implements its own "mini-ORM" using SA just as an abstraction from the database (and particularly in the way databases differ in primary key generation). if you want to really impress them show them this trick, which illustrates just how abstracted it is (illustrates LEFT OUTER JOIN using Postgres and oracle 8 which doesnt support 'LEFT OUTER JOIN'): from sqlalchemy import * import sqlalchemy.databases.postgres as postgres import sqlalchemy.databases.oracle as oracle pg_dialect = postgres.dialect() oracle8_dialect = oracle.dialect(use_ansi=False) meta = MetaData() t1 = Table('tablea', meta, Column('id', Integer, primary_key=True), Column('value', String(30)) ) t2 = Table('tableb', meta, Column('id', Integer, primary_key=True), Column('t1_id', Integer, ForeignKey('tablea.id'))) query = t1.outerjoin(t2).select() print "Postgres version:", query.compile(dialect=pg_dialect) print print "Oracle 8 version:", query.compile(dialect=oracle8_dialect) output: Postgres version: SELECT tablea.id, tablea.value, tableb.id, tableb.t1_id FROM tablea LEFT OUTER JOIN tableb ON tablea.id = tableb.t1_id Oracle 8 version: SELECT tablea.id, tablea.value, tableb.id, tableb.t1_id FROM tablea, tableb WHERE tablea.id = tableb.t1_id(+) On Sep 12, 2006, at 2:32 AM, Michael Carter wrote: Hey everyone, |
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users