splitgraph / seafowl

Analytical database for data-driven Web applications 🪶
https://seafowl.io
Apache License 2.0
388 stars 9 forks source link

Seafowl CLI initial implementation #468

Closed gruuya closed 7 months ago

gruuya commented 7 months ago

Add a basic CLI implementation that supports searchable history, multi-line comments and multi-statement queries:

gruuya@markogrujics-MacBook-Pro seafowl % cargo run -- --cli                                            
   Compiling seafowl v0.5.2 (/Users/gruuya/Splitgraph/seafowl)
    Finished dev [unoptimized + debuginfo] target(s) in 5.06s
     Running `target/debug/seafowl --cli`
default> create table t as values (1, 'one'), (2, 'two');
Error during planning: Table "t" already exists
default> drop table t;
Time: 0.006s
default> create table t as values (1, 'one'), (2, 'two');
Time: 0.023s
default> select *
from t
where column1 > 1;
+---------+---------+
| column1 | column2 |
+---------+---------+
| 2       | two     |
+---------+---------+
Time: 0.024s
default> select column1 from t; select column2 from t;
+---------+
| column1 |
+---------+
| 1       |
| 2       |
+---------+
+---------+
| column2 |
+---------+
| one     |
| two     |
+---------+
Time: 0.018s

Validation and highlighting can be covered separately.

Closes #467