xo / usql

Universal command-line interface for SQL databases
MIT License
8.94k stars 352 forks source link

`TABLE` query results are not displayed. #366

Closed nineinchnick closed 2 years ago

nineinchnick commented 2 years ago

TABLE <name> is a shortcut for SELECT * FROM <name>. But it's not recognized as a query that returns results:

pg:postgres@localhost:5432/benchto=> table tags;
TABLE 10

Expected result:

pg:postgres@localhost:5432/benchto=> select * from tags;
┌────┬──────────┬───────────────────────────────────────────┬──────────────────────────┬────────────────┐
│ id │   name   │                description                │         created          │ environment_id │
├────┼──────────┼───────────────────────────────────────────┼──────────────────────────┼────────────────┤
│  1 │ perftest │ Benchmark executed by the perftest script │ 2022-08-30T15:13:49.317Z │              2 │
│  2 │ perftest │ Benchmark executed by the perftest script │ 2022-08-30T15:26:23.898Z │              2 │
│  3 │ perftest │ Benchmark executed by the perftest script │ 2022-08-30T15:27:51.614Z │              2 │
│  4 │ perftest │ Benchmark executed by the perftest script │ 2022-08-30T15:30:10.617Z │              2 │
│  5 │ perftest │ Benchmark executed by the perftest script │ 2022-08-31T06:24:47Z     │              2 │
│  6 │ perftest │ Benchmark executed by the perftest script │ 2022-08-31T06:26:53.112Z │              2 │
│  7 │ perftest │ Benchmark executed by the perftest script │ 2022-08-31T06:28:40.72Z  │              2 │
│  8 │ perftest │ Benchmark executed by the perftest script │ 2022-08-31T06:31:58.812Z │              2 │
│  9 │ perftest │ Benchmark executed by the perftest script │ 2022-08-31T06:32:24.264Z │              2 │
│ 10 │ perftest │ Benchmark executed by the perftest script │ 2022-08-31T07:05:22.819Z │              3 │
└────┴──────────┴───────────────────────────────────────────┴──────────────────────────┴────────────────┘
(10 rows)
nineinchnick commented 2 years ago

https://www.postgresql.org/docs/current/sql-select.html#SQL-TABLE