# Manage data sources, files, and training sets

Update connections and synchronization scopes, and manage files, training sets, and metadata.

使用指南 · 模块: data · 使用者 · 部署形态：资料未说明 · 已确认产品版本：资料未说明 · 来源：现有文档

Use a data source's detail and settings pages to change its name, connection, and synchronization scope, and to manage uploaded files and training data.

## Before you start

| Item         | Requirement                                                                                           |
| ------------ | ----------------------------------------------------------------------------------------------------- |
| Permissions  | Project owner or administrator                                                                        |
| Prerequisite | A data source has been created; see [Connect data sources](https://docs.asktable.com/en/data/connect) |
| Entry point  | Main navigation on the left → “More” → “Data sources” → open a data source card                       |

## Steps

**Get to know the three areas of the detail page**

Opening a data source shows three areas:

- Header: breadcrumbs (“All data sources” → source name → “Settings”), status indicator, and main action buttons.
- Left sidebar: fixed “Basic information” and “Training set” entries. When the source is available, a search box and database/table tree appear below; search filters by table name.
- Right side: the currently selected content.

The main header action depends on the source type: “Reselect tables” for databases, “File management” for Excel. “Settings” is on the far right.

The status indicator shows available, synchronizing, initializing, or unavailable. Click it to see the last synchronization time and error details; after an error, a “Reinitialize” or “Resync” button appears at the bottom.

**Change the name and description**

Click “Basic information” in the sidebar. Edit the source name directly in its input; it saves on blur. The description is a two-line text box that also saves on blur.

Descriptions have a 255-character limit. Exceeding it turns the bottom-right counter red and prevents saving. The same page shows the read-only type, ID with a copy button, database/table statistics, and creation time.

**Change connection settings (databases)**

Click “Settings” in the header. The “Connection configuration” section shows the host, username, and database. “Edit” opens a dialog for changes; “Test connection” checks the current configuration at any time.

Leave the password blank to keep it unchanged.

**Change synchronized tables (databases)**

Click “Reselect tables” in the header, update the selection in the dialog, and click “Confirm selection (N)”. Tables already in metadata are selected by default. The button is disabled during synchronization.

You do not need to resynchronize the whole source when one table's structure changes. Open that table's “Field structure” page and click “Resync” below its name. This refreshes only that table's structure and statistics, preserving manual annotations. A notification confirms that refreshing has started.

**Manage uploaded files (Excel)**

Click “File management” in the header. The dialog is titled “File management” and shows “File list (N)”.

Click “Select files” to add files; new rows have a new-file badge. Existing files can be previewed, downloaded, or deleted. Removed rows appear below with a warning that they will be permanently removed after saving. Click “Save changes” when done.

**Maintain the training set**

Click “Training set” in the sidebar. Table columns are user question, correct SQL, source, creation time, enabled status, and actions. The source column shows manually added or positive feedback.

Use “Add training data” at the top right to create an entry. Each row's switch controls whether it is active; hovering reveals edit and delete buttons. Search filters by question or SQL.

**Export or import metadata**

Click “Settings” in the header and find “Metadata”:

- “Export” opens “Confirm metadata export”, explaining that field descriptions, field visibility, and training data will be exported. Confirm to download JSON.
- “Import” lets you select a JSON file. Import overwrites field descriptions and visibility, while training data is appended without deleting existing entries.

The same section has “dbt semantic layer”. Click “Export YAML” to export the source's entities and dimensions as dbt YAML.

**Delete a data source**

Click “Settings” in the header and find “Delete data source” in the bottom “Danger zone”. The “···” menu on each source card also offers “Quick conversation” and “Delete data”. Deletion requires confirmation and cannot be undone afterward.

Deleting removes only the AskTable data source and its configuration. The database or file itself is unaffected.

## Key constraints

| Item                           | Value or default                                                                                                                    | Where to change it                                                                                                                           |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| Data source description length | Maximum 255 characters; exceeding it turns the counter red and prevents saving                                                      | Description in “Basic information”                                                                                                           |
| Query timeout                  | Each source inherits the global default (30 seconds) unless overridden; accepts 1–300 seconds and rejects values outside that range | Data source → “Settings” → Query timeout (seconds); global value: avatar menu → “Settings” → “Data sources” → Global query timeout (seconds) |
| Tables per data source         | 100 by default                                                                                                                      | Avatar menu → “Settings” → “Data sources” → Maximum tables per source (applies to cloud deployments)                                         |
| Training data uniqueness       | Questions must be unique within a source; duplicate writes are rejected by the database                                             | —                                                                                                                                            |
| Training SQL validation        | Read-only, parseable, no SELECT \*, schema-qualified table names, and tables already present in metadata                            | —                                                                                                                                            |
| Metadata import effects        | Overwrites descriptions and visibility; appends training data without deleting existing entries                                     | “Settings” → “Metadata” → “Import”                                                                                                           |
| File deletion                  | Permanent after saving                                                                                                              | “File management” dialog                                                                                                                     |
| Build Value Index              | Requires an available data source                                                                                                   | “Settings” → “Index maintenance”                                                                                                             |
| Data source deletion           | Irreversible after confirmation                                                                                                     | “Settings” → “Danger zone”, or source card menu                                                                                              |

These values are defaults and can be adjusted in the administration console, except training-data validation rules.

## Troubleshooting

| Symptom                                    | How to identify it                                                      | What to do                                                                                                                 |
| ------------------------------------------ | ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| Card keeps spinning                        | Hovering over the status says analyzing metadata or queued              | The list refreshes every 3 seconds; wait for completion. If it stalls, click the status indicator for error details        |
| Metadata parsing fails                     | Status says metadata analysis failed, or the header shows unavailable   | Click the status indicator for the error; file sources can use “Reinitialize” to rerun                                     |
| Some sheets are missing                    | The status dialog lists unparseable sheets with reasons and suggestions | Fix the file as indicated and upload again                                                                                 |
| “Reselect tables” is disabled              | Source is synchronizing                                                 | Wait for synchronization to finish                                                                                         |
| Description changes are not saved          | Counter exceeds 255 and turns red                                       | Shorten it to no more than 255 characters                                                                                  |
| Cannot save training data                  | SQL fails validation or a table is absent from metadata                 | Ensure read-only SQL, schema-qualified names, and completed metadata synchronization for the tables                        |
| Import reports skipped items               | Import completes but lists items that were not found                    | The target has no matching database/table/field names; check the reported missing schemas, tables, and fields              |
| Descriptions remain unchanged after import | A file source has a database name such as file\_abc1                    | File-source schema names are system-generated, not filenames; check the import file's schema\_name against that identifier |

## Next steps

- Add business meaning to table and field names: [Table and field descriptions](https://docs.asktable.com/en/data/semantics)
- Have AI ignore or mask sensitive columns: [Field hiding and masking](https://docs.asktable.com/en/data/hidden-fields)
- Query values using abbreviations: [AI indexes](https://docs.asktable.com/en/data/ai-search)
- Add another source: [Connect data sources](https://docs.asktable.com/en/data/connect)
