SQL package

Juan okelet at gmail.com
Tue Aug 26 18:57:01 EDT 2008


Hi

I am trying to write a little a script that can be configurable. This
script should access to a database, that can be of any type (MySQL,
Postgres, SQLite, MS, etc).It has only to perform 2 or 3 simple plain
SQL queries. Hi have tested SQLAlchemy, and it is great, but too much
for my requirements, and I don't have any object relation with the
database tables. All I need is to access any database type in the same
way (mysql://user:pass@localhost/database, pgsqll://user:pass@localhost/database,
...) and run some basic queries. I have searched for this, but I have
not found any solution. Could you help me please?

If not, how can I run a simple query in SQLAlchemy? And iter the
results? I have tried this without success:

engine = create_engine('postgres://user:pass@localhost/database',
echo=True)
results = engine.execute("SELECT * FROM TABLE")
for result in results:
    print result



More information about the Python-list mailing list