Skip to content

Connect your CRM starting from the database

This page covers connecting your CRM database to Lovrabet and starting structure analysis. Lovrabet can currently connect only to publicly accessible databases; for databases on an internal network, first open public access, configure a security allowlist, or route access through your own network solution before connecting.

Who this is for

Implementation engineers and technical leads.

Prepare the database connection details

Have the following ready before you start:

ItemExampleNotes
Database typeMySQL / PostgreSQLChoose your actual database
Host and Portdb.example.com:3306Must be a public address Lovrabet can reach
Database namecrm_demoThis tutorial uses a CRM database
Username and passwordProvided by your DBAMust include permission to read the table structure
AllowlistLovrabet access IPsRequired when the database restricts source IPs

Steps: connect the database

  1. Open App Management for the app "Your CRM Example App".
  2. Open Database Connector.

The Database Connector page under App Management of "Your CRM Example App"...

  1. Click to add a database connection.
  2. Select the database type.
  3. Enter the Host, Port, database name, username, and password.

The form for adding a database connection. A banner at the top notes that only public databases are currently supported, enterprise intranet connections are in development, and a help link for configuring the IP allowlist is provided...

  1. Click Save.

Test the database connection

  1. Click Test Connection.

The "Bound Database Connections" section of the database connection settings, showing a connection named "crm_demo" with ID 10315...

  1. If the test fails, first check that the database is publicly accessible, then check the allowlist, username, password, and port.

Start the analysis

  1. Find the database connection you just saved in Database Connector.
  2. Click Analyze or Smart Analysis.
  3. Wait for the analysis to finish.

The saved database connections and analysis options in Database Connector...

  1. When the analysis finishes, confirm the status shows success.

How you know it's done

  • The database analysis status shows success.
  • Datasets from the analysis are visible in Dataset Overview.
  • Dataset names map to everyday business records.

The Dataset Overview page in Lovrabet, listing datasets under "DB: crm_demo" in the left sidebar, such as "跟进记录" (Follow-up Records) and "客户" (Customers)...

If the connection or analysis fails

SymptomCheck
Connection test failsCheck the Host, Port, username, and password
"Network unreachable" errorConfirm the database is publicly accessible
"Access denied" errorAdd Lovrabet's access IPs to the database allowlist
Saved successfully but no datasetsCheck whether the smart analysis has finished
Dataset names are confusingOpen the dataset details and note the fields that need renaming
Relations between tables are unclearGo to Dataset Overview and open Customers, Opportunities, and Follow-up Records one by one

Claude Code prompt

text
请使用 rabetbase 检查目标应用的数据库连接和分析状态。
按顺序执行:
1. rabetbase db list --appcode <你的应用 appCode> --format compress
2. 如果已经有数据库连接,记录 connections[].id 和 latestAnalysisStatus
3. 如果分析未完成,输出 rabetbase db analyze-start --id <连接ID> --appcode <你的应用 appCode> --format compress
4. 如果分析已经完成,再执行 rabetbase dataset list --appcode <你的应用 appCode> --format compress
5. 再执行 rabetbase dataset links --appcode <你的应用 appCode> --format compress
只输出数据库名称、连接状态、分析状态、数据集清单和下一步命令。
本轮不创建、不更新、不删除数据库连接;需要新建连接时先输出 dry-run 命令。

Next steps

Continue to "2. Query system data".

基于飞书知识库同步生成,内容以飞书源文档为准