HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
xo
usql
Go2017–2026
xo / usql

usql

Universal command-line interface for SQL databases

17Distinct people
26Mentions
0Explicit recommenders
10.2KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Universal command-line interface for SQL databases

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year26 dated mentions

Observed mentions: 2017-12-23 12:11:44 UTC to 2026-06-05 12:33:23 UTC.

0123452017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 3 mentions; 3 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 4 mentions; 3 submissions, 1 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC202
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC330
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC211
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC202
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC431
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC312
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC514
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC413
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC101

What Hacker News says

26 sources
see information about sql queries from shell command line. aka nosql - oci cli [1] database schema data can be queried to find the table(s) field name & table(s) type. That is an additional separate sql query though & would potentially be different for different databases & database versions. ODBC protocol was designed to address the 'different database schema formats' issues via a 'universal database access' interface. (vs. jdbc, java language equivalent of odbc)[2]. The command line program, usql[3] provides support for sql querying different databases. Setting sql query to output query results in json format would provide relevant information such as field name & data type within the sql output data. note: sql allows for renaming table names within the sql query. aka select tablea.first_name as surname ---- [1] : http://docs.oracle.co
Read the rest
In Why is database support in every language bad?
Frameworks / ORM are just specilized database user interface front ends designed to simplify how data can be used (displayed/inputted/manipulated). They can also display known databases/table, such that the user just has to select what's needed (or doesn't have to worry about tables/field -- just the display/forms to get results. Database management systems usually provide a way of importing/exporting 'raw' data via sql statement(s) results. aka cvs, comma delimited, html formatted, json formatted. Outside of a framework/ORM from command line / operating system shell; can do a command line sql query with 'html formatted output' and open results of file in a brower. Obvious catch of not using 'tools/environment' is gotta do all the data input cleanup/checks; output formatting for display/printing, such as only want 4 lines of output per p
Read the rest
rinted page. Note: will have to provide database(s) to access information from via databases specific method! example programs that provide access to sql via command line: postgres psql provides an interactive 'cli' environment for using sql windows sql server - sqlcmd; usql[1] provides something similar to psql for no-sql databases. --- sqlc is sorta the equivalent of combining the command line shell & sql queries. The 'c' portion of sql, is c language. So, outside of sql, on own to write what ever 'shell' functionality needed using c. SQLx rust is rust extention for handling 'sql from command line, just via rust language, instead of going through command line shell.' except, rust language also handles the internet protocols/language extentions for doing rest crud / sql / rust in a single app. There are program(s) usable from a command line shell (cli) that would provide 'rest crud'. Different levels of packaging provide differing levels of control/amount of hoops have to jump through. (just raw data, data & usage, just usage) Unlike databases, spreadsheets provide an interactive gui up front, with 'embedded language' providing the 'data manipulations' aka visual, python, etc. spreadsheet data can be retreived from / sent to a database. ---- [1] : https://github.com/xo/usql
In Why is database support in every language bad?
119K 2024-07-12 02:01 /usr/local/bin/pg_ctl 737K 2024-07-15 01:01 /usr/local/bin/pg_dump 528K 2024-07-15 01:09 /usr/local/bin/pg_restore 8.1M 2024-07-12 02:01 /usr/local/bin/postgres 848K 2024-07-12 02:01 /usr/local/bin/psql /usr/local/bin/pg_ctl: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), static-pie linked, stripped /usr/local/bin/pg_dump: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), static-pie linked, stripped /usr/local/bin/pg_restore: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), static-pie linked, stripped /usr/local/bin/postgres: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), static-pie linked, stripped /usr/local/bin/psql: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), static-pie linked, stripped https://github.com/xo/usql/r
Read the rest
eleases/download/v0.19.12/usql_s... 185M 2024-10-24 07:58 usql_static usql_static: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=33c121e6b03ea90eb1dc1b79190b5ef71658f120, for GNU/Linux 3.2.0, stripped 185M! Wow. I just want to query postgres with socat.
In Usql: Universal command-line interface for SQL databases
Thats nice to know! If you are a PRQL dev i have a suggestion for you/your team. Make PRQL language agnostic. In a real life scenario many people are writing SQL not in the app layer, but more ad-hoc for stats, reporting, analysis, examining the data etc. What i mean by this is: If i write an app that has embedded SQL i dont really care to much for the possible verbosity. This code will be used more than once, so im OK with taking the extra effort. Also all languages has an query-builder / ORM so the benefit of something like PRQL is possibly not big enough to merit it as an additional dependency. My suggestion: Make PRQL a cli tool that can be used by allowing users to connect to a database in a similar fashion as something like usql (https://github.com/xo/usql), I would find the most power in a tool like PRQL is this setting: Ad hoc SQL
Read the rest
queries. This would open the editor integration. With a tool like this i could open vim, and write PQRL in a window, and pipe it via something like Slime to a open PQRL session. This would be pure money!
In PRQL: a simple, powerful, pipelined SQL replacement
I am not a big fan of the complex literate programming style involving code-generation which this article talks about. But I recently discovered that Google's zx [1] scripting utility supports executing scripts in markdown documents and I combined it with httpie [2] and usql [3] for a bit of quick and dirty automation testing and api verification code and it worked out pretty well. I imagine for most people nowadays jupyter or vscode notebooks are the closest it comes to practical literate programming. [1] https://github.com/google/zx#markdown-scripts [2] https://github.com/httpie/httpie [3] https://github.com/xo/usql
In Literate programming is much more than just commenting code

Showing the 15 most recent of 26 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.