Skip to content

Commit

Permalink
add standard comparison operators, make no changes to defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitRanque committed Jan 16, 2025
1 parent 6fa57df commit 2d2084f
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/configuration/src/version3/metadata/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ pub struct ComparisonOperator {
pub enum OperatorKind {
Equal,
In,
LessThan,
LessThanOrEqual,
GreaterThan,
GreaterThanOrEqual,
Custom,
}

Expand Down
10 changes: 10 additions & 0 deletions crates/configuration/src/version3/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,16 @@ fn convert_operator_kind(
match operator_kind {
metadata::OperatorKind::Equal => query_engine_metadata::metadata::OperatorKind::Equal,
metadata::OperatorKind::In => query_engine_metadata::metadata::OperatorKind::In,
metadata::OperatorKind::LessThan => query_engine_metadata::metadata::OperatorKind::LessThan,
metadata::OperatorKind::LessThanOrEqual => {
query_engine_metadata::metadata::OperatorKind::LessThanOrEqual
}
metadata::OperatorKind::GreaterThan => {
query_engine_metadata::metadata::OperatorKind::GreaterThan
}
metadata::OperatorKind::GreaterThanOrEqual => {
query_engine_metadata::metadata::OperatorKind::GreaterThanOrEqual
}
metadata::OperatorKind::Custom => query_engine_metadata::metadata::OperatorKind::Custom,
}
}
Expand Down
4 changes: 4 additions & 0 deletions crates/configuration/src/version4/metadata/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ pub struct ComparisonOperator {
pub enum OperatorKind {
Equal,
In,
LessThan,
LessThanOrEqual,
GreaterThan,
GreaterThanOrEqual,
Custom,
}

Expand Down
10 changes: 10 additions & 0 deletions crates/configuration/src/version4/to_runtime_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,16 @@ fn convert_operator_kind(
match operator_kind {
metadata::OperatorKind::Equal => query_engine_metadata::metadata::OperatorKind::Equal,
metadata::OperatorKind::In => query_engine_metadata::metadata::OperatorKind::In,
metadata::OperatorKind::LessThan => query_engine_metadata::metadata::OperatorKind::LessThan,
metadata::OperatorKind::LessThanOrEqual => {
query_engine_metadata::metadata::OperatorKind::LessThanOrEqual
}
metadata::OperatorKind::GreaterThan => {
query_engine_metadata::metadata::OperatorKind::GreaterThan
}
metadata::OperatorKind::GreaterThanOrEqual => {
query_engine_metadata::metadata::OperatorKind::GreaterThanOrEqual
}
metadata::OperatorKind::Custom => query_engine_metadata::metadata::OperatorKind::Custom,
}
}
Expand Down
8 changes: 8 additions & 0 deletions crates/configuration/src/version4/upgrade_from_v3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ fn upgrade_operator_kind(
match operator_kind {
version3::metadata::OperatorKind::Equal => metadata::OperatorKind::Equal,
version3::metadata::OperatorKind::In => metadata::OperatorKind::In,
version3::metadata::OperatorKind::LessThan => metadata::OperatorKind::LessThan,
version3::metadata::OperatorKind::LessThanOrEqual => {
metadata::OperatorKind::LessThanOrEqual
}
version3::metadata::OperatorKind::GreaterThan => metadata::OperatorKind::GreaterThan,
version3::metadata::OperatorKind::GreaterThanOrEqual => {
metadata::OperatorKind::GreaterThanOrEqual
}
version3::metadata::OperatorKind::Custom => metadata::OperatorKind::Custom,
}
}
Expand Down
4 changes: 4 additions & 0 deletions crates/configuration/src/version5/metadata/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ pub struct ComparisonOperator {
pub enum OperatorKind {
Equal,
In,
LessThan,
LessThanOrEqual,
GreaterThan,
GreaterThanOrEqual,
Custom,
}

Expand Down
10 changes: 10 additions & 0 deletions crates/configuration/src/version5/to_runtime_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,16 @@ fn convert_operator_kind(
match operator_kind {
metadata::OperatorKind::Equal => query_engine_metadata::metadata::OperatorKind::Equal,
metadata::OperatorKind::In => query_engine_metadata::metadata::OperatorKind::In,
metadata::OperatorKind::LessThan => query_engine_metadata::metadata::OperatorKind::LessThan,
metadata::OperatorKind::LessThanOrEqual => {
query_engine_metadata::metadata::OperatorKind::LessThanOrEqual
}
metadata::OperatorKind::GreaterThan => {
query_engine_metadata::metadata::OperatorKind::GreaterThan
}
metadata::OperatorKind::GreaterThanOrEqual => {
query_engine_metadata::metadata::OperatorKind::GreaterThanOrEqual
}
metadata::OperatorKind::Custom => query_engine_metadata::metadata::OperatorKind::Custom,
}
}
Expand Down
8 changes: 8 additions & 0 deletions crates/configuration/src/version5/upgrade_from_v4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ fn upgrade_operator_kind(
match operator_kind {
version4::metadata::OperatorKind::Equal => metadata::OperatorKind::Equal,
version4::metadata::OperatorKind::In => metadata::OperatorKind::In,
version4::metadata::OperatorKind::LessThan => metadata::OperatorKind::LessThan,
version4::metadata::OperatorKind::LessThanOrEqual => {
metadata::OperatorKind::LessThanOrEqual
}
version4::metadata::OperatorKind::GreaterThan => metadata::OperatorKind::GreaterThan,
version4::metadata::OperatorKind::GreaterThanOrEqual => {
metadata::OperatorKind::GreaterThanOrEqual
}
version4::metadata::OperatorKind::Custom => metadata::OperatorKind::Custom,
}
}
Expand Down
12 changes: 12 additions & 0 deletions crates/connectors/ndc-postgres/src/schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ pub fn get_schema(
metadata::OperatorKind::In => {
models::ComparisonOperatorDefinition::In
}
metadata::OperatorKind::LessThan => {
models::ComparisonOperatorDefinition::LessThan
}
metadata::OperatorKind::LessThanOrEqual => {
models::ComparisonOperatorDefinition::LessThanOrEqual
}
metadata::OperatorKind::GreaterThan => {
models::ComparisonOperatorDefinition::GreaterThan
}
metadata::OperatorKind::GreaterThanOrEqual => {
models::ComparisonOperatorDefinition::GreaterThanOrEqual
}
metadata::OperatorKind::Custom => {
models::ComparisonOperatorDefinition::Custom {
argument_type: models::Type::Named {
Expand Down
4 changes: 4 additions & 0 deletions crates/query-engine/metadata/src/metadata/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ pub struct ComparisonOperator {
pub enum OperatorKind {
Equal,
In,
LessThan,
LessThanOrEqual,
GreaterThan,
GreaterThanOrEqual,
Custom,
}

Expand Down

0 comments on commit 2d2084f

Please sign in to comment.