Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1 | = gerrit gsql |
Shawn O. Pearce | 7c5941b | 2009-11-17 20:47:04 -0800 | [diff] [blame] | 2 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3 | == NAME |
Shawn O. Pearce | 7c5941b | 2009-11-17 20:47:04 -0800 | [diff] [blame] | 4 | gerrit gsql - Administrative interface to active database |
| 5 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6 | == SYNOPSIS |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 7 | -- |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 8 | 'ssh' -p <port> <host> 'gerrit gsql' |
Christian Aistleitner | caf41d7 | 2013-08-14 13:16:51 +0200 | [diff] [blame] | 9 | [--format {PRETTY | JSON | JSON_SINGLE}] |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 10 | [-c QUERY] |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 11 | -- |
Shawn O. Pearce | 7c5941b | 2009-11-17 20:47:04 -0800 | [diff] [blame] | 12 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 13 | == DESCRIPTION |
Shawn O. Pearce | 7c5941b | 2009-11-17 20:47:04 -0800 | [diff] [blame] | 14 | Provides interactive query support directly against the underlying |
| 15 | SQL database used by the host Gerrit server. All SQL statements |
| 16 | are supported, including SELECT, UPDATE, INSERT, DELETE and ALTER. |
| 17 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 18 | == OPTIONS |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 19 | --format:: |
Shawn O. Pearce | 177ddac | 2010-02-26 18:42:49 -0800 | [diff] [blame] | 20 | 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 Aistleitner | caf41d7 | 2013-08-14 13:16:51 +0200 | [diff] [blame] | 25 | In JSON_SINGLE mode the whole result set is output as a |
| 26 | single JSON object. |
Shawn O. Pearce | 177ddac | 2010-02-26 18:42:49 -0800 | [diff] [blame] | 27 | |
| 28 | -c:: |
| 29 | Execute the single query statement supplied, and then exit. |
| 30 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 31 | == ACCESS |
Edwin Kempin | da062b0 | 2013-08-06 08:28:16 +0200 | [diff] [blame] | 32 | Caller must have been granted the |
| 33 | link:access-control.html#capability_accessDatabase[Access Database] |
| 34 | global capability. |
Shawn O. Pearce | 7c5941b | 2009-11-17 20:47:04 -0800 | [diff] [blame] | 35 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 36 | == SCRIPTING |
Christian Aistleitner | caf41d7 | 2013-08-14 13:16:51 +0200 | [diff] [blame] | 37 | Intended for interactive use only, unless format is JSON, or |
| 38 | JSON_SINGLE. |
Shawn O. Pearce | 7c5941b | 2009-11-17 20:47:04 -0800 | [diff] [blame] | 39 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 40 | == EXAMPLES |
Shawn O. Pearce | 7c5941b | 2009-11-17 20:47:04 -0800 | [diff] [blame] | 41 | To 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 Rosenberg | 524a303 | 2012-10-14 14:24:36 +0200 | [diff] [blame] | 50 | gerrit> update accounts set ssh_user_name = 'alice' where account_id=1; |
Shawn O. Pearce | 7c5941b | 2009-11-17 20:47:04 -0800 | [diff] [blame] | 51 | 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 | |
| 58 | GERRIT |
| 59 | ------ |
| 60 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 61 | |
| 62 | SEARCHBOX |
| 63 | --------- |