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
}
Connection Options
askForPasswordbooleanAsk for password at connection time instead of storing it as plaintext in your settings.
Ask for password at connection time instead of storing it as plaintext in your settings.
| Type | boolean |
| Default Value | false |
connectionTimeoutnumberConnection timeout in seconds.
Connection timeout in seconds.
| Type | number |
| Default Value | 15 |
connectStringstring | nullConnect string. Support for Oracle, PostgreSQL and AWS Redshift.
Connect string. Support for Oracle, PostgreSQL and AWS Redshift.
| Type | string or null |
cqlOptionsobject | nullSee https://docs.datastax.com/en/developer/nodejs-driver/4.1/api/type.ClientOptions/ for more details.
See https://docs.datastax.com/en/developer/nodejs-driver/4.1/api/type.ClientOptions/ for more details.
| Type | object or null |
| Default Value | {} |
databasestringDatabase name.
Database name.
| Type | string |
dialectstringConnection Driver
Connection Driver
| Type | string |
driverstringConnection driver used for this connection.
Connection driver used for this connection.
| Type | string |
groupstringConnection group name.
Connection group name.
| Type | string |
namestringConnection name.
Connection name.
| Type | string |
passwordstring | nullConnection password
Connection password
| Type | string or null |
pgOptionsobject | nullSee https://vscode-sqltools.mteixeira.dev/en/drivers/postgre-sql#11-specific-options for more details.
See https://vscode-sqltools.mteixeira.dev/en/drivers/postgre-sql#11-specific-options for more details.
| Type | object or null |
| Default Value | {} |
| Property | Description | Type |
|---|---|---|
| ssl | boolean, object or null |
portnumberPort for connection.
Port for connection.
| Type | number |
previewLimitnumberMaximum number of records to return in table previews.
Maximum number of records to return in table previews.
| Type | number |
| Default Value | 50 |
serverstringServer address.
Server address.
| Type | string |
| Default Value | 127.0.0.1 |
usernamestringConnection username.
Connection username.
| Type | string |
variablesobject | nullConnection variables in a key/value pair format. Use this property with sqltools.queryParams.enableReplace to replace the variables without prompting.
Connection variables in a key/value pair format. Use this property with sqltools.queryParams.enableReplace to replace the variables without prompting.
| Type | object or null |
| Default Value | null |
| Property | Description | Type |
|---|