blob: 411eb000d15576e47e7339becb3bd7dd86174c3c [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
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08007--
Shawn O. Pearce47769242011-06-14 16:40:48 -07008'ssh' -p <port> <host> 'gerrit gsql'
Christian Aistleitnercaf41d72013-08-14 13:16:51 +02009 [--format {PRETTY | JSON | JSON_SINGLE}]
Shawn O. Pearce47769242011-06-14 16:40:48 -070010 [-c QUERY]
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080011--
Shawn O. Pearce7c5941b2009-11-17 20:47:04 -080012
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080013== DESCRIPTION
Shawn O. Pearce7c5941b2009-11-17 20:47:04 -080014Provides interactive query support directly against the underlying
15SQL database used by the host Gerrit server. All SQL statements
16are supported, including SELECT, UPDATE, INSERT, DELETE and ALTER.
17
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080018== OPTIONS
Shawn O. Pearce47769242011-06-14 16:40:48 -070019--format::
Shawn O. Pearce177ddac2010-02-26 18:42:49 -080020 Set the format records are output in. In PRETTY (the
21 default) records are displayed in a tabular output suitable
22 for reading by a human on a sufficiently wide terminal.
23 In JSON mode records are output as JSON objects using the
24 column names as the property names, one object per line.
Christian Aistleitnercaf41d72013-08-14 13:16:51 +020025 In JSON_SINGLE mode the whole result set is output as a
26 single JSON object.
Shawn O. Pearce177ddac2010-02-26 18:42:49 -080027
28-c::
29 Execute the single query statement supplied, and then exit.
30
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080031== ACCESS
Edwin Kempinda062b02013-08-06 08:28:16 +020032Caller must have been granted the
33link:access-control.html#capability_accessDatabase[Access Database]
34global capability.
Shawn O. Pearce7c5941b2009-11-17 20:47:04 -080035
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080036== SCRIPTING
Christian Aistleitnercaf41d72013-08-14 13:16:51 +020037Intended for interactive use only, unless format is JSON, or
38JSON_SINGLE.
Shawn O. Pearce7c5941b2009-11-17 20:47:04 -080039
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080040== EXAMPLES
Shawn O. Pearce7c5941b2009-11-17 20:47:04 -080041To manually correct a user's SSH user name:
42
43====
44 $ ssh -p 29418 review.example.com gerrit gsql
45 Welcome to Gerrit Code Review v2.0.25
46 (PostgreSQL 8.3.8)
47
48 Type '\h' for help. Type '\r' to clear the buffer.
49
Robin Rosenberg524a3032012-10-14 14:24:36 +020050 gerrit> update accounts set ssh_user_name = 'alice' where account_id=1;
Shawn O. Pearce7c5941b2009-11-17 20:47:04 -080051 UPDATE 1; 1 ms
52 gerrit> \q
53 Bye
54
55 $ ssh -p 29418 review.example.com gerrit flush-caches --cache sshkeys --cache accounts
56====
57
58GERRIT
59------
60Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -070061
62SEARCHBOX
63---------