Skip to content

Commit

Permalink
tables formart
Browse files Browse the repository at this point in the history
  • Loading branch information
CrispenGari committed Apr 11, 2024
1 parent 7867a9e commit 2d87259
Show file tree
Hide file tree
Showing 16 changed files with 374 additions and 270 deletions.
308 changes: 155 additions & 153 deletions docs/source/api/classes/column.rst

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docs/source/api/classes/column_value.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ It accepts two arguments: ``name`` and ``value``. name represents the column nam

.. rst-class:: my-table

+----------+------------------------------------------------------------+------+---------+
| Argument | Description | Type | Default |
+----------+------------------------------------------------------------+------+---------+
| name | The name of the column to be updated or inserted. | str | -- |
+----------+------------------------------------------------------------+------+---------+
| value | The value to assign to the column during update or insert. | Any | -- |
+----------+------------------------------------------------------------+------+---------+
+-----------+------------------------------------------------------------+---------+---------+
| Argument | Description | Type | Default |
+-----------+------------------------------------------------------------+---------+---------+
| ``name`` | The name of the column to be updated or inserted. | ``str`` | -- |
+-----------+------------------------------------------------------------+---------+---------+
| ``value`` | The value to assign to the column during update or insert. | ``Any`` | -- |
+-----------+------------------------------------------------------------+---------+---------+

.. note:: The ``ColumnValue`` is used during data insertion and update.
22 changes: 11 additions & 11 deletions docs/source/api/classes/filter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ So from the above example we are applying filters while updating a ``Post`` here

.. rst-class:: my-table

+----------------+------------------------------------------------------------+--------------------------------------------------------------------------------+---------+
| Argument | Description | Type | Default |
+----------------+------------------------------------------------------------+--------------------------------------------------------------------------------+---------+
| column | The name of the column to apply the filter on | String | |
+----------------+------------------------------------------------------------+--------------------------------------------------------------------------------+---------+
| value | The value to filter against | Any | |
+----------------+------------------------------------------------------------+--------------------------------------------------------------------------------+---------+
| operator | The comparison operator to use for the filter | 'eq', 'neq', 'lt', 'gt', 'leq', 'geq', 'in', 'notIn', 'like', 'between', 'not' | 'eq' |
+----------------+------------------------------------------------------------+--------------------------------------------------------------------------------+---------+
| join_next_with | The logical operator to join this filter with the next one | 'AND', 'OR' | 'AND' |
+----------------+------------------------------------------------------------+--------------------------------------------------------------------------------+---------+
+--------------------+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+-----------+
| Argument | Description | Type | Default |
+--------------------+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+-----------+
| ``column`` | The name of the column to apply the filter on | ``str`` | |
+--------------------+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+-----------+
| ``value`` | The value to filter against | ``Any`` | |
+--------------------+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+-----------+
| ``operator`` | The comparison operator to use for the filter | ``'eq'``, ``'neq'``, ``'lt'``, ``'gt'``, ``'leq'``, ``'geq'``, ``'in'``, ``'notIn'``, ``'like'``, ``'between'``, ``'not'`` | ``'eq'`` |
+--------------------+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+-----------+
| ``join_next_with`` | The logical operator to join this filter with the next one | ``'AND'``, ``'OR'`` | ``'AND'`` |
+--------------------+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+-----------+


.. tip:: Note You can apply either a list of filters or a single filter when filtering records.
26 changes: 13 additions & 13 deletions docs/source/api/classes/fk_column.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ This column accepts the following arguments

.. rst-class:: my-table

+----------+----------------------------------------------------------------------------------------------------------------------+------------------------------------+-------------+
| Argument | Description | Type | Default |
+----------+----------------------------------------------------------------------------------------------------------------------+------------------------------------+-------------+
| table | Required. This is the parent table that the current model references. In our example, this is referred to as 'User'. | str | -- |
+----------+----------------------------------------------------------------------------------------------------------------------+------------------------------------+-------------+
| type | Optional. Specifies the data type of the foreign key. If not provided, dataloom can infer it from the parent table. | None | None |
+----------+----------------------------------------------------------------------------------------------------------------------+------------------------------------+-------------+
| required | Optional. Indicates whether the foreign key is required or not. | bool | False |
+----------+----------------------------------------------------------------------------------------------------------------------+------------------------------------+-------------+
| onDelete | Optional. Specifies the action to be taken when the associated record in the parent table is deleted. | "NO ACTION", "SET NULL", "CASCADE" | "NO ACTION" |
+----------+----------------------------------------------------------------------------------------------------------------------+------------------------------------+-------------+
| onUpdate | Optional. Specifies the action to be taken when the associated record in the parent table is updated. | "NO ACTION", "SET NULL", "CASCADE" | "NO ACTION" |
+----------+----------------------------------------------------------------------------------------------------------------------+------------------------------------+-------------+
+--------------+------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------+-----------------+
| Argument | Description | Type | Default |
+--------------+------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------+-----------------+
| ``table`` | ``Required``. This is the parent table that the current model references. In our example, this is referred to as ``'User'``. | ``str`` | -- |
+--------------+------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------+-----------------+
| ``type`` | ``Optional``. Specifies the data type of the foreign key. If not provided, ``dataloom`` can infer it from the parent table. | ``None`` | ``None`` |
+--------------+------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------+-----------------+
| ``required`` | ``Optional``. Indicates whether the foreign key is required or not. | ``bool`` | ``False`` |
+--------------+------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------+-----------------+
| ``onDelete`` | ``Optional``. Specifies the action to be taken when the associated record in the parent table is deleted. | ``"NO ACTION"``, ``"SET NULL"``, ``"CASCADE"`` | ``"NO ACTION"`` |
+--------------+------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------+-----------------+
| ``onUpdate`` | ``Optional``. Specifies the action to be taken when the associated record in the parent table is updated. | ``"NO ACTION"``, ``"SET NULL"``, ``"CASCADE"`` | ``"NO ACTION"`` |
+--------------+------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------+-----------------+

