How to specify importing into a specific database when using TiDB Lightning

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: iDB Lightning 在导入的时候怎么指定导入到特定的库

| username: Hacker_51kSf0Ag

[TiDB Usage Environment] Production Environment / Testing / PoC
Production Environment
[TiDB Version]
7.1.2
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Issue Phenomenon and Impact]
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots / Logs / Monitoring]

| username: tidb菜鸟一只 | Original post link

Is the imported file an SQL file or a CSV file?

| username: 小龙虾爱大龙虾 | Original post link

Use rename to change the name of the imported file and modify the database name.

| username: peng-xin | Original post link

Add routes to the task toml file

[[routes]]
# Table routes
schema-pattern = "source_db"
table-pattern = "source_table"
target-schema = "target_db"
target-table = "target_table"
| username: TIDB-Learner | Original post link

Reference documentation:

| username: dba远航 | Original post link

The target schema is the specified database to be imported.

| username: peng-xin | Original post link

The configuration list in the new version of the documentation does not mention anything related to routes. I’m not sure if it was omitted. The old version still has it.

https://docs.pingcap.com/zh/tidb/v7.4/tidb-lightning-configuration
| username: wangccsy | Original post link

First time learning about TiDB, currently making an effort to understand it.

| username: FutureDB | Original post link

You can check the table and database filtering methods. Use the -f or --filter parameter to specify the database to import.

Reference: 表库过滤 | PingCAP 归档文档站

| username: 烂番薯0 | Original post link

There is a filter.