]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
ensure intro to "functions have types" is not misleading
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 6 Jul 2024 16:24:51 +0000 (12:24 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 6 Jul 2024 16:24:51 +0000 (12:24 -0400)
make sure it's clear that there is normally not a return type
for SQL functions

Fixes: #11578
Change-Id: Ia0b66e7fe685dad427822345dd232eb47a0fc44f

doc/build/tutorial/data_select.rst

index aa77539b97b9664f804f910e4d454e8fe16adc0f..d9d51c7f51f4f3e46d7d6091d1a432de46a819a7 100644 (file)
@@ -1410,11 +1410,18 @@ as opposed to the "return type" of a Python function.
 
 The SQL return type of any SQL function may be accessed, typically for
 debugging purposes, by referring to the :attr:`_functions.Function.type`
-attribute::
+attribute; this will be pre-configured for a **select few** of extremely
+common SQL functions, but for most SQL functions is the "null" datatype
+if not otherwise specified::
 
+    >>> # pre-configured SQL function (only a few dozen of these)
     >>> func.now().type
     DateTime()
 
+    >>> # arbitrary SQL function (all other SQL functions)
+    >>> func.run_some_calculation().type
+    NullType()
+
 These SQL return types are significant when making
 use of the function expression in the context of a larger expression; that is,
 math operators will work better when the datatype of the expression is