STILTS-SQLCLIENT(1)
πΎ stilts-sqlclient β or, "how to yell SQL at a database from your terminal" β¨
okay bestie, this is stilts-sqlclient from the Stilts commands manual, and it Executes SQL statements. that's the whole vibe. let's get into it π«Ά
β¨ NAME β¨
stilts-sqlclient β Executes SQL statements π
π SYNOPSIS π
stilts sqlclient [db=<jdbc-url>] [user=<value>] [password=<value>]
[sql=<sql>] [ofmt=<out-format>]
πΈ DESCRIPTION πΈ
so sqlclient is literally just a simple command-line client for use with SQL databases. no cap. π¦
you can supply one or more SQL statements using the sql parameter. the result of each statement may be one or more update counts (those are for update-type statements) or tables (those are for query-type statements). tables get written to standard output in a format given by the ofmt parameter. update results and timing information get written to standard error. that's the split, bestie β stdout for the tables, stderr for the gossip. π
ngl, in most cases you will find life easier if you use either the database's own command-line or GUI client, or β if you require STILTS-type format conversion or post-processing β a jdbc:-format URL for the in parameter of the tpipe or tcopy commands (see SUN/256 for more explanation of the latter). but this command enables you to submit multiple queries over the same JDBC connection, including ones which do not generate a tabular result. it may be useful if a command-line client is not available to you for the database you are using. so like, it's giving "backup plan that actually ate". π
this command can only be used if you have access to an SQL database via JDBC. the details of how to configure a JDBC connection to a database are discussed in SUN/256 β obviously you will need a database to connect to and appropriate permissions on it as well as the relevant drivers. no database, no permissions, no drivers? no party. π
β οΈ warning bestie: this command is experimental, and it may be enhanced, renamed or withdrawn in future releases. so don't build your whole personality around it. π
π OPTIONS π
db=<jdbc-url>β URL which defines a connection to a database. this has the formjdbc:<subprotocol>:<subname>β the details are database- and driver-dependent. consult Sun's JDBC documentation and that for the particular JDBC driver you are using for details. note that the relevant driver class will need to be on your classpath and referenced in thejdbc.driverssystem property as well for the connection to be made. yes, both. the driver class and the system property. it's a whole thing. πuser=<value>β User name for logging in to SQL database. Defaults to the current username.password=<value>β Password for logging in to SQL database.sql=<sql>β Text of an SQL statement for execution. this parameter may be repeated, or statements may be separated by semicolon (;) characters. so you can stack them however you like, periodt. βofmt=<out-format>β Specifies the format in which the output table will be written (one of the ones in SUN/256 β matching is case-insensitive and you can use just the first few letters). if it has the special value(auto)(the default), then the output filename will be examined to try to guess what sort of file is required usually by looking at the extension. if it's not obvious from the filename what output format is intended, an error will result. so, like, name your files properly or the vibe check fails. π
π¦ SEE ALSO π¦
if the package stilts-doc is installed, the full documentation SUN/256 is available in HTML format: file:///usr/share/doc/stilts/sun256/index.html
π VERSION π
STILTS version 3.5.4-debian
this is the Debian version of Stilts, which lack the support of some file formats and network protocols. for differences see file:///usr/share/doc/stilts/README.Debian
π AUTHOR π
Mark Taylor (Bristol University)
and that's the whole page, bestie π β it's the STILTS-SQLCLIENT(1) page, Mar 2017, from the Stilts commands manual. go forth and query. slay. β¨ππΈ
π¦ where this page comes from
- ubuntu stonking: stilts 3.5.4-1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms