alex-dukhno / isomorphicdb

The core repository of implementing PostgreSQL compatible distributed database in Rust
http://isomorphicdb.io/
Apache License 2.0
224 stars 20 forks source link

Add Filter operator to Select, Update, Delete query plans #562

Closed alex-dukhno closed 3 years ago

alex-dukhno commented 3 years ago

No issue to close

image

Description

add the simplest support for where clause in select, update and delete queries for simple PostgreSQL queries

Client output

e.g. for psql

postgres=> create schema schema_name;
CREATE SCHEMA
postgres=> create table schema_name.table_name (col1 smallint, col2 smallint, col3 smallint);
CREATE TABLE
postgres=> insert into schema_name.table_name values (1, 2, 3), (4, 5, 6), (7, 8, 9);
INSERT 0 3
postgres=> update schema_name.table_name set col1 = 7 where col1 = 4;
UPDATE 1
postgres=> select * from schema_name.table_name where col1 = 4
postgres-> ;
 col1 | col2 | col3
------+------+------
(0 rows)

postgres=> select * from schema_name.table_name where col1 = 7;
 col1 | col2 | col3
------+------+------
    7 |    5 |    6
    7 |    8 |    9
(2 rows)

postgres=> delete from schema_name.table_name where col2 = 5;
DELETE 1
postgres=> select * from schema_name.table_name where col1 = 7;
 col1 | col2 | col3
------+------+------
    7 |    8 |    9
(1 row)
coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 738826771


Changes Missing Coverage Covered Lines Changed/Added Lines %
node_engine/src/lib.rs 0 1 0.0%
sql_engine/data_manipulation/query_plan/src/lib.rs 62 74 83.78%
node_engine/src/query_engine/mod.rs 63 116 54.31%
<!-- Total: 163 229 71.18% -->
Files with Coverage Reduction New Missed Lines %
node_engine/src/query_engine/mod.rs 1 55.9%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 738500769: 0.05%
Covered Lines: 2540
Relevant Lines: 3713

💛 - Coveralls