which better for me?session.query or session.execute?

Mohsen Pahlevanzadeh mohsen at pahlevanzadeh.org
Tue Aug 27 13:54:35 EDT 2013


Dear all,


Suppose I want to write a function for better using SQLAlchemly
dynamically with the following specification:

     1. It get field names and values.
     2. It get operators such as = , <> , like , between and so on.
     3. It get logical operators such as and , or and not.
     4. ....
     5. ....

I need it for update query ,select ,join and delete.

I read the following stackoverflow link:

SQLAlchemy Flask filter query to combine results from two models

SQLAlchemy Query and_/or_ Issue

sqlalchemy filter multiple columns

How do I specify a relation in SQLAlchemy where one condition requires a
column to be null?

In sqlalchemy, how can I combine two queries by having a column entry
identical?

My Question:
I neeed to write a string and concatenite above params, which are
better? session.query or set of function such as update, delete and so
on that run by execute function?


You'll make me happy if answer in http://stackoverflow.com :
http://stackoverflow.com/questions/18472314/which-better-session-query-or-session-execute-python-sqlalchemy

Yours,
Mohsen





More information about the Python-list mailing list