]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Fix the "greatest" example.
authorKonstantin Tretyakov <kt@ut.ee>
Mon, 17 Dec 2018 22:21:03 +0000 (17:21 -0500)
committersqla-tester <sqla-tester@sqlalchemy.org>
Mon, 17 Dec 2018 22:21:03 +0000 (17:21 -0500)
commit8722fb84a67905aaf9ac6be79255f58e422fa6ea
tree5cee6268152463f1b5cdaf8e3f1437016a475b78
parent3b6ff1b9f9d740f9a5b11b1774ee77c563926f84
Fix the "greatest" example.

The current example code does not pass `**kw` down to the `compiler.process` calls, thus the example does not work when invoked with, `literal_binds=True`.

Besides, the calls to `process` each argument twice are wasteful, and reusing the built-in `case` expression instead of hard-coding the SQL statements is slightly nicer overall, isn't it?

Closes: #4402
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4402
Pull-request-sha: 24ee93f63e21fccae6cbc1cc1c154dd56f1e1963

Change-Id: I02424d9eb2b35abd5cdec5c2cd5d464a56e7fae6
lib/sqlalchemy/ext/compiler.py