4 ms·
I was really hoping for \dt but looks like they haven't implemented it yet. The number one most common thing I look up when I'm using a SQL variant is how to sh
by lwb 7y ago
I was really hoping for \dt but looks like they haven't implemented it yet. The number one most common thing I look up when I'm using a SQL variant is how to show the tables. I suppose there would be complications with NoSQL but you could just show available collections or whatever else it maps to in that case.
- toomim 7y agoYes, and since "show the tables" isn't in SQL itself, each CLI ends up having a different command for doing it, which makes a universal CLI appealing to me... if it can do that.
- paulddraper 7y ago> since "show the tables" isn't in SQL itself, Actually SELECT table_name FROM information_schedule.tables; But yes, that's harder to type/remember than \d.
- lwb 7y agoDoes that really work for every version of SQL? This might change my life.
- carlineng 7y agoinformation_schema (not "schedule"; GP had a typo in the query) is part of the ANSI SQL standard[1] so should work with any database that implements the ANSI standard. Note that not all databases or SQL dialects comply with this. [1] https://en.wikipedia.org/wiki/Information_schema https://en.wikipedia.org/wiki/Information_schema
- paulddraper 7y agoThanks.
- emmelaich 7y agoAlso, you can see a more or less complete "contents" listing of the recent draft standard here: https://webstore.iec.ch/preview/info_isoiec9075-11%7Bed4.0%7Den.pdf https://webstore.iec.ch/preview/info_isoiec9075-11%7Bed4.0%7... Not the actual standard though, that'll cost you a few hundred bucks. [edit - you can see the 1992 complete version here; do a search for information_schema. http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt courtesy of Ian Winand - https://modern-sql.com/standard https://modern-sql.com/standard]
- emmelaich 7y agoFound a free 2011 draft - click the 2011 draft standard link at the bottom of https://www.wikiwand.com/en/SQL#/Sources https://www.wikiwand.com/en/SQL#/Sources to get a zip file of pdfs. The schema is in 7IWD2-11-Schemata-2011-12.pdf