CockroachDB
CockroachDB Start Guide
Remember: CockroachDB supports the PostgreSQL wire protocol. We use the same driver to connect for both Cockroach and PostgreSQL.
1. Connections
Connection example:
{
"name": "Cockroach",
"server": "localhost",
"driver": "CockroachDB",
"port": 26257,
"database": "test_db",
"username": "root",
"askForPassword": false,
"password": "root",
"connectionTimeout": 15
}
1.1 Specific Options
CockroachDB driver specific options can be passed using pgOptions
settings.
{
"name": "Cockroach",
"server": "localhost",
"driver": "CockroachDB",
"port": 26257,
"database": "test_db",
"username": "root",
"askForPassword": false,
"password": "root",
"connectionTimeout": 15,
"pgOptions": {
... // options
}
}
You can use any options defined in https://node-postgres.com/features/connecting#programmatic in pgOptions
.
They will be passed to the pool constructor directly. See https://github.com/mtxr/vscode-sqltools/blob/master/packages/core/driver/pgsql/index.ts .
1.2 Alternative Connection Strings
ConnectionStrings or connectionURIs are supported as defined in node-postgres
library. See Connection URI for more information.
Using connectionURI for previous example:
{
"name": "Cockroach",
"server": "localhost",
"driver": "CockroachDB",
"connectString": "postgresql://root:root@localhost:26257/test_db",
"askForPassword": false,
"connectionTimeout": 15
}