Cockroach DB support

Open
#37 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
postgresql, vscode
Domain
database

Research direction

Start by reproducing the CockroachDB connection and follow the ObjectExplorerService requests for databases, schemas, and tables in the extension logs. Check the pgsql_visualize_schema entry point as well, then verify that table enumeration and schema visualization work against a CockroachDB instance.

Written by the indexing model from the issue text.

Description

enhancement

Describe the bug

Right now it seems the extension is able to connect to the DB but no tables are being enumerated, using latest versions of everything, several other things are also not working as expected (visualize etc).

To Reproduce

Steps to reproduce the behavior:

  1. Connect to a CRDB instance.
  2. Attempt to view tables.
  3. See above.
    Expected behavior

I'd expect this to work somewhat (best effort) but it seems to be not working at all.

Screenshots

n/a

VS Code version

Version: 1.100.2 (Universal)

Extension Logs

[10:37:01 AM] [PgToolsService Initialization] ServiceDownloadProvider initialized
[10:37:01 AM] [PgToolsService Initialization] Initializing PostgreSQL Tools Service for the pgsql extension.
[10:37:01 AM] [PgToolsService Initialization] Note: pgsql commands will be available after installing the service.
[10:37:01 AM] [PgToolsService Initialization] 
[10:37:01 AM] [PgToolsService Initialization] Platform: darwin, arm64 (OSX)
[10:37:01 AM] [PgToolsService Initialization] 
[10:37:01 AM] [PgToolsService Initialization] Checking server path for runtime ID: OSX_ARM64
[10:37:01 AM] [PgToolsService Initialization] Server path not found for runtime ID: OSX_ARM64
[10:37:01 AM] [PgToolsService Initialization] Downloading server files
[10:37:01 AM] [PgToolsService Initialization] Using tools server filename: osx-arm64.tar.gz
[10:37:01 AM] [PgToolsService Initialization] Installing PostgreSQL Tools Service to /Users/simonschick/.vscode/extensions/ms-ossdata.vscode-pgsql-1.4.1/pgsqltoolsservice/v2.0.3/OSX.
[10:37:01 AM] [PgToolsService Initialization] Downloading https://github.com/microsoft/pgsql-tools/releases/download/v2.0.3/pgsqltoolsservice-osx-arm64.tar.gz
[10:37:02 AM] [PgToolsService Initialization] (68876 KB) ....................[Verbose]: Downloaded to /var/folders/gm/xgb679px0svfx4kxgwtdzd400000gn/T/package-71533q9amVNDk5tcE.tmp...
[10:37:06 AM] [PgToolsService Initialization]  Done!
[10:37:06 AM] [PgToolsService Initialization] Installing ...
[10:37:07 AM] [PgToolsService Initialization] Done! 2715 files unpacked.

