# Database source

### Fetching data from databases with queries

When configuring the table portlet and want to fetch data from a database using a flow db connector follow these steps:

Data source configuration enables the portlet to execute specified queries towards the chosen database connector.

* **Database connector** - Select which connector that the query will execute against.
* **Your query** - Text field where queries can be written
* **Page Size** - Amount of rows showed on each page
* **Default Sort** - List of columns of which the sorting should be done by default.
* **Default column width** - The default width that all columns will have in pixels.
* **Database column window** - Modify how the columns will be shown in the table portlet.

The Add and Map All Columns adds a column or all columns and their respective values to what is displayed in the portlet.

* **Datasource Columns** - A list of all columns fetched from the query.
* **Column Name** - Set the display name of that column.
* **Width** - How wide (in pixels) the column should be, leave blank to use default.
* **Lov** - List of values, only used when you created a list of values.
* **Editor** - Set what kind of data you can input into the column cells.
* **Length** - todo
* **Editable** - Checkbox if this column is editable or not.
* **Hidden** - Checkbox whether to show the column or not.&#x20;

![](https://529897662-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M-tr9gyHZ1dle9oq2K4%2F-M-trFsAci-eBAAIBRTg%2Fhelp_root_clients_portal_portlets_table_Database_portletTableQuery.jpg?alt=media\&token=bcd8d0a9-1d5f-4d95-a0db-da506ce1a1ab)
