diff --git a/data-access-layer/relational/relational.proto b/data-access-layer/relational/relational.proto
index ea6c9e7..4b545b9 100644
--- a/data-access-layer/relational/relational.proto
+++ b/data-access-layer/relational/relational.proto
@@ -57,39 +57,79 @@ message Value {
}
}
+message TypedColumn {
+ string schema = 1;
+ string table_name = 2;
+ string name = 3;
+ optional string alias = 4;
+ ColumnType type = 5;
+}
+
message Column {
- optional string table_name = 1;
- string name = 2;
- optional ColumnType type = 3;
+ string schema = 1;
+ string table_name = 2;
+ string name = 3;
}
-message WhereCriteria {
+message ReturningColumn {
+ string name = 1;
+ optional string alias = 2;
+ ColumnType type = 3;
+}
+
+message Condition {
Operator operator = 1;
- string key = 2;
- Value value = 3;
+ Column key = 2;
+ repeated Value value = 3;
+}
+
+message AndWhere {
+ repeated WhereCriteria where = 1;
+}
+
+message OrWhere {
+ repeated WhereCriteria where = 1;
+}
+
+message WhereCriteria {
+ oneof where_type {
+ Condition condition = 1;
+ AndWhere and = 2;
+ OrWhere or =3;
+ }
}
message RawQuery {
string query = 1;
}
+message Table {
+ string schema = 1;
+ string table_name = 2;
+}
+
+message JoinCondition {
+ Operator operator = 1;
+ Column left = 2;
+ oneof right {
+ Value value = 3;
+ Column column = 4;
+ }
+}
+
message Join {
JoinType type = 1;
- optional string from_table_schema = 2;
- optional string join_table_schema = 3;
- string from_table = 4;
- string join_table = 5;
- string from_column = 6;
- string join_column = 7;
+ Table table = 2;
+ repeated JoinCondition conditions = 3;
}
message SelectQuery {
- optional string schema = 1;
+ string schema = 1;
string table = 2;
- repeated Column column = 3;
+ repeated TypedColumn column = 3;
repeated WhereCriteria where = 4;
- repeated string group_by = 5;
- repeated string order_by = 6;
+ repeated Column group_by = 5;
+ repeated Column order_by = 6;
repeated Join join = 7;
uint32 limit = 8;
uint32 offset = 9;
@@ -101,12 +141,13 @@ message ColumnValue {
}
message InsertQuery {
- optional string schema = 1;
+ string schema = 1;
string table = 2;
repeated ColumnValue column_value = 3;
optional string id_column = 4;
optional string id_sequence = 5;
optional string id_table = 6;
+ repeated ReturningColumn returning_fields = 7;
}
message BulkInsertQuery {
@@ -114,14 +155,14 @@ message BulkInsertQuery {
}
message UpdateQuery {
- optional string schema = 1;
+ string schema = 1;
string table = 2;
repeated ColumnValue column_value = 3;
repeated WhereCriteria where = 4;
}
message DeleteQuery {
- optional string schema = 1;
+ string schema = 1;
string table = 2;
repeated WhereCriteria where = 3;
}
@@ -153,7 +194,11 @@ message RawQueryResult {
}
message InsertQueryResult {
- uint64 last_insert_id = 1;
+ oneof insert_result_type {
+ uint64 last_insert_id = 1;
+ Row row = 2;
+ uint64 affected_rows = 3;
+ }
}
message UpdateQueryResult {
diff --git a/pom-or.xml b/pom-or.xml
new file mode 100644
index 0000000..dee53e3
--- /dev/null
+++ b/pom-or.xml
@@ -0,0 +1,113 @@
+
+
+ 4.0.0
+
+
+ com.topcoder
+ tc-dal-protos
+ 1.0-SNAPSHOT
+ ./pom.xml
+
+
+ com.topcoder
+ tc-dal-or-sync-proto
+ 1.0-SNAPSHOT
+
+
+ 8
+ 8
+ UTF-8
+
+ 3.21.12
+ 0.6.1
+ 1.51.0
+
+
+
+
+ io.grpc
+ grpc-stub
+ ${grpc.version}
+
+
+ io.grpc
+ grpc-protobuf
+ ${grpc.version}
+
+
+ jakarta.annotation
+ jakarta.annotation-api
+ 2.1.0
+ true
+
+
+ javax.annotation
+ javax.annotation-api
+ 1.3.2
+
+
+
+
+
+
+ org.xolstice.maven.plugins
+ protobuf-maven-plugin
+ ${protobuf-plugin.version}
+
+
+ com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}
+ grpc-java
+
+ io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}
+ ${basedir}
+
+ domain-layer/legacy/sync.proto
+ domain-layer/legacy/services/sync.proto
+
+
+
+
+
+ compile
+ compile-custom
+
+
+
+
+
+ kr.motd.maven
+ os-maven-plugin
+ 1.7.0
+
+
+ initialize
+
+ detect
+
+
+
+
+
+
+
+
+ aggregate-all
+
+ abc-codegen
+ stellar-codegen
+ abc-engine
+ stellar-engine
+
+
+
+ aggregate-codegen
+
+ abc-codegen
+ stellar-codegen
+
+
+
+
+
\ No newline at end of file
diff --git a/pom-pal.xml b/pom-pal.xml
new file mode 100644
index 0000000..65a02f9
--- /dev/null
+++ b/pom-pal.xml
@@ -0,0 +1,94 @@
+
+
+ 4.0.0
+
+
+ com.topcoder
+ tc-dal-protos
+ 1.0-SNAPSHOT
+ ./pom.xml
+
+
+ com.topcoder
+ tc-dal-rdb-proto
+ 1.2-SNAPSHOT
+
+
+ 17
+ 17
+ UTF-8
+
+ 3.21.12
+ 0.6.1
+ 1.51.0
+
+
+
+
+ io.grpc
+ grpc-stub
+ ${grpc.version}
+
+
+ io.grpc
+ grpc-protobuf
+ ${grpc.version}
+
+
+ jakarta.annotation
+ jakarta.annotation-api
+ 2.1.0
+ true
+
+
+ javax.annotation
+ javax.annotation-api
+ 1.3.2
+
+
+
+
+
+
+ org.xolstice.maven.plugins
+ protobuf-maven-plugin
+ ${protobuf-plugin.version}
+
+
+ com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}
+ grpc-java
+
+ io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}
+ ${basedir}
+
+ data-access-layer/relational/relational.proto
+
+
+
+
+
+ compile
+ compile-custom
+
+
+
+
+
+ kr.motd.maven
+ os-maven-plugin
+ 1.7.0
+
+
+ initialize
+
+ detect
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 7141dfa..afdc21e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,14 +5,16 @@
4.0.0
com.topcoder
- tc-dal-or-sync-proto
+ tc-dal-protos
+ pom
1.0-SNAPSHOT
-
- 8
- 8
- UTF-8
+
+ pom-or.xml
+ pom-pal.xml
+
+
3.21.12
0.6.1
1.51.0
@@ -41,48 +43,4 @@
1.3.2
-
-
-
-
- org.xolstice.maven.plugins
- protobuf-maven-plugin
- ${protobuf-plugin.version}
-
-
- com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}
- grpc-java
-
- io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}
- ${basedir}
-
- domain-layer/legacy/sync.proto
- domain-layer/legacy/services/sync.proto
-
-
-
-
-
- compile
- compile-custom
-
-
-
-
-
- kr.motd.maven
- os-maven-plugin
- 1.7.0
-
-
- initialize
-
- detect
-
-
-
-
-
-
-
\ No newline at end of file