mtxr / vscode-sqltools

Database management for VSCode
https://vscode-sqltools.mteixeira.dev?utm_source=github&utm_medium=homepage-link
MIT License
1.49k stars 299 forks source link

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

Open Jessinra opened 4 years ago

Jessinra commented 4 years ago

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):

t-schroeder commented 3 years ago

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.

spiderrobb commented 1 year ago

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

gjsjohnmurray commented 1 year ago

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