coder / coder/internal

cli: refactor logic for connecting to database

Open
#541 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

I'm quite sure I have seen this pattern in other CLI commands:
startBuiltinPostgres - codersdk.PostgresAuth - ConnectToPostgres

we may consider some base pattern for all commands using the database

_Originally posted by @mtojek in https://github.com/coder/coder/pull/17091#discussion_r2014730400_

We have a few commands now that can connect to the database directly and need to handle the conditional logic of builtin postgres:

- server
- server create-admin-user
- server regenerate-vapid-keypair

We should refactor and unify this.

We also have the `server dbcrypt` commands under `enterprise/` that could also benefit from this standardized logic.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.