]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Allow optional *args with base AnsiFunction
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 29 Nov 2018 15:13:03 +0000 (10:13 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 30 Nov 2018 04:46:42 +0000 (23:46 -0500)
commit3ff39757673b6c1aa8c96c4b951d39afd8e3e379
treec44e1bebe0350f04ba81abe69ef4a46ca9878055
parent576b33d46a9418424e94926bf9f02bdad3fc593f
Allow optional *args with base AnsiFunction

Amended the :class:`.AnsiFunction` class, the base of common SQL
functions like ``CURRENT_TIMESTAMP``, to accept positional arguments
like a regular ad-hoc function.  This to suit the case that many of
these functions on specific backends accept arguments such as
"fractional seconds" precision and such.  If the function is created
with arguments, it renders the the parenthesis and the arguments.  If
no arguents are present, the compiler generates the non-parenthesized form.

Fixes: #4386
Change-Id: Ic492ef177e4987cec99ec4d95f55292be8daa087
doc/build/changelog/unreleased_13/4386.rst [new file with mode: 0644]
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/functions.py
test/sql/test_functions.py