Skip to content

Query tables

Where: Settings › Query tables
Who can use it: Admins and Owners

Query tables decide which tables and views of a database Tursio can query. Access rules on a query table limit which rows and columns each user or role can see. Tursio answers only from the tables you approve, so a question can't reach data outside that scope.

The Query tables tab

The tab lists every query table with its Database, Table, Alias, All Columns, PIIs, and Measures. The count next to Query Table shows how many tables match your filters.

  • Type in Search by table, alias, or column to find a table.
  • Pick a database in the All databases dropdown to show only that database's tables. Each option shows how many query tables the database has. Tursio remembers your choice the next time you open the tab.

Query tables tab with the database filter open (1) Search, (2) database filter, (3) add a query table, (4) row menu.

Add a query table

  1. Select + on the Query tables tab, or Add query table when none exists.
  2. Pick a database in Select database. Only databases you've already connected appear.
  3. Pick the tables or views in Select tables. Tables that are already query tables don't appear.
  4. Select Add.

Tursio sorts each table's columns into these categories:

  • All Columns: used for grouping and filtering, for example category or date.
  • Measures: numeric values to aggregate, for example sales or count. A measure can also be used as a filter.
  • PIIs: sensitive data, for example SSN, email, or phone. PII columns can't be used as columns or measures.

Retrain to apply changes

Adding, editing, or deleting a query table marks the database for retraining. Tursio shows Changes detected in . Retrain this connection to keep search results accurate. Select Run training to apply your changes. See Training.

Add a Microsoft Excel table

For a database with the Microsoft Excel dialect:

  1. Select + and pick the Excel database in Select database.
  2. Enter a Table name. Use lowercase letters, numbers, and underscores only.
  3. Pick the Report type, for example Forecast Report.
  4. Upload the Excel file (.xlsx, up to 10 MB) in the predefined format.
  5. Select Add.

If the Excel file has errors, Tursio downloads an error log as query-table-errors.xlsx.

New Excel formats

Share a sample Excel file with the Tursio team for training. Once trained, that format is available as a report type for future uploads.

Edit a query table

  1. Open the row menu (⋯) on the query table and select Edit.
  2. Change the Alias name if needed. Use letters, numbers, dots (.), or underscores (_), up to 50 characters.
  3. Update the columns in Select All Columns, Select Measures, and Select PIIs. Select All Columns needs at least one column.
  4. Select Update.

The Database and Table can't be changed.

For a Microsoft Excel table, turn on Switch to upload mode to upload a new Excel file and pick its Report type. If the new file has errors, Tursio downloads query-table-errors.xlsx.

Delete a query table

  1. Open the row menu (⋯) on the query table and select Delete. To delete several, select their checkboxes and select the delete icon.
  2. Select Delete to confirm.

Deleting a query table

Deleting can't be undone. After you retrain, Tursio no longer queries the table.

Access rules

Access rules control what users and viewers see in a query table:

  • Table level access: turn it off to deny the whole table.
  • Row filter: a SQL condition. Only rows that match it appear in results (row-level security).
  • Column visibility: columns to hide from results (column-level security).

Each rule applies to specific users or to a role. Admins and Owners always have full access, so rules never apply to them.

Add an access rule

  1. Open the row menu (⋯) on the query table and select Manage table access.
  2. Select + Add rule.

Manage Table Access dialog with no rules yet (1) Add a rule.

  1. Keep Table level access on to limit rows or columns. Turn it off to deny the table entirely for the selected users or groups.
  2. Enter a Row filter, for example region = 'EU'. Only rows that match the condition appear in results.
  3. Pick columns in Column visibility to hide them from results.
  4. Choose who the rule Applies to: Specific users or Specific groups.

Rule with a row filter and a hidden column (1) Table level access, (2) Row filter, (3) Column visibility, (4) Applies to.

  1. Pick the users or groups. Select users lists Users and Viewers by name and email. Select groups offers the User and Viewer roles.

Select users list in an access rule (1) Applies to, (2) Select users.

  1. Select Save changes. Tursio shows Access rules updated. Changes will apply to new queries. and marks the database for retraining.
  2. Retrain the database. Select Run training, pick the database, and keep Incremental. See Training.

After training, a question from a user the rule applies to returns only the allowed rows and never the hidden columns. A question that asks only for hidden data returns No results found, please try again.

Edit or remove access rules

  1. Open the row menu (⋯) and select Manage table access.
  2. Change a rule, or select the delete icon on a rule to remove it. Select + Add rule to add another.
  3. Select Save changes, then retrain the database.

Tips and limits

  • A rule with Table level access on needs a row filter or at least one hidden column. Otherwise Tursio shows Add a row filter or select at least one column to hide.
  • A rule needs at least one user or group.
  • You can't hide every column of a table. At least one must stay visible.
  • A row filter must be a single condition with no subqueries, such as COLUMN = 'value'. Combine conditions with AND or OR.
  • When several rules apply to the same person, Tursio applies all of them: row filters combine with AND, and hidden columns add up.
  • Access rules work on schema-qualified tables, for example sales.orders.
  • For a database with a Sync access workflow, the workflow manages table access and Manage table access doesn't appear. See Workflows.
  • You can't save access rules while the database is training.
  • Access rules don't change permissions in your database. Tursio applies them to the SQL it generates, and your database's own grants stay as they are.