.. tip:: It is crucial to specify the actions for ``onDelete`` and ``onUpdate`` to ensure that ``dataloom`` manages your model's relationship actions appropriately. The available actions are

Expand Down
22 changes: 11 additions & 11 deletions docs/source/api/classes/group.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ The following code cell demonstrates how we can do data aggregation using the ``
.. rst-class:: my-table

+---------------------------------------------------------+---------------------------------------+---------+---------+----------+
| Argument | Description | Type | Default | Required |
+---------------------------------------------------------+---------------------------------------+---------+---------+----------+
| column | The name of the column to group by. | str | | Yes |
+---------------------------------------------------------+---------------------------------------+---------+---------+----------+
| function | "MAX" | "COUNT" | No | |
+---------------------------------------------------------+---------------------------------------+---------+---------+----------+
| having | Filters to apply to the grouped data. | None | None | No |
+---------------------------------------------------------+---------------------------------------+---------+---------+----------+
| Whether to return the aggregation column in the result. | bool | False | No | |
+---------------------------------------------------------+---------------------------------------+---------+---------+----------+
+-------------------------------+---------------------------------------------------------+-----------------------------------------------------------------+-------------+----------+
| Argument | Description | Type | Default | Required |
+===============================+=========================================================+=================================================================+=============+==========+
| ``column`` | The name of the column to group by. | ``str`` | | ``Yes`` |
+-------------------------------+---------------------------------------------------------+-----------------------------------------------------------------+-------------+----------+
| ``function`` | The aggregation function to apply on the grouped data. | ``"COUNT"`` or ``"AVG"`` or ``"SUM"`` or ``"MIN"`` or ``"MAX"`` | ``"COUNT"`` | ``No`` |
+-------------------------------+---------------------------------------------------------+-----------------------------------------------------------------+-------------+----------+
| ``having`` | Filters to apply to the grouped data. | ``list[Having]`` or ``Having`` or ``None`` | ``None`` | ``No`` |
+-------------------------------+---------------------------------------------------------+-----------------------------------------------------------------+-------------+----------+
| ``return_aggregation_column`` | Whether to return the aggregation column in the result. | ``bool`` | ``False`` | ``No`` |
+-------------------------------+---------------------------------------------------------+-----------------------------------------------------------------+-------------+----------+

.. note:: You can include a single or multiple groups when doing data aggregation in ``dataloom``. You can filter the data while grouping using the `Having <having.html>`_ class.
22 changes: 11 additions & 11 deletions docs/source/api/classes/having.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ The following code cell demonstrates how we can filter in data aggregation using
.. rst-class:: my-table

+----------------+-----------------------------------------------+-------+---------+----------+
| Argument | Description | Type | Default | Required |
+----------------+-----------------------------------------------+-------+---------+----------+
| column | The name of the column to filter on. | str | | Yes |
+----------------+-----------------------------------------------+-------+---------+----------+
| operator | The operator to use for the filter. | "eq" | No | |
+----------------+-----------------------------------------------+-------+---------+----------+
| value | The value to compare against. | Any | | Yes |
+----------------+-----------------------------------------------+-------+---------+----------+
| join_next_with | The SQL operand to join the next filter with. | "AND" | No | |
+----------------+-----------------------------------------------+-------+---------+----------+
+--------------------+-----------------------------------------------+-----------+---------+----------+
| Argument | Description | Type | Default | Required |
+--------------------+-----------------------------------------------+-----------+---------+----------+
| ``column`` | The name of the column to filter on. | ``str`` | | ``Yes`` |
+--------------------+-----------------------------------------------+-----------+---------+----------+
| ``operator`` | The operator to use for the filter. | ``"eq"`` | ``No`` | |
+--------------------+-----------------------------------------------+-----------+---------+----------+
| ``value`` | The value to compare against. | ``Any`` | | ``Yes`` |
+--------------------+-----------------------------------------------+-----------+---------+----------+
| ``join_next_with`` | The SQL operand to join the next filter with. | ``"AND"`` | ``No`` | |
+--------------------+-----------------------------------------------+-----------+---------+----------+

.. note:: You can filter the groups in data aggregation using a single ``Having`` or multiple as a list.

Expand Down
Loading

0 comments on commit 2d87259

Please sign in to comment.