Add a New Connection
Add a New Connection
This guide will walk you through adding database connections to LuceData. You can connect to SQL Server, PostgreSQL, and SQLite databases.
Supported Databases
Database | Status | Notes |
---|---|---|
SQL Server | β Available | All versions supported (2012+) |
PostgreSQL | β Available | Versions 10+ supported |
SQLite | β Available | Local file-based databases |
Oracle | π§ Coming Soon | Planned for future release |
MySQL | π§ Coming Soon | Planned for future release |
Before You Begin
Make sure you have:
- Connection credentials: Host/server address, username, password
- Network access: Firewall rules allow connections from your computer
- Database permissions: Appropriate permissions for the operations you'll perform
π‘ Tip: Start with read-only permissions while learning LuceData, then grant write permissions when ready.
Adding a Connection
Step 1: Open the Connection Dialog
- Look for the Connections panel on the left side
- Click the "+" (Add Connection) button at the top of the panel
- The "Add New Connection" dialog will open
Step 2: Select Database Type
Choose your database type from the tabs:
- SQL Server - Microsoft SQL Server
- PostgreSQL - PostgreSQL database
- SQLite - Local SQLite file
SQL Server Connection
Basic Connection
Fields:
- Connection Name: A friendly name (e.g., "Production Database", "Dev SQL Server")
- Server: Server address or hostname
- Examples:
localhost
,192.168.1.100
,sql.example.com
,server.database.windows.net
(Azure)
- Examples:
- Port: Default is
1433
(leave empty to use default) - Authentication Type:
- SQL Server Authentication (username/password)
- Windows Authentication (current Windows user)
- Username: SQL Server login name (if using SQL Server Authentication)
- Password: SQL Server password
- Database: (Optional) Specific database to connect to
- Leave empty to connect to default database and see all databases
Example - Local SQL Server:
Connection Name: Local SQL Server
Server: localhost
Port: 1433
Authentication: SQL Server Authentication
Username: sa
Password: YourPassword123!
Database: (leave empty)
Example - Azure SQL Database:
Connection Name: Azure Production
Server: myserver.database.windows.net
Port: 1433
Authentication: SQL Server Authentication
Username: sqladmin
Password: YourSecurePassword!
Database: ProductionDB
Advanced Options
Click "Advanced" to configure additional settings:
- Connection Timeout: Seconds to wait for connection (default: 15)
- Encrypt Connection: Enable SSL/TLS encryption (recommended for cloud)
- Trust Server Certificate: Skip certificate validation (local dev only)
- Application Name: Identifier shown in SQL Server logs (default: "LuceData")
- Multi-Subnet Failover: Enable for SQL Server AlwaysOn configurations
Named Instance Connection
For SQL Server named instances:
Server: localhost\SQLEXPRESS
or
Server: MYSERVER\INSTANCE1
PostgreSQL Connection
Basic Connection
Fields:
- Connection Name: A friendly name (e.g., "Postgres Dev", "Production PG")
- Host: Server address or hostname
- Examples:
localhost
,192.168.1.100
,postgres.example.com
- Examples:
- Port: Default is
5432
- Username: PostgreSQL username
- Password: PostgreSQL password
- Database: Database name to connect to (required)
- Common default:
postgres
- Common default:
- SSL Mode:
- Disable: No SSL (local dev only)
- Require: Require SSL connection (recommended)
- Verify-CA: Verify certificate authority
- Verify-Full: Full certificate verification
Example - Local PostgreSQL:
Connection Name: Local Postgres
Host: localhost
Port: 5432
Username: postgres
Password: yourpassword
Database: mydb
SSL Mode: Disable
Example - Cloud PostgreSQL (AWS RDS, Azure, etc.):
Connection Name: Production PG
Host: mydb.abc123.us-east-1.rds.amazonaws.com
Port: 5432
Username: dbadmin
Password: SecurePassword123!
Database: production
SSL Mode: Require
Advanced Options
- Connection Timeout: Seconds to wait for connection (default: 15)
- Application Name: Identifier in PostgreSQL logs
- Schema: Default schema to use (default:
public
) - Search Path: Schema search order (e.g.,
public,custom
)
SQLite Connection
Basic Connection
Fields:
- Connection Name: A friendly name (e.g., "My Local DB", "Test Database")
- File Path: Path to the SQLite database file
- Click "Browse" to select a file
- Or type the path manually
- Create if not exists: Check this to create a new database file if it doesn't exist
Example - Existing Database:
Connection Name: App Database
File Path: /Users/yourname/Documents/myapp.db
Create if not exists: β
Example - New Database:
Connection Name: Test Database
File Path: /Users/yourname/Documents/test.db
Create if not exists: β
Advanced Options
- Read-Only Mode: Open database in read-only mode (prevents all writes)
- Busy Timeout: Milliseconds to wait when database is locked (default: 5000)
Step 3: Test the Connection
Before saving:
- Click the "Test Connection" button
- LuceData will attempt to connect to your database
- You'll see one of these results:
- β Success: Connection works! Database info displayed.
- β Error: Review the error message and fix the issue.
Common Errors:
Error | Solution |
---|---|
Cannot connect to server | Check server address, port, and network connectivity |
Login failed | Verify username and password are correct |
Database does not exist | Check database name spelling or create the database first |
Connection timeout | Check firewall rules and increase timeout in Advanced settings |
SSL/TLS error | Adjust SSL settings or install required certificates |
Step 4: Set Permissions
Configure what operations are allowed for this connection:
- Allow Read Operations (SELECT): β Always recommended
- Allow Write Operations (INSERT, UPDATE, DELETE): β οΈ Enable if you need to modify data
- Allow DDL Operations (CREATE, ALTER, DROP): β οΈ Enable if you need to modify schema
π Security Note:
- Start with read-only (SELECT only) while learning
- Enable write operations only when needed
- DDL operations can modify or delete entire tablesβuse with caution
- All operations require your explicit confirmation before execution
Recommended Permission Sets:
For Exploring/Learning:
β
Allow Read Operations
β Allow Write Operations
β Allow DDL Operations
For Development Work:
β
Allow Read Operations
β
Allow Write Operations
β
Allow DDL Operations
For Production (Read-Only Reporting):
β
Allow Read Operations
β Allow Write Operations
β Allow DDL Operations
Step 5: Save the Connection
- Review all settings
- Click "Save"
- The connection will appear in the Connections panel
- Click the connection to expand and explore your databases
Managing Connections
Editing a Connection
- Right-click the connection in the Connections panel
- Select "Edit Connection"
- Modify the settings
- Click "Test Connection" to verify changes
- Click "Save"
Deleting a Connection
- Right-click the connection in the Connections panel
- Select "Delete Connection"
- Confirm the deletion
π‘ Note: Deleting a connection does not affect the actual databaseβit only removes it from LuceData.
Duplicating a Connection
Useful for creating connections to different databases on the same server:
- Right-click the connection
- Select "Duplicate Connection"
- Modify the new connection (e.g., change database name)
- Click "Save"
Connection Groups
Organize connections into groups:
- Right-click in the Connections panel
- Select "New Group"
- Name the group (e.g., "Production", "Development", "Staging")
- Drag and drop connections into the group
Connection Security
Credential Storage
- All credentials are stored locally on your device
- Encrypted using industry-standard encryption
- We do not have access to your credentials
- Credentials are never transmitted to LuceData servers
Best Practices
β Do:
- Use strong, unique passwords for each database
- Enable SSL/TLS encryption for remote connections
- Use read-only accounts when write access isn't needed
- Regularly rotate database passwords
- Use service accounts (not personal accounts) for production
β Don't:
- Share credentials with others
- Use the same password across multiple databases
- Connect to production databases without proper authorization
- Disable SSL encryption for internet-facing databases
Troubleshooting
Cannot Connect to SQL Server
Check:
- SQL Server service is running
- TCP/IP protocol is enabled in SQL Server Configuration Manager
- Firewall allows port 1433 (or your custom port)
- SQL Server Browser service is running (for named instances)
- Mixed mode authentication is enabled (for SQL auth)
Test connectivity:
# Windows
Test-NetConnection -ComputerName localhost -Port 1433
# macOS/Linux
nc -zv localhost 1433
Cannot Connect to PostgreSQL
Check:
- PostgreSQL service is running
postgresql.conf
haslisten_addresses
set correctlypg_hba.conf
allows your IP address- Firewall allows port 5432
- SSL certificates are valid (if using SSL)
Test connectivity:
# Test connection (with psql installed)
psql -h localhost -U postgres -d postgres
# Test port
nc -zv localhost 5432
SQLite File Not Found
Check:
- File path is correct (absolute path recommended)
- You have read permissions on the file
- File extension is correct (usually
.db
,.sqlite
,.sqlite3
) - Check "Create if not exists" to create a new database
Slow Connections
Solutions:
- Reduce connection timeout
- Check network latency (for remote databases)
- Use connection pooling (in Advanced settings)
- Place SQLite files on local drives (not network shares)
"Too many connections" Error
Solutions:
- Close unused connections
- Check your database's max connections limit
- Reduce connection timeout to release connections faster
Advanced Topics
Connection Strings
For advanced users, you can use connection strings directly:
SQL Server:
Server=myserver;Database=mydb;User Id=sa;Password=pass;
PostgreSQL:
Host=myserver;Port=5432;Database=mydb;Username=user;Password=pass;
SSH Tunneling
To connect to databases behind firewalls via SSH tunnel:
- Set up SSH tunnel in terminal:
ssh -L 5432:localhost:5432 user@jumphost.example.com
- In LuceData, connect to
localhost:5432
π§ Coming Soon: Built-in SSH tunnel support in LuceData!
Next Steps
Now that you've added a connection:
- β Using the Connections Tree - Navigate your database objects
- β Using the Work Area - Write and execute queries
- β Using the AI Assistant - Generate SQL with natural language
Need help? Contact us at support@lucedata.com