kennethreitz / records

SQL for Humans™
https://pypi.python.org/pypi/records/
ISC License
7.16k stars 574 forks source link

more friendly "in" clause support #151

Closed cai502 closed 6 years ago

cai502 commented 6 years ago
sql = 'select * from some_table where text_column in :some_list'
db.query(sql, some_list=['abc', 'bcd'])

Hi,the code above is a convenient and consistent query api for in clause.

However,records(or sqlalchemy) has no support for this. And now I have to write ugly code below.

some_list = ['abc', 'bcd']
ugly_list = ["'{}'".format(i) for i in some_list]
sql = 'select * from some_table where text_column in ({})'.format(', '.join(ugly_list))
db.query(sql)

So I wonder whether records can add support for this.

vlcinsky commented 6 years ago

As records is sort of sqlalchemy wrapper, such a request shall be addressed to sqlalchemy project.

Btw issue #83 discussed such requirement already.