-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
Description
Description
When the Console prints query results, pressing Ctrl+C closes the whole application instead of interrupting the query and/or closing the transaction.
Environment
- TypeDB distribution: Core
- TypeDB version: 3.2.0-rc2
- Environment: Mac
- Console version: 3.2.0-rc
- Other details:
Reproducible Steps
- Set up
Check that pressing Ctrl+C in an open transaction works correctly:
Welcome to TypeDB Console!
>> transaction read a
a::read>> # press Ctrl+C
>> # we existed the transaction, it's the first REPL again. We can do it multiple times:
>> transaction read a
a::read>>
>> transaction read a
a::read>>
>> transaction read a
a::read>>
>>
Prepare a big data set so your read query runs at least for a couple of seconds. E.g.:
define
attribute name,
value string;
attribute id,
value string;
entity person,
owns id @card(0..),
owns name;
And insert thousands of
insert $p isa person, has name "Alice", has id "1";
- Execute
Open a transaction:
a::read>>
Run a read query:
a::read>> match { $p isa person; } or { $p isa person, has name "John"; }; not {$p has id "5";}; not {$p has $n;}; $n isa name; $n == "Bob";
Press Enter twice and press Ctrl+C while seeing the answers being printed.
- Unexpected result
The whole app is closed:
$p | isa person, iid 0x1e00000000000000009fe9
--------
$n | isa name "Bob"
$p | isa person, iid 0x1e00000000000000009fea
--------
^C
λ ~/Downloads/typedb-all-mac-x86_64-3.2.0-rc2/
Expected result
We are back to the first REPL:
$p | isa person, iid 0x1e00000000000000009fe9
--------
$n | isa name "Bob"
$p | isa person, iid 0x1e00000000000000009fea
--------
^C
>>
and we can continue working with the driver.