Skip to content

Commit

Permalink
Fixes to protocol v1
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelbranco80 committed Dec 16, 2024
1 parent f26bde9 commit 26fdef8
Show file tree
Hide file tree
Showing 12 changed files with 139 additions and 127 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ syntax = "proto3";
option java_package = "com.rawlabs.protocol.das.v1";
option java_multiple_files = true;

package com.rawlabs.protocol.das.v1;
package com.rawlabs.protocol.das.v1.common;

message DASId {
string id = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ syntax = "proto3";
option java_package = "com.rawlabs.protocol.das.v1";
option java_multiple_files = true;

package com.rawlabs.protocol.das.v1;
package com.rawlabs.protocol.das.v1.common;

message Environment {
map<string, string> env = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ syntax = "proto3";
option java_package = "com.rawlabs.protocol.das.v1";
option java_multiple_files = true;

package com.rawlabs.protocol.das.v1;
package com.rawlabs.protocol.das.v1.functions;

import "com/rawlabs/protocol/das/v1/types/types.proto";
import "com/rawlabs/protocol/das/v1/types/values.proto";
Expand All @@ -28,14 +28,14 @@ message FunctionDefinition {
FunctionId function_id = 1;
optional string description = 2;
repeated ParameterDefinition params = 3;
Type return_type = 4;
com.rawlabs.protocol.das.v1.types.Type return_type = 4;
optional string return_description = 5;
}

message ParameterDefinition {
FunctionId function_id = 1;
optional string description = 2;
string name = 3;
Type type = 4;
optional Value default_value = 5;
com.rawlabs.protocol.das.v1.types.Type type = 4;
optional com.rawlabs.protocol.das.v1.types.Value default_value = 5;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ syntax = "proto3";
option java_package = "com.rawlabs.protocol.das.v1";
option java_multiple_files = true;

package com.rawlabs.protocol.das.v1;
package com.rawlabs.protocol.das.v1.query;

enum Operator {
EQUALS = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ syntax = "proto3";
option java_package = "com.rawlabs.protocol.das.v1";
option java_multiple_files = true;

package com.rawlabs.protocol.das.v1;
package com.rawlabs.protocol.das.v1.query;

import "com/rawlabs/protocol/das/v1/types/values.proto";
import "com/rawlabs/protocol/das/v1/filters/operators.proto";
import "com/rawlabs/protocol/das/v1/query/operators.proto";

message Qual {
string name = 1;
Operator operator = 2;
Value value = 3;
com.rawlabs.protocol.das.v1.types.Value value = 3;
}
39 changes: 39 additions & 0 deletions src/main/protobuf/com/rawlabs/protocol/das/v1/query/query.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright 2024 RAW Labs S.A.
*
* Use of this software is governed by the Business Source License
* included in the file licenses/BSL.txt.
*
* As of the Change Date specified in that file, in accordance with
* the Business Source License, use of this software will be governed
* by the Apache License, Version 2.0, included in the file
* licenses/APL.txt.
*/

syntax = "proto3";

option java_package = "com.rawlabs.protocol.das.v1";
option java_multiple_files = true;

package com.rawlabs.protocol.das.v1.query;

import "com/rawlabs/protocol/das/v1/query/quals.proto";

message Query {
repeated Qual quals = 1;
repeated string columns = 2;
optional SortKeys sort_keys = 3;
optional uint64 offset = 4;
optional uint64 limit = 5;
optional bool distinct = 6;
}

message SortKeys {
repeated SortKey sort_keys = 1;
}

message SortKey {
string name = 1;
bool is_reversed = 2;
bool nulls_first = 3;
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,33 @@ service FunctionsService {
}

message GetFunctionDefinitionsRequest {
DASId das_id = 1;
optional Environment env = 99;
com.rawlabs.protocol.das.v1.common.DASId das_id = 1;
optional com.rawlabs.protocol.das.v1.common.Environment env = 99;
}

message GetFunctionDefinitionsResponse {
repeated FunctionDefinition definitions = 1;
repeated com.rawlabs.protocol.das.v1.functions.FunctionDefinition definitions = 1;
}

message ExecuteFunctionRequest {
DASId das_id = 1;
FunctionId function_id = 2;
com.rawlabs.protocol.das.v1.common.DASId das_id = 1;
com.rawlabs.protocol.das.v1.functions.FunctionId function_id = 2;
repeated Argument args = 3;
optional Environment env = 99;
optional com.rawlabs.protocol.das.v1.common.Environment env = 99;
}

message Argument {
oneof value {
Value arg = 1;
com.rawlabs.protocol.das.v1.types.Value arg = 1;
NamedArgument named_arg = 2;
}
}

message NamedArgument {
string name = 1;
Value value = 2;
com.rawlabs.protocol.das.v1.types.Value value = 2;
}

message ExecuteFunctionResponse {
Value output = 1;
com.rawlabs.protocol.das.v1.types.Value output = 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,37 @@ option java_multiple_files = true;
package com.rawlabs.protocol.das.v1.services;

import "com/rawlabs/protocol/das/v1/common/das.proto";
import "com/rawlabs/protocol/das/v1/types/types.proto";
import "com/rawlabs/protocol/das/v1/query/operators.proto";

service RegistrationService {
rpc Register (RegisterRequest) returns (DASId);
rpc Unregister (DASId) returns (UnregisterResponse);
rpc Register (RegisterRequest) returns (com.rawlabs.protocol.das.v1.common.DASId);

rpc OperationsSupported (com.rawlabs.protocol.das.v1.common.DASId) returns (OperationsSupportedResponse);

rpc Unregister (com.rawlabs.protocol.das.v1.common.DASId) returns (UnregisterResponse);
}

message RegisterRequest {
DASDefinition definition = 1;
optional DASId id = 2;
com.rawlabs.protocol.das.v1.common.DASDefinition definition = 1;
optional com.rawlabs.protocol.das.v1.common.DASId id = 2;
}

message UnregisterResponse {
message OperationsSupportedResponse {
repeated FunctionSupported functionsSupported = 4;
repeated OperatorSupported operatorsSupported = 5;
}

message FunctionSupported {
string name = 1;
repeated com.rawlabs.protocol.das.v1.types.Type parameters = 2;
}

message OperatorSupported {
com.rawlabs.protocol.das.v1.query.Operator operator = 1;
com.rawlabs.protocol.das.v1.types.Type lhs = 2;
com.rawlabs.protocol.das.v1.types.Type rhs = 3;
}

message UnregisterResponse {
}
Loading

0 comments on commit 26fdef8

Please sign in to comment.