[10:37:07 AM] [PgToolsService Initialization] Server files downloaded to: /Users/simonschick/.vscode/extensions/ms-ossdata.vscode-pgsql-1.4.1/pgsqltoolsservice/v2.0.3/OSX/pgsqltoolsservice/ossdbtoolsservice_main
[10:37:07 AM] [PgToolsService Initialization] Attempting to initialize language client
[10:37:07 AM] [PgToolsService Initialization] Checking overrides for language client initialization
[10:37:07 AM] [PgToolsService Initialization] Creating the language client with options: {"command":"/Users/simonschick/.vscode/extensions/ms-ossdata.vscode-pgsql-1.4.1/pgsqltoolsservice/v2.0.3/OSX/pgsqltoolsservice/ossdbtoolsservice_main","args":["--log-file","/Users/simonschick/Library/Application Support/Code/logs/20250522T115604/window1/exthost/ms-ossdata.vscode-pgsql/sqltools.log","--tracing-level","All","--application-name","Code","--data-path","/Users/simonschick/Library/Application Support","--enable-sql-authentication-provider"],"transport":0}
[10:37:07 AM] [PgToolsService Initialization] Language client created
[10:37:07 AM] [PgToolsService Initialization] Starting language client
[10:37:07 AM] [PgToolsService Initialization] Language client started
[10:37:07 AM] [PgToolsService Initialization] Waiting for client to be ready
[10:37:52 AM] [PgToolsService Initialization] Client is ready
[10:37:52 AM] [ToolsService] [Information]: ToolsService: registerTools called
[10:37:52 AM] [ToolsService] [Information]: Registering tool: pgsql_list_servers
[10:37:52 AM] [ToolsService] [Information]: Registering tool: pgsql_connect
[10:37:52 AM] [ToolsService] [Information]: Registering tool: pgsql_disconnect
[10:37:52 AM] [ToolsService] [Information]: Registering tool: pgsql_open_script
[10:37:52 AM] [ToolsService] [Information]: Registering tool: pgsql_visualize_schema
[10:37:52 AM] [ToolsService] [Information]: Registering tool: pgsql_query
[10:37:52 AM] [ToolsService] [Information]: Registering tool: pgsql_modify
[10:37:52 AM] [ToolsService] [Information]: Registering tool: pgsql_db_context
[10:37:52 AM] [ToolsService] [Information]: Registering tool: pgsql_list_databases
[10:37:52 AM] [ToolsService] [Information]: Registering tool: pgsql_describe_csv
[10:37:52 AM] [ToolsService] [Information]: Registering tool: pgsql_bulk_load_csv
[10:39:08 AM] [ObjectExplorerService] [All]: Getting root OE nodes
[10:39:08 AM] [PgToolsService Initialization] [Verbose]: readAllConnections: 0 connections; excluded recent)
[10:39:08 AM] [ObjectExplorerService] [Verbose]: No saved connections found; displaying 'Add Connection' node
[10:39:10 AM] [connectionDialog] [All]: Initializing connection dialog
[10:39:10 AM] [PgToolsService Initialization] [Verbose]: readAllConnections: 0 connections (0 from config, 0 from recent))
[10:39:10 AM] [connectionDialog] [All]: Has connection to edit: false
[10:39:10 AM] [PgToolsService Initialization] [Verbose]: Retreived 0 Azure accounts from account store.
[10:39:44 AM] [connectionDialog] [All]: Initializing connection dialog
[10:39:44 AM] [PgToolsService Initialization] [Verbose]: readAllConnections: 0 connections (0 from config, 0 from recent))
[10:39:44 AM] [connectionDialog] [All]: Has connection to edit: false
[10:39:44 AM] [PgToolsService Initialization] [Verbose]: Retreived 0 Azure accounts from account store.
[10:40:56 AM] [PgToolsService Initialization] [Verbose]: readAllConnections: 0 connections; excluded recent)
[10:41:11 AM] Error connecting to server "127.0.0.1:26257". Details: 
Connection error:
[Errno 8] nodename nor servname provided, or not known
[10:41:44 AM] [PgToolsService Initialization] [Verbose]: readAllConnections: 0 connections; excluded recent)
[10:41:45 AM] Connected to server "127.0.0.1" on document "127.0.0.1_concat_test_root_concat local". Server information: {"isCloud":false,"server":"PostgreSQL","serverVersion":"13.0.0"}
[10:41:47 AM] [PgToolsService Initialization] [Verbose]: readAllConnections: 0 connections; excluded recent)
[10:41:47 AM] [PgToolsService Initialization] [Verbose]: readAllConnections: 0 connections; excluded recent)
[10:41:47 AM] [connectionDialog] [All]: Checking for duplicates against 0 profiles
[10:41:47 AM] Connected to server "127.0.0.1" on document "127.0.0.1_concat_test_root_concat local". Server information: {"isCloud":false,"server":"PostgreSQL","serverVersion":"13.0.0"}
[10:41:47 AM] Connecting to server "127.0.0.1" on document "objectexplorer://root@127.0.0.1:26257:concat_test/".
[10:41:47 AM] Connected to server "127.0.0.1" on document "objectexplorer://root@127.0.0.1:26257:concat_test/". Server information: {"isCloud":false,"server":"PostgreSQL","serverVersion":"13.0.0"}
[10:41:47 AM] [mainController] [All]: New Session Dialog: Node created for 8D82AB39-913A-4EF3-A682-4C6FE945C154
[10:41:47 AM] [PgToolsService Initialization] [Verbose]: readAllConnections: 2 connections (1 from config, 1 from recent))
[10:41:47 AM] [ObjectExplorerService] [All]: Getting root OE nodes
[10:41:47 AM] [PgToolsService Initialization] [Verbose]: readAllConnections: 1 connections; excluded recent)
[10:41:47 AM] [ObjectExplorerService] [All]: Getting children for node 'objectexplorer://root@127.0.0.1:26257:concat_test/'
[10:41:47 AM] [ObjectExplorerService] [All]: Getting root OE nodes
[10:41:47 AM] [PgToolsService Initialization] [Verbose]: readAllConnections: 1 connections; excluded recent)
[10:41:47 AM] [ObjectExplorerService] [All]: Getting children for node 'objectexplorer://root@127.0.0.1:26257:concat_test/'
[10:41:49 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/'
[10:41:56 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/308/'
[10:41:57 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/308/schemas/'
[10:41:59 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/208/'
[10:42:01 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/208/schemas/'
[10:42:06 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/208/schemas/209/'
[10:42:07 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/208/schemas/209/tables/'
[10:42:13 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/208/schemas/209/views/'
[10:43:12 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/'
[10:43:13 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/'
[10:43:15 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/system/'
[10:43:20 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/1/'
[10:43:23 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/308/schemas/system/'
[10:43:43 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/208/schemas/system/'
[10:43:47 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/208/schemas/4294967295/'
[10:43:48 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/208/schemas/4294967295/tables/'
[10:43:52 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/208/schemas/209/procedures/'
[10:43:52 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/208/schemas/209/triggerfunctions/'
[10:43:53 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/208/schemas/209/collations/'
[10:43:53 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/208/schemas/209/extensions/'
[10:43:53 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/208/schemas/209/sequences/'
[10:43:54 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/208/schemas/209/datatypes/'
[10:43:56 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/208/schemas/209/functions/'
[10:43:56 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/208/schemas/209/materializedviews/'
[10:48:07 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/'
[10:48:10 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/206/'
[10:48:12 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/'
[10:48:13 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/105/'
[10:48:14 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/105/tables/'
[10:48:16 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/105/views/'
[10:48:17 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/105/datatypes/'
[10:48:18 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/105/sequences/'
[10:48:19 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/105/extensions/'
[10:48:20 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/105/collations/'
[10:48:20 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/105/triggerfunctions/'
[10:48:20 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/105/procedures/'
[10:48:21 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/105/functions/'
[10:48:21 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/105/materializedviews/'
[10:48:28 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/105/tables/'
[10:48:39 AM] [ObjectExplorerService] [All]: Getting children for node '/tablespaces/'
[10:48:40 AM] [ObjectExplorerService] [All]: Getting children for node '/roles/'
[10:48:41 AM] [ObjectExplorerService] [All]: Getting children for node '/systemdatabases/'
[11:04:24 AM] [ObjectExplorerService] [All]: Getting root OE nodes
[11:04:24 AM] [PgToolsService Initialization] [Verbose]: readAllConnections: 1 connections; excluded recent)
[11:04:24 AM] [ObjectExplorerService] [All]: Getting children for node 'objectexplorer://root@127.0.0.1:26257:concat_test/'
[11:04:27 AM] [ObjectExplorerService] [All]: Getting children for node 'objectexplorer://root@127.0.0.1:26257:concat_test/'
[11:04:27 AM] Connecting to server "127.0.0.1" on document "objectexplorer://root@127.0.0.1:26257:concat_test/".
[11:04:27 AM] Connected to server "127.0.0.1" on document "objectexplorer://root@127.0.0.1:26257:concat_test/". Server information: {"isCloud":false,"server":"PostgreSQL","serverVersion":"13.0.0"}
[11:04:27 AM] [ObjectExplorerService] [All]: Getting root OE nodes
[11:04:27 AM] [PgToolsService Initialization] [Verbose]: readAllConnections: 1 connections; excluded recent)
[11:04:27 AM] [ObjectExplorerService] [All]: Getting children for node 'objectexplorer://root@127.0.0.1:26257:concat_test/'
[11:04:28 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/'
[11:04:29 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/'
[11:04:30 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/'
[11:04:31 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/105/'
[11:04:32 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/105/views/'
[11:04:33 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/105/tables/'
[11:04:37 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/206/'
[11:04:38 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/206/schemas/'
[11:04:39 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/206/schemas/system/'
[11:04:41 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/631/'
[11:04:43 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/308/'
[11:04:43 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/308/schemas/'
[11:04:44 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/308/schemas/system/'
[11:04:45 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/308/schemas/309/'
[11:04:46 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/308/schemas/309/tables/'
[11:04:51 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/631/schemas/'
[11:06:50 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/102/'
[11:06:51 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/102/schemas/'
[11:06:53 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/102/schemas/103/'
[11:06:54 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/102/schemas/103/tables/'
[11:06:56 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/102/schemas/103/tables/'
[11:07:10 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/102/schemas/103/tables/'
[11:07:18 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/102/schemas/4294967295/'
[11:07:19 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/102/schemas/4294967295/tables/'
[11:07:22 AM] [ObjectExplorerService] [All]: Getting children for node '/tablespaces/'
[11:07:28 AM] [PgToolsService Initialization] [Information]: Target is pg version undefined
[11:07:28 AM] [PgToolsService Initialization] [Information]: Found binary versions:  - {}
[11:07:40 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/system/'
[11:07:42 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/system/4294966965/'
[11:07:43 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/system/4294966965/tables/'
[11:07:44 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/system/4294967095/'
[11:07:45 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/system/4294967095/tables/'
[11:07:46 AM] [ObjectExplorerService] [All]: Getting children for node '/databases/104/schemas/system/4294967182/'
[11:07:59 AM] Connecting to server "127.0.0.1" on document "schemadesigner://root@127.0.0.1:26257:concat_set/".
[11:07:59 AM] Connected to server "127.0.0.1" on document "schemadesigner://root@127.0.0.1:26257:concat_set/". Server information: {"isCloud":false,"server":"PostgreSQL","serverVersion":"13.0.0"}
[11:07:59 AM] [PgToolsService Initialization] [Error]: Error: Error fetching db context: unknown function: pg_total_relation_size()
Dominant language
No language data
Stars
395
Forks
33
Avg merge
1h 46m
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/vscode-pgsql

All issues in microsoft/vscode-pgsql

Similar issues

More Databases issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.