summaryrefslogtreecommitdiffstats
path: root/test/features/iocommands.feature
blob: 95366eba8897188b2fe1ff3e9b668661b7f3591b (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
Feature: I/O commands

  Scenario: edit sql in file with external editor
     When we start external editor providing a file name
      and we type "select * from abc" in the editor
      and we exit the editor
      then we see dbcli prompt
      and we see "select * from abc" in prompt

  Scenario: tee output from query
     When we tee output
      and we wait for prompt
      and we select "select 123456"
      and we wait for prompt
      and we notee output
      and we wait for prompt
      then we see 123456 in tee output

   Scenario: set delimiter
      When we query "delimiter $"
      then delimiter is set to "$"

   Scenario: set delimiter twice
      When we query "delimiter $"
      and we query "delimiter ]]"
      then delimiter is set to "]]"

   Scenario: set delimiter and query on same line
      When we query "select 123; delimiter $ select 456 $ delimiter %"
      then we see result "123"
      and we see result "456"
      and delimiter is set to "%"

   Scenario: send output to file
      When we query "\o /tmp/output1.sql"
      and we query "select 123"
      and we query "system cat /tmp/output1.sql"
      then we see result "123"

   Scenario: send output to file two times
      When we query "\o /tmp/output1.sql"
      and we query "select 123"
      and we query "\o /tmp/output2.sql"
      and we query "select 456"
      and we query "system cat /tmp/output2.sql"
      then we see result "456"