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 |
Michael Ochmann | e2d76a1 | 2016-06-23 17:07:37 +0200 | [diff] [blame] | 7 | [verse] |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 8 | -- |
Michael Ochmann | e2d76a1 | 2016-06-23 17:07:37 +0200 | [diff] [blame] | 9 | _ssh_ -p <port> <host> _gerrit gsql_ |
Christian Aistleitner | caf41d7 | 2013-08-14 13:16:51 +0200 | [diff] [blame] | 10 | [--format {PRETTY | JSON | JSON_SINGLE}] |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 11 | [-c QUERY] |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 12 | -- |
Shawn O. Pearce | 7c5941b | 2009-11-17 20:47:04 -0800 | [diff] [blame] | 13 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 14 | == DESCRIPTION |
Shawn O. Pearce | 7c5941b | 2009-11-17 20:47:04 -0800 | [diff] [blame] | 15 | Provides interactive query support directly against the underlying |
| 16 | SQL database used by the host Gerrit server. All SQL statements |
| 17 | are supported, including SELECT, UPDATE, INSERT, DELETE and ALTER. |
| 18 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 19 | == OPTIONS |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 20 | --format:: |
Shawn O. Pearce | 177ddac | 2010-02-26 18:42:49 -0800 | [diff] [blame] | 21 | 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 Aistleitner | caf41d7 | 2013-08-14 13:16:51 +0200 | [diff] [blame] | 26 | In JSON_SINGLE mode the whole result set is output as a |
| 27 | single JSON object. |
Shawn O. Pearce | 177ddac | 2010-02-26 18:42:49 -0800 | [diff] [blame] | 28 | |
| 29 | -c:: |
| 30 | Execute the single query statement supplied, and then exit. |
| 31 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 32 | == ACCESS |
Edwin Kempin | da062b0 | 2013-08-06 08:28:16 +0200 | [diff] [blame] | 33 | Caller must have been granted the |
| 34 | link:access-control.html#capability_accessDatabase[Access Database] |
| 35 | global capability. |
Shawn O. Pearce | 7c5941b | 2009-11-17 20:47:04 -0800 | [diff] [blame] | 36 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 37 | == SCRIPTING |
Christian Aistleitner | caf41d7 | 2013-08-14 13:16:51 +0200 | [diff] [blame] | 38 | Intended for interactive use only, unless format is JSON, or |
| 39 | JSON_SINGLE. |
Shawn O. Pearce | 7c5941b | 2009-11-17 20:47:04 -0800 | [diff] [blame] | 40 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 41 | == EXAMPLES |
Shawn O. Pearce | 7c5941b | 2009-11-17 20:47:04 -0800 | [diff] [blame] | 42 | To manually correct a user's SSH user name: |
| 43 | |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 44 | ---- |
Shawn O. Pearce | 7c5941b | 2009-11-17 20:47:04 -0800 | [diff] [blame] | 45 | $ 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 Rosenberg | 524a303 | 2012-10-14 14:24:36 +0200 | [diff] [blame] | 51 | 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] | 52 | 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 Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 57 | ---- |
Shawn O. Pearce | 7c5941b | 2009-11-17 20:47:04 -0800 | [diff] [blame] | 58 | |
| 59 | GERRIT |
| 60 | ------ |
| 61 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 62 | |
| 63 | SEARCHBOX |
| 64 | --------- |