Skip to main content

Work with a SQLite resource database

When you add a SQLite file to a Knowledge, Rational AI loads it into a database that belongs to the Knowledge. The resource viewer then opens that database instead of a file preview, so you can browse tables, run SQL, and filter and sort rows in the Control Room. Administrators can also edit the data.

Before you begin​

  • A Knowledge with a SQLite file in it, processed. See Add and manage content in a Knowledge.
  • Role: Read on the Knowledge row of your role. Changing data needs an administrator account. For everyone else the viewer shows Read only, and SQL statements run as read-only queries.

Open the viewer​

  1. Go to Knowledge and select the card of the Knowledge.
  2. In the Grid, select the open icon at the start of the SQLite resource's row.

Browse tables and views​

Each table, view, or query you open becomes a tab.

  1. Select + (Open table or query) and pick a table or view. Use Search tables… to narrow the list.
  2. Select a column header to sort by that column. Hover over it to see the column type.
  3. To filter, select the filter icon in a column header, enter a value, and select Apply. With more than one filter, select AND to switch to OR.

To see the statement that defines a table or view, open + Actions and select View schema.

Run SQL​

  1. Select +, then New SQL query. + Actions → New query does the same.
  2. Enter a statement. Put names that contain spaces in double quotes, for example "Location HQ".
  3. Select Run, or press Cmd+Enter (Ctrl+Enter on Windows and Linux).

If the result has more rows than the server returns, only the first rows show and the tab is marked truncated. Add a LIMIT or WHERE clause to narrow it. Administrators can select Save query as view to keep the query as a SQL view.

Edit data​

You need an administrator account. Views are always read-only.

  1. In a table tab, double-click a cell and change its value.
  2. Select Save changes to write your edits, or Discard to drop them.

For administrators, + Actions also holds Add row, Delete selected, New table…, and Drop table. Everyone can use Export CSV, Export JSON, and Export SQL inserts in the same menu.

Next steps​