Skip to main content

Configuration Overview

Queryly stores all configuration files in a dedicated directory in your home folder. This keeps your database connections organized and portable across sessions.

Configuration Directory

Location by Platform

Queryly automatically creates and manages configuration files in platform-specific locations:
C:\Users\<username>\.queryly\
The configuration directory is created automatically when you first run Queryly. No manual setup is required.

Configuration Files

connections.json

This file stores all your saved database connections, including connection strings, metadata, and usage history. File Location:
  • Windows: C:\Users\<username>\.queryly\connections.json
  • macOS/Linux: ~/.queryly/connections.json

File Structure

{
  "connections": [
    {
      "id": "abc123...",
      "name": "LocalDB",
      "dbType": "SQLite",
      "connectionString": "Data Source=./myapp.db",
      "lastUsed": "2025-12-13T10:30:00Z",
      "isFavorite": false,
      "metadata": {}
    }
  ],
  "activeConnectionId": "abc123..."
}

Field Descriptions

FieldTypeDescription
idstringUnique identifier for the connection (auto-generated)
namestringDisplay name for the connection
dbTypestringDatabase type: SQLite, PostgreSQL, MySQL, or SqlServer
connectionStringstringDatabase-specific connection string
lastUsedstringISO 8601 timestamp of last usage
isFavoritebooleanWhether this connection is marked as favorite
metadataobjectAdditional custom metadata (optional)
activeConnectionIdstringID of the currently active connection

Connection String Formats

SQLite

Data Source=path/to/database.db
Common Examples:
Data Source=./mydb.db

PostgreSQL

Host=localhost;Database=mydb;Username=postgres;Password=secret
Common Examples:
Host=localhost;Database=myapp;Username=postgres;Password=mypass

MySQL

Server=localhost;Database=mydb;User=root;Password=secret
Common Examples:
Server=localhost;Database=myapp;User=root;Password=mypass

SQL Server

Server=localhost;Database=mydb;User Id=sa;Password=secret;TrustServerCertificate=True
Common Examples:
Server=localhost;Database=myapp;User Id=sa;Password=YourPassword123;TrustServerCertificate=True

Manual Configuration

Editing connections.json

You can manually edit the connections.json file to:
  • Bulk import connections
  • Update connection strings
  • Modify metadata
  • Set favorites
1

Locate the configuration file

Find your connections.json file:
# macOS/Linux
cd ~/.queryly

# Windows
cd C:\Users\<username>\.queryly
2

Open in a text editor

Use your preferred text editor:
# macOS/Linux
nano connections.json

# Or use VS Code
code ~/.queryly/connections.json
3

Make your changes

Edit the JSON carefully, ensuring valid JSON syntax:
{
  "connections": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "ProductionDB",
      "dbType": "PostgreSQL",
      "connectionString": "Host=prod.example.com;Database=app;Username=admin;Password=secret",
      "lastUsed": "2026-03-12T00:00:00Z",
      "isFavorite": true,
      "metadata": {
        "environment": "production",
        "team": "backend"
      }
    }
  ],
  "activeConnectionId": "550e8400-e29b-41d4-a716-446655440000"
}
4

Test your connection

Verify the connection works:
queryly connect test ProductionDB
Always validate your JSON before saving. Invalid JSON will cause Queryly to fail on startup. Use a JSON validator or editor with syntax checking.

Backup and Migration

Backing Up Configuration

Regularly backup your connections.json file to avoid losing connection information.
# Create a backup
cp ~/.queryly/connections.json ~/.queryly/connections.backup.json

# Or copy to a safe location
cp ~/.queryly/connections.json ~/Documents/queryly-backup-2026-03-12.json

Migrating to a New Machine

1

Export from old machine

Copy your configuration file:
cp ~/.queryly/connections.json ~/queryly-export.json
2

Transfer the file

Move the file to your new machine using your preferred method (USB, cloud storage, etc.)
3

Import on new machine

Install Queryly on the new machine, then copy the configuration:
# Create the config directory if it doesn't exist
mkdir -p ~/.queryly

# Copy the exported file
cp ~/queryly-export.json ~/.queryly/connections.json
4

Verify connections

List connections to verify import:
queryly connect list

Resetting Configuration

To start fresh, simply delete the configuration directory:
# macOS/Linux
rm -rf ~/.queryly

# Windows (PowerShell)
Remove-Item -Recurse -Force $env:USERPROFILE\.queryly
This will permanently delete all saved connections. Make a backup first if you might need to restore them.

Security Considerations

Connection String Security

Connection strings in connections.json are stored in plain text, including passwords. Protect this file appropriately.
Best Practices:
  1. File Permissions - Restrict access to your home directory:
    chmod 600 ~/.queryly/connections.json
    
  2. Avoid Storing Production Credentials - Use environment-specific credentials and regenerate passwords regularly
  3. Use Read-Only Accounts - Create database users with minimal permissions for browsing
  4. Backup Securely - Encrypt backups containing connection information:
    # Encrypt backup (macOS/Linux)
    gpg -c ~/.queryly/connections.json
    

Configuration Tips

Organize with Names: Use descriptive connection names like Local-Dev-SQLite, Staging-PostgreSQL, Production-MySQL to easily identify connections.
Test Before Saving: Queryly automatically tests connections before saving them. If a test fails, verify your connection string format.
Use Relative Paths for SQLite: For portable SQLite databases, use relative paths like Data Source=./myapp.db instead of absolute paths.

Next Steps

Build docs developers (and LLMs) love