blob: d2eb7833c4fb5ed906e10063de74e63c7908204b [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= gerrit gsql
Shawn O. Pearce7c5941b2009-11-17 20:47:04 -08002
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003== NAME
Shawn O. Pearce7c5941b2009-11-17 20:47:04 -08004gerrit gsql - Administrative interface to active database
5
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006== SYNOPSIS
Michael Ochmanne2d76a12016-06-23 17:07:37 +02007[verse]
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08008--
Michael Ochmanne2d76a12016-06-23 17:07:37 +02009_ssh_ -p <port> <host> _gerrit gsql_
Christian Aistleitnercaf41d72013-08-14 13:16:51 +020010 [--format {PRETTY | JSON | JSON_SINGLE}]
Shawn O. Pearce47769242011-06-14 16:40:48 -070011 [-c QUERY]
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080012--
Shawn O. Pearce7c5941b2009-11-17 20:47:04 -080013
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080014== DESCRIPTION
Shawn O. Pearce7c5941b2009-11-17 20:47:04 -080015Provides interactive query support directly against the underlying
16SQL database used by the host Gerrit server. All SQL statements
17are supported, including SELECT, UPDATE, INSERT, DELETE and ALTER.
18
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080019== OPTIONS
Shawn O. Pearce47769242011-06-14 16:40:48 -070020--format::
Shawn O. Pearce177ddac2010-02-26 18:42:49 -080021 Set the format records are output in. In PRETTY (the
22 default) records are displayed in a tabular output suitable
23 for reading by a human on a sufficiently wide terminal.
24 In JSON mode records are output as JSON objects using the
25 column names as the property names, one object per line.
Christian Aistleitnercaf41d72013-08-14 13:16:51 +020026 In JSON_SINGLE mode the whole result set is output as a
27 single JSON object.
Shawn O. Pearce177ddac2010-02-26 18:42:49 -080028
29-c::
30 Execute the single query statement supplied, and then exit.
31
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080032== ACCESS
Edwin Kempinda062b02013-08-06 08:28:16 +020033Caller must have been granted the
34link:access-control.html#capability_accessDatabase[Access Database]
35global capability.
Shawn O. Pearce7c5941b2009-11-17 20:47:04 -080036
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080037== SCRIPTING
Christian Aistleitnercaf41d72013-08-14 13:16:51 +020038Intended for interactive use only, unless format is JSON, or
39JSON_SINGLE.
Shawn O. Pearce7c5941b2009-11-17 20:47:04 -080040
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080041== EXAMPLES
Shawn O. Pearce7c5941b2009-11-17 20:47:04 -080042To manually correct a user's SSH user name:
43
Michael Ochmannb99feab2016-07-06 14:10:22 +020044----
Shawn O. Pearce7c5941b2009-11-17 20:47:04 -080045 $ ssh -p 29418 review.example.com gerrit gsql
46 Welcome to Gerrit Code Review v2.0.25
47 (PostgreSQL 8.3.8)
48
49 Type '\h' for help. Type '\r' to clear the buffer.
50
Robin Rosenberg524a3032012-10-14 14:24:36 +020051 gerrit> update accounts set ssh_user_name = 'alice' where account_id=1;
Shawn O. Pearce7c5941b2009-11-17 20:47:04 -080052 UPDATE 1; 1 ms
53 gerrit> \q
54 Bye
55
56 $ ssh -p 29418 review.example.com gerrit flush-caches --cache sshkeys --cache accounts
Michael Ochmannb99feab2016-07-06 14:10:22 +020057----
Shawn O. Pearce7c5941b2009-11-17 20:47:04 -080058
59GERRIT
60------
61Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -070062
63SEARCHBOX
64---------