Skip to content

Add port field to database connection dialog#2201

Open
jlaustill wants to merge 1 commit intoGnucash:stablefrom
jlaustill:add-port-field-to-db-dialog
Open

Add port field to database connection dialog#2201
jlaustill wants to merge 1 commit intoGnucash:stablefrom
jlaustill:add-port-field-to-db-dialog

Conversation

@jlaustill
Copy link
Copy Markdown

Summary

  • Adds a Port entry field to the PostgreSQL/MySQL database connection dialog
  • When left blank, behavior is unchanged (backend defaults to 5432 for PostgreSQL, 3306 for MySQL)
  • The backend already fully supported custom ports via gnc_uri_create_uri() and dbi_conn_set_option_numeric() — this change wires up the UI to pass the port through instead of hardcoding 0

Motivation

Managed database services (Digital Ocean, AWS RDS, Google Cloud SQL, etc.) commonly use non-standard ports. There was no way to specify a port in the connection dialog, making it impossible to connect to these services without workarounds.

Changes

  • gnucash/gtkbuilder/dialog-file-access.glade — Added Port label and entry field (row 4) with placeholder text "Default: 5432"
  • gnucash/gnome-utils/dialog-file-access.c — Added tf_port to FileAccessWindow struct, reads port value in geturl(), passes it to gnc_uri_create_uri()

Test plan

  • Open File → Save As → select PostgreSQL — verify Port field appears below Password
  • Leave Port blank, connect to localhost:5432 — verify default behavior unchanged
  • Enter a custom port (e.g., 25060), connect — verify connection uses the specified port
  • Verify MySQL connection dialog also shows the Port field

The PostgreSQL connection dialog only exposed host, database, username,
and password fields, with no way to specify a non-standard port. The
backend already fully supports custom ports but always received 0 from
the dialog, causing it to default to 5432.

This is a problem for managed database services (Digital Ocean, AWS RDS,
etc.) that commonly use non-standard ports.

Add a Port entry field to the database connection dialog with placeholder
text showing the default (5432). When left blank, behavior is unchanged.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant