Get data in the form of a list of dictionaries, with each dictionary representing a row. These are all equivalent: .. code-block:: python await Band.select().columns(Band.name) await Band.select(Band.name) await Band.select('nam
(
cls, *columns: Union[Selectable, str], exclude_secrets=False
)
| 1114 | |
| 1115 | @classmethod |
| 1116 | def select( |
| 1117 | cls, *columns: Union[Selectable, str], exclude_secrets=False |
| 1118 | ) -> Select: |
| 1119 | """ |
| 1120 | Get data in the form of a list of dictionaries, with each dictionary |
| 1121 | representing a row. |
| 1122 | |
| 1123 | These are all equivalent: |
| 1124 | |
| 1125 | .. code-block:: python |
| 1126 | |
| 1127 | await Band.select().columns(Band.name) |
| 1128 | await Band.select(Band.name) |
| 1129 | await Band.select('name') |
| 1130 | |
| 1131 | :param exclude_secrets: |
| 1132 | If ``True``, any columns with ``secret=True`` are omitted from the |
| 1133 | response. For example, we use this for the password column of |
| 1134 | :class:`BaseUser <piccolo.apps.user.tables.BaseUser>`. Even though |
| 1135 | the passwords are hashed, you still don't want them being passed |
| 1136 | over the network if avoidable. |
| 1137 | |
| 1138 | """ |
| 1139 | _columns = cls._process_column_args(*columns) |
| 1140 | return Select( |
| 1141 | table=cls, columns_list=_columns, exclude_secrets=exclude_secrets |
| 1142 | ) |
| 1143 | |
| 1144 | @classmethod |
| 1145 | def delete(cls, force=False) -> Delete: |