-
Notifications
You must be signed in to change notification settings - Fork 109
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
all: add support for cockroachdb #40
Conversation
There is some tricky game here, because the used DSN: CC \ @aeneasr |
5cd9c1b
to
2ec34ea
Compare
PTAL @aeneasr |
Thank you for this PR and your hard work! I'm wondering if introducing a wrapper to I'm not sure if I'm missing something very critical here, but wouldn't it be enough to just update this method so that it, for input The only issue I see is in migrations where we're using the migrate.Exec(m.DB.DB, m.DB.DriverName(), Migrations[dbal.Canonicalize(m.DB.DriverName())], migrate.Up) However, for that we could probably come up with an idea to solve that another way (e.g. using the configuration provider to get the full DSN, or by updating the What do you think? |
8a07cd0
to
6f62cf9
Compare
Wrapper removed, PTAL @aeneasr |
Nice! This looks much cleaner I think - what do you think? I have to run this locally to assure that everything works as expected but I don't think that there will be any changes necessary! |
Yep, agree, easier to understand. I don't have more changes in mind, so if you are ok with this, me too! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Just a few nitpics :)
log.Fatalf("Could not start resource: %s", err) | ||
} | ||
|
||
urls := bootstrap("postgres://root@localhost:%s/defaultdb?sslmode=disable", "26257/tcp", "postgres", pool, resource) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't that be cockroach
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can't be cockroach, because we need the "real" dsn (from GO driver perspective) inside the bootstrap function, for a successful sql.Open
to happen.
I just applied the same logic it's been applied with mysql (send the DSN without mysql://
, then add it after the bootstrap function).
Unless I'm missing something here the only thing we can do it's just change the place of the replace to inside the boostrap function with a switch/case (for mysql and cockroach) instead of doing it individually inside bootstrapMySQL()
and bootstrapCockroach()
.
See here:
https://github.com/ory/x/blob/master/sqlcon/connector_test.go#L299-L302
And here:
https://github.com/ory/x/blob/master/sqlcon/connector_test.go#L337
3190842
to
c6b28e3
Compare
Changes applied, PTAL and tell some if you find something more @aeneasr ! |
add support for cockroachdb Signed-off-by: David López <[email protected]>
THank you so much! |
add support for cockroachdb
Related MR
This would need to be merged before: ory/hydra#1348
Proposed changes
Add support for cockroachdb in x.