Skip to content

[Bug]: postgresql:// connection strings silently fail to populate form (green check shown, fields stay empty) #260

@NewtTheWolf

Description

@NewtTheWolf

Describe the bug

When pasting a PostgreSQL connection string that uses the postgresql:// scheme into the New Connection modal, the UI displays the green success indicator next to the input — but the host/port/username/password/database fields are not populated. Clicking Test Connection or Save then fails with error with configuration: empty host.

The postgres:// scheme on the exact same connection string works correctly (fields populate, Test Connection succeeds). Both schemes are valid per the PostgreSQL docs:

The URI scheme designator can be either postgresql:// or postgres://.

This matters in practice because most hosted Postgres providers (DigitalOcean Managed Databases, Neon, Supabase, Render, etc.) hand out connection strings using the postgresql:// form.

Root cause

In src/utils/connectionStringParser.ts, the protocol registry is built from two sources:

  1. BUILTIN_DRIVER_IDS = ["postgres", "mysql", "sqlite"] (src/utils/connections.ts:12) → registers the protocol key postgres.
  2. The driver's connection_string_example (src-tauri/src/drivers/postgres/mod.rs:1321) → "postgres://user:pass@localhost:5432/db" → also yields postgres.

So only postgres ends up in the registry. When looksLikeConnectionString("postgresql://…") is called from NewConnectionModal.handleConnectionStringChange (src/components/modals/NewConnectionModal.tsx:638), it returns false, so the parser branch is skipped entirely — no error is set, and no fields are populated. The success indicator at NewConnectionModal.tsx:784 renders on connectionString && !connectionStringError, both of which are still true, so the user sees a green check despite nothing having been parsed.

To Reproduce

  1. Open New Connection → select PostgreSQL.
  2. Paste a connection string starting with postgresql:// (e.g. postgresql://user:pass@localhost:5432/mydb).
  3. Observe the green check appears next to the input.
  4. Observe that Host, Port, Username, Password, Database name remain empty (placeholders only).
  5. Click Test Connection or Save → error: error with configuration: empty host.

Repeat steps 1–5 replacing postgresql:// with postgres:// — fields populate correctly and Test Connection succeeds.

Suggested fix

Either (or both):

  • Register both postgres and postgresql as protocol aliases for the PostgreSQL driver in the connection-string protocol registry. This is the actual user-facing fix.
  • Surface a parse error when looksLikeConnectionString rejects a non-empty input in handleConnectionStringChange, so the success indicator doesn't render for unrecognized protocols. This is a defensive improvement worth doing regardless of the alias fix — any future driver-protocol mismatch would otherwise repeat the same silent failure.

OS Version

Linux (Arch / CachyOS, Kernel 7.0.10)

Tabularis Version

v0.12.0

Relevant Log Output

error with configuration: empty host

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions