Learn about supported databases and how to configure connections.
The Embeddable CLI supports connections to:
- PostgreSQL
- MySQL
- BigQuery
- Snowflake
- Amazon Redshift
The easiest way to create a connection:
embed database connectThis will prompt you for:
- Database type
- Connection details (host, port, credentials, etc.)
- Test the connection before saving
For scripting or automation, use JSON configuration:
# Inline JSON
embed database connect --json '{"name":"prod-db","type":"postgresql",...}'
# From file
embed database connect --file connection.json{
"name": "postgres-prod",
"type": "postgresql",
"host": "localhost",
"port": 5432,
"database": "myapp",
"username": "readonly_user",
"password": "secure_password"
}{
"name": "mysql-prod",
"type": "mysql",
"host": "mysql.example.com",
"port": 3306,
"database": "analytics",
"username": "readonly_user",
"password": "secure_password"
}BigQuery requires a service account JSON configuration:
{
"name": "bigquery-prod",
"type": "bigquery",
"config": {
"type": "service_account",
"project_id": "your-project-id",
"private_key_id": "key-id",
"private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
"client_email": "service-account@your-project.iam.gserviceaccount.com",
"client_id": "123456789",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token"
}
}{
"name": "snowflake-prod",
"type": "snowflake",
"config": {
"account": "your-account.snowflakecomputing.com",
"username": "readonly_user",
"password": "secure_password",
"warehouse": "COMPUTE_WH",
"database": "ANALYTICS_DB",
"schema": "PUBLIC"
}
}{
"name": "redshift-prod",
"type": "redshift",
"config": {
"host": "redshift-cluster.abc123.region.redshift.amazonaws.com",
"port": 5439,
"database": "analytics",
"username": "readonly_user",
"password": "secure_password"
}
}embed database listShows all configured connections with their details.
# Test specific connection
embed database test <connection-id>
# Test during creation (default)
embed database connect
# Skip test during creation
embed database connect --skip-testembed database remove <connection-id>Create dedicated read-only users for Embeddable:
PostgreSQL:
-- Create read-only user
CREATE USER embeddable_readonly WITH PASSWORD 'secure_password';
-- Grant schema usage
GRANT USAGE ON SCHEMA public TO embeddable_readonly;
-- Grant select on all tables
GRANT SELECT ON ALL TABLES IN SCHEMA public TO embeddable_readonly;
-- Grant select on future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO embeddable_readonly;MySQL:
-- Create read-only user
CREATE USER 'embeddable_readonly'@'%' IDENTIFIED BY 'secure_password';
-- Grant select permissions
GRANT SELECT ON myapp.* TO 'embeddable_readonly'@'%';
FLUSH PRIVILEGES;- Firewall Rules: Only allow connections from Embeddable's IP ranges
- SSL/TLS: Always use encrypted connections when possible
- VPN/Private Networks: Consider using private networking for sensitive data
- IP Whitelisting: Restrict database access to specific IP addresses
- Rotate Passwords: Regularly update database passwords
- Strong Passwords: Use complex, unique passwords
- Service Accounts: Use dedicated service accounts for BigQuery
- Least Privilege: Grant only necessary permissions
The CLI automatically tests connections when creating them. Test failures show helpful error messages:
Connection Refused:
- Check host and port are correct
- Verify database server is running
- Check firewall rules
Authentication Failed:
- Verify username and password
- Check user has connection permissions
- Ensure user exists in the database
Database Not Found:
- Verify database name is correct
- Check user has access to the database
- Ensure database exists
Timeout:
- Check network connectivity
- Verify firewall rules
- Ensure database accepts connections
For high-traffic applications, consider connection pooling settings in your database configuration.
Enable SSL for secure connections:
PostgreSQL with SSL:
{
"name": "postgres-ssl",
"type": "postgresql",
"host": "secure-db.example.com",
"port": 5432,
"database": "myapp",
"username": "user",
"password": "pass",
"ssl": true
}Use non-standard ports when needed:
{
"name": "custom-port-db",
"type": "postgresql",
"host": "db.example.com",
"port": 5433,
"database": "myapp",
"username": "user",
"password": "pass"
}For connection issues, see the Troubleshooting Guide.
For examples of complete database setup workflows, see Examples.