You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to connect to a database with this DSN: cockroachdb://test:test@host:26257/test?sslmode=verify-full. (I changed the password and host for this example)
$ env DATABASE_URI=cockroachdb://test:test@host:26257/test?sslmode=verify-full go run main.go start
failed to connect to `host=127.0.0.1 user=arantes database=`: dial error (dial tcp 127.0.0.1:26257: connect: connection refused)
exit status 1
But if I use postgres schema in the DSN (postgres://test:test@host:26257/test?sslmode=verify-full), it works fine.
The CockroachDB documentation connection-parameters says that the URL scheme used is postgres://, is there any specification in the documentation that shows the use of cockroachdb://?
If the cockroachdb:// URL scheme is valid, you can open a PR by changing the file: cockroachdb/connection.go
The Cockroach CLI has the convert-url command that converts an SQL connection string for use with various client drivers, and the cockroachdb URL scheme is an unrecognized URL scheme.
The CockroachDB documentation connection-parameters says that the URL scheme used is postgres://, is there any specification in the documentation that shows the use of cockroachdb://?
If the cockroachdb:// URL scheme is valid, you can open a PR by changing the file: cockroachdb/connection.go
The Cockroach CLI has the convert-url command that converts an SQL connection string for use with various client drivers, and the cockroachdb URL scheme is an unrecognized URL scheme.
cockroach convert-url --url "postgres://test:test@host:26257/test?sslmode=verify-full"
# Connection URL for libpq (C/C++), psycopg (Python), lib/pq & pgx (Go), node-postgres (JS) and most pq-compatible drivers:
postgresql://test:test@host:26257/test?sslmode=verify-full
# Connection DSN (Data Source Name) for Postgres drivers that accept DSNs - most drivers and also ODBC:
database=test user=test host=host port=26257 password=test sslmode=verify-full
# Connection URL for JDBC (Java and JVM-based languages):
jdbc:postgresql://host:26257/test?password=test&sslmode=verify-full&user=test
The DSN I'm using was generated by the CockroachDB cloud panel, I'm using postgres schema to run the code, it works fine, but i do think upper should implement this directly into their parse logic.
Activity
GaMoCh commentedon Oct 1, 2023
@arantesxyz
The CockroachDB documentation connection-parameters says that the URL scheme used is
postgres://, is there any specification in the documentation that shows the use ofcockroachdb://?If the
cockroachdb://URL scheme is valid, you can open a PR by changing the file: cockroachdb/connection.goThe Cockroach CLI has the
convert-urlcommand that converts an SQL connection string for use with various client drivers, and thecockroachdbURL scheme is an unrecognized URL scheme.arantesxyz commentedon Oct 2, 2023
The DSN I'm using was generated by the CockroachDB cloud panel, I'm using postgres schema to run the code, it works fine, but i do think upper should implement this directly into their parse logic.