Database Connections
Database connections let Precision Bridge read from and write to relational databases. PostgreSQL, MySQL, SQL Server, Oracle, and SQLite are supported.
Creating a Database Connection
- Navigate to the Connections page and click New Connection.
- Select the Database adaptor.
- Choose the Database Type, and the Driver beside it if the type offers driver options.
- Enter the connection details.
By default, you enter the connection details in individual field inputs — host, port, username, password, schema, and database.
To supply a full connection string instead, enable the Enter custom SQLAlchemy connection string toggle. The form then shows a template connection string for the selected database type, which you can edit.
Connection string formats:
| Database | Format |
|---|---|
| PostgreSQL | postgresql+asyncpg://username:password@host:5432/database |
| MySQL | mysql+aiomysql://username:password@host:3306/database |
| SQL Server | mssql+aioodbc://username:password@host:1433/database?driver=ODBC+Driver+18+for+SQL+Server&TrustServerCertificate=yes |
| Oracle | oracle+oracledb://username:password@host:1521/?service_name=your_service_name |
| SQLite | sqlite+aiosqlite:///<absolute path to .db file> |
- For SQL Server, the
driverandTrustServerCertificatequery parameters are required for compatibility with the ODBC Driver 18 that ships in the Precision Bridge container. If you omit them, sensible defaults are injected automatically. - For Oracle,
service_nameis passed as a query parameter, not as the database path. - For SQLite, the connection is a single file on the Precision Bridge host. The form shows a File Path field instead of host/credentials; supply the absolute path to the
.dbfile (mounted into the container if running under Docker).
Connecting to a Local Database
When Precision Bridge runs inside Docker, localhost and 127.0.0.1 refer to the container itself, not the machine running Precision Bridge. To handle this, the Redirect localhost to host machine toggle is enabled by default in Docker. You can enter localhost or 127.0.0.1 as normal, and Precision Bridge automatically rewrites it to host.docker.internal when it connects — no manual change is needed.
If you disable the toggle, localhost is left as-is and points at the container, so enter host.docker.internal yourself instead. The form shows a warning if it detects a localhost address while the toggle is off.
When Precision Bridge is not running in Docker, no redirection occurs and localhost refers to the host machine as usual.
Testing the Connection
After saving, use Test to verify the credentials and host are reachable. Test a connection before building migrations against it, so that schema and credential problems surface early rather than during execution.
SSL and Certificates
If your database requires a custom or internal certificate authority, upload the CA certificate under Preferences → SSL Certificates rather than disabling verification. For SQL Server, the TrustServerCertificate=yes parameter in the connection string controls server-certificate trust; when you enter SQL Server details in the individual fields, the Trust Server Certificate toggle provides the same control. It is on by default, as most SQL Server installations use self-signed certificates. See SSL Certificates for details.
Table Metadata
Database connections cache table and field metadata for faster project loading. The Metadata tab provides the cache controls, and the Connection Explorer lets you browse tables and records once the connection is configured. See Table Metadata and Caching and Connection Explorer.
Comments
0 comments
Please sign in to leave a comment.