aboutsummaryrefslogtreecommitdiff
path: root/Documentation/cmd-gsql.txt
blob: 3c4f1b52dfbc44d80f7686bf78e530bbb25f1e64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
gerrit gsql
===========

NAME
----
gerrit gsql - Administrative interface to active database

SYNOPSIS
--------
[verse]
'ssh' -p <port> <host> 'gerrit gsql'
  [--format {PRETTY | JSON}]
  [-c QUERY]

DESCRIPTION
-----------
Provides interactive query support directly against the underlying
SQL database used by the host Gerrit server.  All SQL statements
are supported, including SELECT, UPDATE, INSERT, DELETE and ALTER.

OPTIONS
-------
--format::
	Set the format records are output in.  In PRETTY (the
	default) records are displayed in a tabular output suitable
	for reading by a human on a sufficiently wide terminal.
	In JSON mode records are output as JSON objects using the
	column names as the property names, one object per line.

-c::
	Execute the single query statement supplied, and then exit.

ACCESS
------
Caller must be a member of the privileged 'Administrators' group.

SCRIPTING
---------
Intended for interactive use only, unless format is JSON.

EXAMPLES
--------
To manually correct a user's SSH user name:

====
	$ ssh -p 29418 review.example.com gerrit gsql
	Welcome to Gerrit Code Review v2.0.25
	(PostgreSQL 8.3.8)

	Type '\h' for help.  Type '\r' to clear the buffer.

	gerrit> update accounts set ssh_user_name = 'alice' where account_id=1;       
	UPDATE 1; 1 ms
	gerrit> \q
	Bye

	$ ssh -p 29418 review.example.com gerrit flush-caches --cache sshkeys --cache accounts
====

GERRIT
------
Part of link:index.html[Gerrit Code Review]