Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

feat: add schema to execute and admin execute requests (#13662)

boojack99865375b1d8
diff --git a/backend/api/v1/sql_service.go b/backend/api/v1/sql_service.go
index e17508a29b..41b719173d 100644
--- a/backend/api/v1/sql_service.go
+++ b/backend/api/v1/sql_service.go
@@ -124,7 +124,11 @@ func (s *SQLService) AdminExecute(server v1pb.SQLService_AdminExecuteServer) err
}
}
- result, duration, queryErr := executeWithTimeout(ctx, driver, conn, request.Statement, request.Timeout, db.QueryContext{})
+ queryContext := db.QueryContext{}
+ if request.Schema != nil {
+ queryContext.Schema = *request.Schema
+ }
+ result, duration, queryErr := executeWithTimeout(ctx, driver, conn, request.Statement, request.Timeout, queryContext)
if err := s.createQueryHistory(ctx, database, store.QueryHistoryTypeQuery, request.Statement, user.ID, duration, queryErr); err != nil {
slog.Error("failed to post admin execute activity", log.BBError(err))
@@ -170,7 +174,11 @@ func (s *SQLService) Execute(ctx context.Context, request *v1pb.ExecuteRequest)
defer conn.Close()
}
- results, duration, queryErr := executeWithTimeout(ctx, driver, conn, request.Name, request.Timeout, db.QueryContext{})
+ queryContext := db.QueryContext{}
+ if request.Schema != nil {
+ queryContext.Schema = *request.Schema
+ }
+ results, duration, queryErr := executeWithTimeout(ctx, driver, conn, request.Name, request.Timeout, queryContext)
if err := s.createQueryHistory(ctx, database, store.QueryHistoryTypeQuery, request.Statement, user.ID, duration, queryErr); err != nil {
slog.Error("failed to post admin execute activity", log.BBError(err))
diff --git a/frontend/src/types/proto/v1/sql_service.ts b/frontend/src/types/proto/v1/sql_service.ts
index c423ddf7bf..0caa3f67ba 100644
--- a/frontend/src/types/proto/v1/sql_service.ts
+++ b/frontend/src/types/proto/v1/sql_service.ts
@@ -30,7 +30,11 @@ export interface ExecuteRequest {
/** The maximum number of rows to return. */
limit: number;
/** The timeout for the request. */
- timeout: Duration | undefined;
+ timeout:
+ | Duration
+ | undefined;
+ /** The default schema to execute the statement. Equals to the current schema in Oracle and search path in Postgres. */
+ schema?: string | undefined;
}
export interface ExecuteResponse {
@@ -51,7 +55,11 @@ export interface AdminExecuteRequest {
/** The maximum number of rows to return. */
limit: number;
/** The timeout for the request. */
- timeout: Duration | undefined;
+ timeout:
+ | Duration
+ | undefined;
+ /** The default schema to execute the statement. Equals to the current schema in Oracle and search path in Postgres. */
+ schema?: string | undefined;
}
export interface AdminExecuteResponse {
@@ -81,7 +89,7 @@ export interface QueryRequest {
dataSourceId: string;
/** Explain the statement. */
explain: boolean;
- /** The default schema to search objects. Equals to the default schema in Oracle and search path in Postgres. */
+ /** The default schema to search objects. Equals to the current schema in Oracle and search path in Postgres. */
schema?: string | undefined;
}
@@ -534,7 +542,7 @@ export interface GenerateRestoreSQLResponse {
}
function createBaseExecuteRequest(): ExecuteRequest {
- return { name: "", statement: "", limit: 0, timeout: undefined };
+ return { name: "", statement: "", limit: 0, timeout: undefined, schema: undefined };
}
export const ExecuteRequest = {
@@ -551,6 +559,9 @@ export const ExecuteRequest = {
if (message.timeout !== undefined) {
Duration.encode(message.timeout, writer.uint32(34).fork()).ldelim();
}
+ if (message.schema !== undefined) {
+ writer.uint32(42).string(message.schema);
+ }
return writer;
},
@@ -589,6 +600,13 @@ export const ExecuteRequest = {
message.timeout = Duration.decode(reader, reader.uint32());
continue;
+ case 5:
+ if (tag !== 42) {
+ break;
+ }
+
+ message.schema = reader.string();
+ continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -604,6 +622,7 @@ export const ExecuteRequest = {
statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
timeout: isSet(object.timeout) ? Duration.fromJSON(object.timeout) : undefined,
+ schema: isSet(object.schema) ? globalThis.String(object.schema) : undefined,
};
},
@@ -621,6 +640,9 @@ export const ExecuteRequest = {
if (message.timeout !== undefined) {
obj.timeout = Duration.toJSON(message.timeout);
}
+ if (message.schema !== undefined) {
+ obj.schema = message.schema;
+ }
return obj;
},
@@ -635,6 +657,7 @@ export const ExecuteRequest = {
message.timeout = (object.timeout !== undefined && object.timeout !== null)
? Duration.fromPartial(object.timeout)
: undefined;
+ message.schema = object.schema ?? undefined;
return message;
},
};
@@ -714,7 +737,7 @@ export const ExecuteResponse = {
};
function createBaseAdminExecuteRequest(): AdminExecuteRequest {
- return { name: "", statement: "", limit: 0, timeout: undefined };
+ return { name: "", statement: "", limit: 0, timeout: undefined, schema: undefined };
}
export const AdminExecuteRequest = {
@@ -731,6 +754,9 @@ export const AdminExecuteRequest = {
if (message.timeout !== undefined) {
Duration.encode(message.timeout, writer.uint32(42).fork()).ldelim();
}
+ if (message.schema !== undefined) {
+ writer.uint32(50).string(message.schema);
+ }
return writer;
},
@@ -769,6 +795,13 @@ export const AdminExecuteRequest = {
message.timeout = Duration.decode(reader, reader.uint32());
continue;
+ case 6:
+ if (tag !== 50) {
+ break;
+ }
+
+ message.schema = reader.string();
+ continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -784,6 +817,7 @@ export const AdminExecuteRequest = {
statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
timeout: isSet(object.timeout) ? Duration.fromJSON(object.timeout) : undefined,
+ schema: isSet(object.schema) ? globalThis.String(object.schema) : undefined,
};
},
@@ -801,6 +835,9 @@ export const AdminExecuteRequest = {
if (message.timeout !== undefined) {
obj.timeout = Duration.toJSON(message.timeout);
}
+ if (message.schema !== undefined) {
+ obj.schema = message.schema;
+ }
return obj;
},
@@ -815,6 +852,7 @@ export const AdminExecuteRequest = {
message.timeout = (object.timeout !== undefined && object.timeout !== null)
? Duration.fromPartial(object.timeout)
: undefined;
+ message.schema = object.schema ?? undefined;
return message;
},
};
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 8f7fe40d50..54e0d48309 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -7776,6 +7776,11 @@ paths:
pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
type: string
description: Represents a a duration between -315,576,000,000s and 315,576,000,000s (around 10000 years). Precision is in nanoseconds. 1 nanosecond is represented as 0.000000001s
+ - name: schema
+ in: query
+ description: The default schema to execute the statement. Equals to the current schema in Oracle and search path in Postgres.
+ schema:
+ type: string
responses:
"200":
description: OK
@@ -9430,6 +9435,9 @@ components:
pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
type: string
description: The timeout for the request.
+ schema:
+ type: string
+ description: The default schema to execute the statement. Equals to the current schema in Oracle and search path in Postgres.
ExecuteResponse:
type: object
properties:
@@ -11664,7 +11672,7 @@ components:
description: Explain the statement.
schema:
type: string
- description: The default schema to search objects. Equals to the default schema in Oracle and search path in Postgres.
+ description: The default schema to search objects. Equals to the current schema in Oracle and search path in Postgres.
QueryResponse:
type: object
properties:
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 1d9b871317..7ebed7177c 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -10060,6 +10060,7 @@ Type of the SheetPayload.
| statement | [string](#string) | | The SQL statement to execute. |
| limit | [int32](#int32) | | The maximum number of rows to return. |
| timeout | [google.protobuf.Duration](#google-protobuf-Duration) | | The timeout for the request. |
+| schema | [string](#string) | optional | The default schema to execute the statement. Equals to the current schema in Oracle and search path in Postgres. |
@@ -10181,6 +10182,7 @@ Type of the SheetPayload.
| statement | [string](#string) | | The SQL statement to execute. |
| limit | [int32](#int32) | | The maximum number of rows to return. |
| timeout | [google.protobuf.Duration](#google-protobuf-Duration) | | The timeout for the request. |
+| schema | [string](#string) | optional | The default schema to execute the statement. Equals to the current schema in Oracle and search path in Postgres. |
@@ -10371,7 +10373,7 @@ Type of the SheetPayload.
| timeout | [google.protobuf.Duration](#google-protobuf-Duration) | optional | The timeout for the request. |
| data_source_id | [string](#string) | | The id of data source. It is used for querying admin data source even if the instance has read-only data sources. Or it can be used to query a specific read-only data source. |
| explain | [bool](#bool) | | Explain the statement. |
-| schema | [string](#string) | optional | The default schema to search objects. Equals to the default schema in Oracle and search path in Postgres. |
+| schema | [string](#string) | optional | The default schema to search objects. Equals to the current schema in Oracle and search path in Postgres. |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 0c4a62c235..6ea5e3cba2 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -27398,6 +27398,13 @@ Format: instances/{instance}/databases/{databaseName} </p></td>
<td><p>The timeout for the request. </p></td>
</tr>
+ <tr>
+ <td>schema</td>
+ <td><a href="#string">string</a></td>
+ <td>optional</td>
+ <td><p>The default schema to execute the statement. Equals to the current schema in Oracle and search path in Postgres. </p></td>
+ </tr>
+
</tbody>
</table>
@@ -27682,6 +27689,13 @@ Format: instances/{instance}/databases/{databaseName} </p></td>
<td><p>The timeout for the request. </p></td>
</tr>
+ <tr>
+ <td>schema</td>
+ <td><a href="#string">string</a></td>
+ <td>optional</td>
+ <td><p>The default schema to execute the statement. Equals to the current schema in Oracle and search path in Postgres. </p></td>
+ </tr>
+
</tbody>
</table>
@@ -28140,7 +28154,7 @@ Or it can be used to query a specific read-only data source. </p></td>
<td>schema</td>
<td><a href="#string">string</a></td>
<td>optional</td>
- <td><p>The default schema to search objects. Equals to the default schema in Oracle and search path in Postgres. </p></td>
+ <td><p>The default schema to search objects. Equals to the current schema in Oracle and search path in Postgres. </p></td>
</tr>
</tbody>
diff --git a/proto/generated-go/v1/sql_service.pb.go b/proto/generated-go/v1/sql_service.pb.go
index 1e475cfdf7..9036556657 100644
--- a/proto/generated-go/v1/sql_service.pb.go
+++ b/proto/generated-go/v1/sql_service.pb.go
@@ -195,6 +195,8 @@ type ExecuteRequest struct {
Limit int32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
// The timeout for the request.
Timeout *durationpb.Duration `protobuf:"bytes,4,opt,name=timeout,proto3" json:"timeout,omitempty"`
+ // The default schema to execute the statement. Equals to the current schema in Oracle and search path in Postgres.
+ Schema *string `protobuf:"bytes,5,opt,name=schema,proto3,oneof" json:"schema,omitempty"`
}
func (x *ExecuteRequest) Reset() {
@@ -257,6 +259,13 @@ func (x *ExecuteRequest) GetTimeout() *durationpb.Duration {
return nil
}
+func (x *ExecuteRequest) GetSchema() string {
+ if x != nil && x.Schema != nil {
+ return *x.Schema
+ }
+ return ""
+}
+
type ExecuteResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -328,6 +337,8 @@ type AdminExecuteRequest struct {
Limit int32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"`
// The timeout for the request.
Timeout *durationpb.Duration `protobuf:"bytes,5,opt,name=timeout,proto3" json:"timeout,omitempty"`
+ // The default schema to execute the statement. Equals to the current schema in Oracle and search path in Postgres.
+ Schema *string `protobuf:"bytes,6,opt,name=schema,proto3,oneof" json:"schema,omitempty"`
}
func (x *AdminExecuteRequest) Reset() {
@@ -390,6 +401,13 @@ func (x *AdminExecuteRequest) GetTimeout() *durationpb.Duration {
return nil
}
+func (x *AdminExecuteRequest) GetSchema() string {
+ if x != nil && x.Schema != nil {
+ return *x.Schema
+ }
+ return ""
+}
+
type AdminExecuteResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -458,7 +476,7 @@ type QueryRequest struct {
DataSourceId string `protobuf:"bytes,6,opt,name=data_source_id,json=dataSourceId,proto3" json:"data_source_id,omitempty"`
// Explain the statement.
Explain bool `protobuf:"varint,7,opt,name=explain,proto3" json:"explain,omitempty"`
- // The default schema to search objects. Equals to the default schema in Oracle and search path in Postgres.
+ // The default schema to search objects. Equals to the current schema in Oracle and search path in Postgres.
Schema *string `protobuf:"bytes,8,opt,name=schema,proto3,oneof" json:"schema,omitempty"`
}
@@ -2218,7 +2236,7 @@ var file_v1_sql_service_proto_rawDesc = []byte{
0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x1a, 0x0f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x1a, 0x19, 0x76, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f,
- 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xad, 0x01,
+ 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd5, 0x01,
0x0a, 0x0e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x32, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e,
0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x17, 0x0a, 0x15, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
@@ -2229,26 +2247,31 @@ var file_v1_sql_service_proto_rawDesc = []byte{
0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65,
0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61,
- 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x74, 0x0a,
- 0x0f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
- 0x12, 0x32, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
- 0x0b, 0x32, 0x18, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73,
- 0x75, 0x6c, 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x07, 0x61, 0x64, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18,
- 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x61, 0x64, 0x76, 0x69,
- 0x63, 0x65, 0x73, 0x22, 0xb8, 0x01, 0x0a, 0x13, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x78, 0x65,
- 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x04, 0x6e,
- 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e, 0xe2, 0x41, 0x01, 0x02, 0xfa,
- 0x41, 0x17, 0x0a, 0x15, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d,
- 0x2f, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
- 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a,
- 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69,
- 0x6d, 0x69, 0x74, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
- 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0x4a,
+ 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x1b, 0x0a,
+ 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52,
+ 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x73,
+ 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x74, 0x0a, 0x0f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65,
+ 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75,
+ 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73,
+ 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x07,
+ 0x61, 0x64, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x76, 0x69,
+ 0x63, 0x65, 0x52, 0x07, 0x61, 0x64, 0x76, 0x69, 0x63, 0x65, 0x73, 0x22, 0xe0, 0x01, 0x0a, 0x13,
+ 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
+ 0x09, 0x42, 0x1e, 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x17, 0x0a, 0x15, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
+ 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04,
+ 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x33, 0x0a, 0x07, 0x74,
+ 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44,
+ 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74,
+ 0x12, 0x1b, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09,
+ 0x48, 0x00, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a,
+ 0x07, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0x4a,
0x0a, 0x14, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74,
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
@@ -3063,6 +3086,8 @@ func file_v1_sql_service_proto_init() {
}
}
}
+ file_v1_sql_service_proto_msgTypes[0].OneofWrappers = []any{}
+ file_v1_sql_service_proto_msgTypes[2].OneofWrappers = []any{}
file_v1_sql_service_proto_msgTypes[4].OneofWrappers = []any{}
file_v1_sql_service_proto_msgTypes[8].OneofWrappers = []any{
(*RowValue_NullValue)(nil),
diff --git a/proto/v1/sql_service.proto b/proto/v1/sql_service.proto
index 3ec078c9fb..5bdc93e96c 100644
--- a/proto/v1/sql_service.proto
+++ b/proto/v1/sql_service.proto
@@ -135,6 +135,9 @@ message ExecuteRequest {
// The timeout for the request.
google.protobuf.Duration timeout = 4;
+
+ // The default schema to execute the statement. Equals to the current schema in Oracle and search path in Postgres.
+ optional string schema = 5;
}
message ExecuteResponse {
@@ -163,6 +166,9 @@ message AdminExecuteRequest {
// The timeout for the request.
google.protobuf.Duration timeout = 5;
+
+ // The default schema to execute the statement. Equals to the current schema in Oracle and search path in Postgres.
+ optional string schema = 6;
}
message AdminExecuteResponse {
@@ -197,7 +203,7 @@ message QueryRequest {
// Explain the statement.
bool explain = 7;
- // The default schema to search objects. Equals to the default schema in Oracle and search path in Postgres.
+ // The default schema to search objects. Equals to the current schema in Oracle and search path in Postgres.
optional string schema = 8;
}