How To

Connections

A connection names a database and tells DataPad how to read its schema. DataPad runs your scripts against the connection you select in the editor header.

Connections

A connection names a database and tells DataPad how to read its schema. DataPad runs your scripts against the connection you select in the editor header.

Add a connection

Open the connections panel and choose Add connection. The dialog first asks for a Source, then a name and the source-specific fields.

  • Connection string: pick a Provider and paste the provider’s connection string. DataPad introspects the database behind the string.
  • EF DLL: point at a compiled Entity Framework assembly, Inspect it, pick one of its DbContexts, and read the schema from its model instead of from a live database.

The Name is shown as the top-level node in the connections tree. Add connection saves the entry without contacting the database, so a typo or an offline server cannot block saving; read the schema later with Refresh.

Connection-string connections

Choose Connection string and pick a provider:

  • PostgreSQL,
  • SQL Server,
  • SQLite, or
  • MySQL/MariaDB, which is shown with its real label but is not supported yet: selecting it fails with the backend’s real error, because no provider is registered for that kind.

Paste the connection string in the Connection string field. The field is masked by default; use Show/Hide to reveal it. The string is stored as entered in the local connection store and is never logged or returned by any read except Edit.

EF DLL connections

Choose EF DLL to read the schema from a compiled assembly rather than the live database.

  • Assembly path: the compiled assembly whose DbContext supplies the schema. Type or paste a path, or use Browse… to pick it with the OS file dialog. The entity classes’ dependencies must sit beside the assembly.
  • Inspect loads the assembly and discovers its DbContexts without saving.
  • DbContext: when the assembly exposes several contexts, pick the one to use; each can point at a different provider. When it exposes exactly one, it is selected automatically.
  • Detected provider is shown read-only; it comes from the chosen DbContext and is not editable.
  • Connection string: the database is named inside the connection string even for a DLL connection (the schema comes from the assembly, so no provider is picked here).

Saving an EF DLL connection persists it only on a Pro licence. Under Free the add succeeds as a session-only connection: it works for the session and closes with the app, and nothing is written to the store.

Test, Refresh, Edit, and Remove

The dialog and the tree both act on a connection without saving guesses:

  • Test probes the entered provider and connection string and reports the server version, or the real masked error, persisting nothing. For an EF DLL form, Test needs the chosen DbContext’s provider; until the assembly is inspected (or if the provider cannot be detected), Test is unavailable with the real reason rather than guessing.
  • Refresh re-introspects a saved connection and replaces its cached schema.
  • Edit re-opens the dialog pre-filled with the stored record, including the connection string (read through the one channel allowed to return it, and only for this fill).
  • Remove deletes the connection after a confirmation that names it; removal is irreversible.

Right-click a connection row for Test, Edit, Refresh, and Remove.

Mark a connection production or read-only

Two flags ride a connection and are visible in the tree:

  • Production marks the connection with a badge and gives its script tab an accent-coloured left margin, so a production target is unmistakable. Marking production applies immediately; Unmark Production asks for confirmation because it removes the safety indicators.
  • Read-only marks the connection with a lock badge. Reads still work, but writes are blocked: a script run’s SaveChanges() is gated, the result grid’s Edit mode cannot save, and the Save control is disabled with a title naming the connection. Mark read-only applies immediately; Allow writes asks for confirmation, because that is the dangerous direction.

Encryption

Connections at rest can be encrypted with a phrase. While the store is locked, the tree is empty and reads are refused until you unlock; see the Encryption and backup topic.

See the schema

Each saved connection’s node expands into its databases, schemas, tables, views, and columns. Columns show their provider type, primary-key, nullable, and identity markers. A table’s Relationships group lists its individual relationships with the direction glyph, the related table, and the column they run through. A column that carries a schema-declared JSON structure shows a JSON badge and its nested graph; see the JSON columns topic.