Skip to content

SQL Datasource

A SQL datasource is a connection definition for a database outside the platform. Once defined, scripts, reports and saved queries reach it by name.

The SQL Datasource screen

FieldDescription
NameThe datasource’s name; scripts and queries call it by this (max 100 characters)
DescriptionDescription (max 255 characters)
URLThe JDBC connection address (max 2,048 characters)
UsernameThe user name (max 50 characters)
PasswordThe password (max 50 characters)
Is DefaultWhether this is the project’s default datasource

The list shows whether a password is set, not the password itself. It is stored encrypted and never handed back to be read. When you edit the record the password field comes up empty: leaving it empty keeps the existing password, and it changes only when you type a new one.

The datasource marked Is Default is where a query that does not name one goes:

ins.runSql('SELECT ...'); // the default datasource
ins.runSql('ProductionDB', 'SELECT ...'); // by name

Mark only one datasource in a project as the default. Marking a second does not unmark the first, and a call that names no datasource then cannot tell which one it means. The clone button is the easiest way into that state, because it copies every field including Is Default — after cloning, clear the flag on the copy.

Datasource addresses are subject to an allow-list, given as ins.datasource.allowed-hosts. It takes comma-separated hostnames (db.example.com), wildcard subdomains (*.example.com) and CIDR blocks (10.0.0.0/8).

CaseResult
List empty (the default)No address is permitted
Address matches the listPermitted
Address does not matchRejected
Loopback, 0.0.0.0 or a link-local addressRejected whatever the list says

This is deliberate: until the setting is made no datasource works at all, because the alternative would leave a script free to send queries to every address the server can reach.

When the host is taken out of a JDBC address, the user info, the path and SQL Server’s semicolon parameters are stripped. A PostgreSQL address that lists several hosts for high availability needs all of them on the list. Oracle TNS format (an address with no //) is not supported and cannot be saved.

The address is checked in two places: when you save (a rejected address comes back as a form error) and when a query runs.

LimitDefaultWhen it applies
Connect10 secondsA datasource that is down fails fast
Query60 secondsThe time one query may take

One connection pool is opened per datasource and reused by later queries. Editing or deleting the record closes that pool and drops it, so a new address or password takes effect on the next query by itself. No restart is needed.