pdr Interactive Mode
pdr has an interactive mode which allows to
edit, add and delete data values in the database. This can be very
useful to correct errors, otherwise also to add subsequent comments and
willbe much easier and more comfortable than to execute SQL statements
in the database manually.
The interactive mode is started by the command line parameter
-i:
$ pdr -i
pdr 0.3.7, interactive mode (press ? for help)
2010-03-03 12:38:01 6.2 1m
6n
>
The symbol on the right is a prompt. pdr waits now for input. On the
left side of the line the last and youngest data row is shown the user
has created before. Using navigation commands you can now scroll your
data row by row and execute data manipulations. pdr's interacive mode
has the following commands:
-
|
jump to the previous
(older) data row
|
+
|
jump to the next (younger) data
row
|
^
|
jump to the first (oldest) data
row
|
$
|
jumpto the last (youngest) data
row
|
RET
|
repeat the last navigation
command
|
D[collection+]
|
delete one or more parts of the
data row, these parts a noted as collection-names separated by spaces,
when there are no collection-names specified at all the
whole data row is deleted, examples:
D
D a b c
|
expression
|
supplement the current data row
by the specified expression, if the data row has already data
values in collections
specified in the expression those will be actualized, this means
overwritten, otherwise they are added, the timestamp of the data
row cannot be changed
|
TAB
|
take the current data row as
expression for input, this is usefull to correct longer comment
without extering the whole expression again
|
?
|
show the help screen
|
q
|
terminate the interactive mode
and pdr
|
Example session:
$ pdr -i
pdr 0.3.7, interactive mode (press q to quit)
2010-03-03 12:38:01 6.2 1m
6n
> -
2010-03-03 08:13:32 5.7 1m 6n
7l
> Dm
2010-03-03 08:13:32 5.7 6n
7l
> ; comment
2010-03-03 08:13:32 5.7 6n 7l ; comment
> D ; l
n
2010-03-03 08:13:32
5.7
> D
2010-03-02 22:10:56 5.8
10l
> 12l 80.3k
2010-03-02 22:10:56 5.8 12l
80.3k
> +
2010-03-03 12:38:01 6.2 1m
6n
> q
$
Beginning with release 1.2.0 also rejections appear in interactive mode:
$ pdr
connecting to database
checking schema
looking for mail (IMAP)
[2010-12-09 17:15:21] 1.2.3.4.5
disconnecting from database
*** warning: !!! at least one expression has been rejected, try -r to
list rejections !!!
$ pdr -i
connecting to database
checking schema
pdr 1.2.0, interactive mode (press ? for help)
2010-12-09 17:15:21 !!! rejected !!!
1.2.3.4.5 >
2010-12-09 17:06:40 98.1*
34.2k
>
2010-12-09 16:35:14 1.2* 5k
3.4n
> q
disconnecting from database
$
The rejected line can now be modified or deleted using the D-command. If
the input has been modified so that we have a correct expression now it
will be inserted into the database and deleted from the rejections.