Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Support any PostgreSQL database #1348

Closed
wants to merge 1 commit into from

Conversation

ayush6624
Copy link

  • read the CONTRIBUTING guidelines
  • raised a GitHub issue or discussed it on the projects chat beforehand
  • added unit tests
  • added integration tests
  • updated documentation if needed
  • updated CHANGELOG.md

We wanted to use CockroachDB with headscale, which was not possible with the current config options. This PR adds support to directly input a Postgres dialect URL

@kev-the-dev
Copy link

Just curious, what options did cockroachDB require that aren't currently provided? What does the db url string you use look like?

@@ -122,6 +122,11 @@ func NewHeadscale(cfg *Config) (*Headscale, error) {
var dbString string
switch cfg.DBtype {
case Postgres:
if cfg.DBurl != "" {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason for this to only apply to Postgres? This seems like this could be a generic feature to override DBURL for any DBType

@@ -61,6 +61,7 @@ type Config struct {
DBuser string
DBpass string
DBssl string
DBurl string

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
DBurl string
// DBurl explicitly sets the url passed to the database driver
// If set, DBpath, DBhost, DBport, DBname, DBuser, DBpass, DBssl is ignored
DBurl string

@kradalby
Copy link
Collaborator

Hi! as part of #1473, we have reorganised a lot of the code.

To clear PRs that needs to be rebased or redone, we are closing open PRs that will require significant code change to be merged.

In addition, the issue of the PR might in some cases have been fixed, change or no longer relevant, so it would be great if this is considered as well.

Thank you for your contribution!

If it is still relevant and the PR is reopened, we will aim at getting the changes into the next release after the reorg if accepted.

@kradalby kradalby closed this Sep 24, 2023
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.

3 participants