vscode-sqltools icon indicating copy to clipboard operation
vscode-sqltools copied to clipboard

Error while showing table records Cannot read property 'total' of undefined

Open Jessinra opened this issue 5 years ago • 1 comments

Describe the bug Unable to 'Show Table Records' with Postgres Connector

Logs [1598850286310] INFO (ext): EXECUTING COMMAND => sqltools.showOutputChannel [1598850312313] INFO (ext): EXECUTING COMMAND => sqltools.showRecords [1598850312314] INFO (ext): EXECUTING COMMAND => sqltools.getConnections [1598850312315] INFO (ls): REQUEST RECEIVED => connection/GetConnectionsRequest [1598850312316] INFO (ext): Connection explorer changed. Will be updated. ns: "conn-man:explorer" [1598850312402] INFO (ext): EXECUTING COMMAND => sqltools.getConnections [1598850312403] INFO (ls): REQUEST RECEIVED => connection/GetConnectionsRequest [1598850312448] INFO (ext): EXECUTING COMMAND => sqltools.getChildrenForTreeItem [1598850312450] INFO (ls): REQUEST RECEIVED => connection/GetChildrenForTreeItemRequest [1598850313320] INFO (ext): EXECUTING COMMAND => sqltools.getConnections [1598850313320] INFO (ls): REQUEST RECEIVED => connection/GetConnectionsRequest [1598850313322] INFO (ls): REQUEST RECEIVED => connection/RunCommandRequest [1598850313367] INFO (ext): EXECUTING COMMAND => sqltools.getChildrenForTreeItem [1598850313367] INFO (ls): REQUEST RECEIVED => connection/GetChildrenForTreeItemRequest [1598850313369] INFO (ext): EXECUTING COMMAND => sqltools.getChildrenForTreeItem [1598850313370] INFO (ls): REQUEST RECEIVED => connection/GetChildrenForTreeItemRequest [1598850313609] INFO (ext): EXECUTING COMMAND => sqltools.getChildrenForTreeItem [1598850313610] INFO (ls): REQUEST RECEIVED => connection/GetChildrenForTreeItemRequest [1598850313613] INFO (ext): EXECUTING COMMAND => sqltools.getChildrenForTreeItem [1598850313614] INFO (ls): REQUEST RECEIVED => connection/GetChildrenForTreeItemRequest [1598850314232] ERROR (ext): ERROR: Execute query error Cannot read property 'total' of undefined, 'Cannot read property 'total' of undefined' ns: "error-handler" [1598850314233] ERROR (ext): ERROR: Error while showing table records Cannot read property 'total' of undefined, {"code":-1,"data":{"driver":"PostgreSQL","driverOptions":{}}} ns: "error-handler"

To Reproduce Steps to reproduce the behaviour:

  1. Connect to a Postgres database
  2. Click on any database, navigate through tables
  3. Click on the 'magnifying glass' to 'Show Table Records`
  4. Error log showed (pop up) on bottom right

Expected behaviour The records of tables shown on a new tab

Screenshots Screenshot from 2020-08-31 12-09-42

Desktop (please complete the following information):

  • SQLTools Version: v0.23.0
  • VSCode Version: v1.48.2
  • OS: Linux Ubuntu 18.04.5 LTS
  • Driver:
    • [x] PostgreSQL/Redshift
    • [ ] MySQL/MariaDB
    • [ ] MSSQL/Azure
    • [ ] SQLite
    • [ ] Other? Which...

Jessinra avatar Aug 31 '20 05:08 Jessinra

I get the error

Cannot desctructure property `name` of 'undefined' or 'null'.

when I use a table with a column called name (with backticks around it). I put the backticks around "name" because it's a keyword in MySQL/MariaDB.

That said, the queries (inserts in my case) run successfully.

t-schroeder avatar Oct 22 '20 14:10 t-schroeder

Ive had the same issue. In two of my projects. postgresql

spiderrobb avatar Feb 28 '23 08:02 spiderrobb

@spiderrobb please confirm that you are using the latest versions of the extensions.

gjsjohnmurray avatar Mar 03 '23 12:03 gjsjohnmurray