Skip to content

Feat/pal #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 65 additions & 20 deletions data-access-layer/relational/relational.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -101,27 +141,28 @@ 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 {
repeated InsertQuery inserts = 1;
}

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;
}
Expand Down Expand Up @@ -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 {
Expand Down
113 changes: 113 additions & 0 deletions pom-or.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.topcoder</groupId>
<artifactId>tc-dal-protos</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>./pom.xml</relativePath>
</parent>

<groupId>com.topcoder</groupId>
<artifactId>tc-dal-or-sync-proto</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<protobuf.version>3.21.12</protobuf.version>
<protobuf-plugin.version>0.6.1</protobuf-plugin.version>
<grpc.version>1.51.0</grpc.version>
</properties>

<dependencies>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>2.1.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>${protobuf-plugin.version}</version>
<configuration>
<protocArtifact>
com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>
io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
<protoSourceRoot>${basedir}</protoSourceRoot>
<includes>
<include>domain-layer/legacy/sync.proto</include>
<include>domain-layer/legacy/services/sync.proto</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>compile-custom</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.0</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>detect</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>aggregate-all</id>
<modules>
<module>abc-codegen</module>
<module>stellar-codegen</module>
<module>abc-engine</module>
<module>stellar-engine</module>
</modules>
</profile>
<profile>
<id>aggregate-codegen</id>
<modules>
<module>abc-codegen</module>
<module>stellar-codegen</module>
</modules>
</profile>
</profiles>

</project>
94 changes: 94 additions & 0 deletions pom-pal.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.topcoder</groupId>
<artifactId>tc-dal-protos</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>./pom.xml</relativePath>
</parent>

<groupId>com.topcoder</groupId>
<artifactId>tc-dal-rdb-proto</artifactId>
<version>1.2-SNAPSHOT</version>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<protobuf.version>3.21.12</protobuf.version>
<protobuf-plugin.version>0.6.1</protobuf-plugin.version>
<grpc.version>1.51.0</grpc.version>
</properties>

<dependencies>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>2.1.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>${protobuf-plugin.version}</version>
<configuration>
<protocArtifact>
com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>
io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
<protoSourceRoot>${basedir}</protoSourceRoot>
<includes>
<include>data-access-layer/relational/relational.proto</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>compile-custom</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.0</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>detect</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Loading