Skip to content

Pr 562 work - #568

Merged
GermanBluefox merged 3 commits into
masterfrom
pr-562-work
Oct 2, 2026
Merged

GermanBluefox merged 3 commits into
masterfrom
pr-562-work

Conversation

@GermanBluefox

Copy link
Copy Markdown
Contributor

No description provided.

DutchmanNL and others added 3 commits October 2, 2026 14:49
…to create it

The two-phase PostgreSQL connect always opened the maintenance database
"postgres" first. With "do not create database" set it connected there,
did nothing, disconnected and reconnected - so the option avoided the
CREATE DATABASE, but not the connection that needs privileges nobody grants
on a managed PostgreSQL.

A role without CONNECT on "postgres" therefore never reached its own
database at all: the first phase was refused with 42501 and the adapter
looped on the 30 s reconnect forever (#404). That is also what makes the
Supabase request in #481 fail on the normal postgresql dbtype.

With the option set, connect() now skips the maintenance phase entirely.
The default path is unchanged. Table creation is unaffected either way:
init() only ever returns CREATE TABLE statements and runs against the
configured database, tolerating tables that already exist.

The admin "Test connection" button had the same hardcoded database, which
is the actual defect behind #285 - it reported a failure for a perfectly
good configuration. It now tests the configured database when the option
is set.

Adds test/testPostgreSQLNoCreateDb.js, which builds the situation it
guards: a role with no CONNECT on "postgres" and a pre-existing database of
its own. It asserts the adapter connects, creates its six tables in the
configured database and round-trips a value. On the unfixed code it fails
with "permission denied for database postgres" and the adapter never
connects.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The Postgres job named one exact file, so testPostgreSQLNoCreateDb.js added by
this PR would never have been executed - the same gap that kept
test/testSqlClient.js out of CI until #565. A glob picks up new files instead;
alphabetical order puts testPostgreSQL.js first.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@GermanBluefox
GermanBluefox merged commit 5672156 into master Oct 2, 2026
31 checks passed
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.

2 participants