-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add cockroachdb support Signed-off-by: David López <not4rent@gmail.com>
- Loading branch information
Showing
36 changed files
with
1,047 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
-- +migrate Up | ||
CREATE TABLE IF NOT EXISTS hydra_client ( | ||
pk SERIAL PRIMARY KEY, | ||
id varchar(255) NOT NULL, | ||
client_name text NOT NULL, | ||
client_secret text NOT NULL, | ||
redirect_uris text NOT NULL, | ||
grant_types text NOT NULL, | ||
response_types text NOT NULL, | ||
scope text NOT NULL, | ||
owner text NOT NULL, | ||
policy_uri text NOT NULL, | ||
tos_uri text NOT NULL, | ||
client_uri text NOT NULL, | ||
logo_uri text NOT NULL, | ||
contacts text NOT NULL, | ||
client_secret_expires_at INTEGER NOT NULL DEFAULT 0, | ||
sector_identifier_uri text NOT NULL, | ||
jwks text NOT NULL, | ||
jwks_uri text NOT NULL, | ||
request_uris text NOT NULL, | ||
token_endpoint_auth_method VARCHAR(25) NOT NULL DEFAULT '', | ||
request_object_signing_alg VARCHAR(10) NOT NULL DEFAULT '', | ||
userinfo_signed_response_alg VARCHAR(10) NOT NULL DEFAULT '', | ||
subject_type VARCHAR(15) NOT NULL DEFAULT '', | ||
allowed_cors_origins text NOT NULL, | ||
audience text NOT NULL, | ||
created_at timestamp NOT NULL DEFAULT now(), | ||
updated_at timestamp NOT NULL DEFAULT now(), | ||
UNIQUE (id) | ||
); | ||
|
||
-- +migrate Down | ||
DROP TABLE hydra_client; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- +migrate Up | ||
INSERT INTO hydra_client (id, allowed_cors_origins, client_name, client_secret, redirect_uris, grant_types, response_types, scope, owner, policy_uri, tos_uri, client_uri, logo_uri, contacts, client_secret_expires_at, sector_identifier_uri, jwks, jwks_uri, token_endpoint_auth_method, request_uris, request_object_signing_alg, userinfo_signed_response_alg, subject_type, audience, created_at, updated_at) VALUES ('1-data', 'http://localhost|http://google', 'some-client', 'abcdef', 'http://localhost|http://google', 'authorize_code|implicit', 'token|id_token', 'foo|bar', 'aeneas', 'http://policy', 'http://tos', 'http://client', 'http://logo', 'aeneas|foo', 0, 'http://sector', '{"keys": []}', 'http://jwks', 'none', 'http://uri1|http://uri2', 'rs256', 'rs526', 'public', 'https://www.ory.sh/api', NOW(), NOW()); | ||
|
||
-- +migrate Down |
Oops, something went wrong.
1 comment
on commit d7ce922
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.
Hello @aeneasr I managed to pass all the tests in: ory#1348
We have a tricky game here because:
- We need
cockroach://
to differentiate frompostgres://
. lib/pq
doesn't supportcockroach://
so we have to convert it topostgres://
.sqlx
doesn't supportcockroach
also and doesn't normalize queries because of: https://github.com/jmoiron/sqlx/blob/82935fac6c1a317907c8f43ed3f7f85ea844a78b/bind.go#L24
Maybe we could ask him to add it, so we could clean up this a little more.
I'll reason about why the use of postgres://
sometimes and why cockroach://
. I think it happens the same to you when using a queryString prefix of mysql://
or not.
Anyway I have to clean up this, maybe by wrapping sqlx
, lib/pq
, SQLManager
, RegistrySQL
or whatever... Have to think about this.
Related code needed in x
is here:
Why is this
postgres
?