We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
as_alias
1 parent d221e8c commit 107fe18Copy full SHA for 107fe18
docs/src/piccolo/query_types/select.rst
@@ -31,6 +31,18 @@ Or making an alias to make it shorter:
31
32
.. hint:: All of these examples also work with async by using .run() inside coroutines - see :ref:`SyncAndAsync`.
33
34
+as_alias
35
+--------
36
+
37
+By using ``as_alias``, the name of the row can be overriden in the response.
38
39
+.. code-block:: python
40
41
+ >>> Band.select(Band.name.as_alias('title')).run_sync()
42
+ [{'title': 'Rustaceans'}, {'title': 'Pythonistas'}]
43
44
+This is equivalent to ``SELECT name AS title FROM band`` in SQL.
45
46
Joins
47
-----
48
0 commit comments