Skip to content

Commit

Permalink
checking in vtadmin.proto (and auto generated files)
Browse files Browse the repository at this point in the history
Signed-off-by: c-r-dev <crangavajha1@bloomberg.net>
  • Loading branch information
c-r-dev committed Jan 13, 2025
1 parent c87a5d5 commit a2cb477
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 11 deletions.
13 changes: 13 additions & 0 deletions proto/vtadmin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ service VTAdmin {
// VTExplain provides information on how Vitess plans to execute a
// particular query.
rpc VTExplain(VTExplainRequest) returns (VTExplainResponse) {};
// VExplain provides information on how Vitess plans to execute a
// particular query.
rpc VExplain(VExplainRequest) returns (VExplainResponse) {};
// WorkflowDelete deletes a vreplication workflow.
rpc WorkflowDelete(WorkflowDeleteRequest) returns (vtctldata.WorkflowDeleteResponse) {};
// WorkflowSwitchTraffic switches traffic for a VReplication workflow.
Expand Down Expand Up @@ -1097,3 +1100,13 @@ message VTExplainRequest {
message VTExplainResponse {
string response = 1;
}

message VExplainRequest {
string cluster_id = 1;
string keyspace = 2;
string sql = 3;
}

message VExplainResponse {
string response = 1;
}
4 changes: 2 additions & 2 deletions web/vtadmin/src/api/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -636,11 +636,11 @@ export const fetchVTExplain = async <R extends pb.IVTExplainRequest>({ cluster,
return pb.VTExplainResponse.create(result);
};

export const fetchVExplain = async <R extends pb.IVExplainRequest>({ clusterID, keyspace, sql }: R) => {
export const fetchVExplain = async <R extends pb.IVExplainRequest>({ cluster_id, keyspace, sql }: R) => {
// As an easy enhancement for later, we can also validate the request parameters on the front-end
// instead of defaulting to '', to save a round trip.
const req = new URLSearchParams();
req.append('cluster_id', clusterID || '');
req.append('cluster_id', cluster_id || '');
req.append('keyspace', keyspace || '');
req.append('sql', sql || '');

Expand Down
2 changes: 1 addition & 1 deletion web/vtadmin/src/components/routes/VExplain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const VExplain = () => {
: null;

const { data, error, refetch } = useVExplain(
{ clusterID: clusterID, keyspace: keyspaceName, sql },
{ cluster_id: clusterID, keyspace: keyspaceName, sql },
{
// Never cache, never refetch.
cacheTime: 0,
Expand Down
5 changes: 3 additions & 2 deletions web/vtadmin/src/proto/vtadmin.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 39 additions & 6 deletions web/vtadmin/src/proto/vtadmin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a2cb477

Please sign in to comment.