Skip to content

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

refactor: support database pagination (#15422)

ecmadao54cbf7f0ec31
diff --git a/backend/api/v1/audit_log_service.go b/backend/api/v1/audit_log_service.go
index 29568fb472..a251b3e2b4 100644
--- a/backend/api/v1/audit_log_service.go
+++ b/backend/api/v1/audit_log_service.go
@@ -12,6 +12,7 @@ import (
"github.com/google/cel-go/cel"
celast "github.com/google/cel-go/common/ast"
+ celoperators "github.com/google/cel-go/common/operators"
"github.com/pkg/errors"
"github.com/bytebase/bytebase/backend/common"
@@ -241,7 +242,7 @@ func (s *AuditLogService) getSearchAuditLogsFilter(ctx context.Context, filter s
case celast.CallKind:
functionName := expr.AsCall().FunctionName()
switch functionName {
- case "_||_":
+ case celoperators.LogicalOr:
var args []string
for _, arg := range expr.AsCall().Args() {
s, err := getFilter(arg)
@@ -252,7 +253,7 @@ func (s *AuditLogService) getSearchAuditLogsFilter(ctx context.Context, filter s
}
return strings.Join(args, " OR "), nil
- case "_&&_":
+ case celoperators.LogicalAnd:
var args []string
for _, arg := range expr.AsCall().Args() {
s, err := getFilter(arg)
@@ -263,7 +264,7 @@ func (s *AuditLogService) getSearchAuditLogsFilter(ctx context.Context, filter s
}
return strings.Join(args, " AND "), nil
- case "_==_":
+ case celoperators.Equals:
var variable, value string
for _, arg := range expr.AsCall().Args() {
switch arg.Kind() {
@@ -294,7 +295,7 @@ func (s *AuditLogService) getSearchAuditLogsFilter(ctx context.Context, filter s
positionalArgs = append(positionalArgs, value)
return fmt.Sprintf("payload->>'%s'=$%d", variable, len(positionalArgs)), nil
- case "_>=_", "_<=_":
+ case celoperators.GreaterEquals, celoperators.LessEquals:
var variable, value string
for _, arg := range expr.AsCall().Args() {
switch arg.Kind() {
@@ -317,7 +318,7 @@ func (s *AuditLogService) getSearchAuditLogsFilter(ctx context.Context, filter s
return "", errors.Errorf("failed to parse time %v, error: %v", value, err)
}
positionalArgs = append(positionalArgs, t)
- if functionName == "_>=_" {
+ if functionName == celoperators.GreaterEquals {
return fmt.Sprintf("created_at >= $%d", len(positionalArgs)), nil
}
return fmt.Sprintf("created_at <= $%d", len(positionalArgs)), nil
diff --git a/backend/api/v1/database_service.go b/backend/api/v1/database_service.go
index dd6c7a9b55..70ca0a1d52 100644
--- a/backend/api/v1/database_service.go
+++ b/backend/api/v1/database_service.go
@@ -10,6 +10,10 @@ import (
"time"
"unicode"
+ "github.com/google/cel-go/cel"
+ celast "github.com/google/cel-go/common/ast"
+ celoperators "github.com/google/cel-go/common/operators"
+ celoverloads "github.com/google/cel-go/common/overloads"
tidbparser "github.com/pingcap/tidb/pkg/parser"
tidbast "github.com/pingcap/tidb/pkg/parser/ast"
"github.com/pingcap/tidb/pkg/parser/format"
@@ -51,9 +55,6 @@ const (
orderByKeyMaximumRowsSent = "maximum_rows_sent"
orderByKeyAverageRowsExamined = "average_rows_examined"
orderByKeyMaximumRowsExamined = "maximum_rows_examined"
-
- // TODO: the frontend not support pagination yet.
- maximumListDatabasePageSize = 1000000
)
// DatabaseService implements the database service.
@@ -111,91 +112,205 @@ func (s *DatabaseService) GetDatabase(ctx context.Context, request *v1pb.GetData
return database, nil
}
-// ListInstanceDatabases lists all databases for an instance.
-func (s *DatabaseService) ListInstanceDatabases(ctx context.Context, request *v1pb.ListInstanceDatabasesRequest) (*v1pb.ListInstanceDatabasesResponse, error) {
- instanceID, err := common.GetInstanceID(request.Parent)
- if err != nil {
- return nil, status.Error(codes.InvalidArgument, err.Error())
+// TODO(ed): test it.
+func getFindDatabaseFilter(filter string) (*store.FindDatabaseFilter, error) {
+ if filter == "" {
+ return nil, nil
}
- offset, err := parseLimitAndOffset(&pageSize{
- token: request.PageToken,
- limit: int(request.PageSize),
- maximum: maximumListDatabasePageSize,
- })
+ e, err := cel.NewEnv()
if err != nil {
- return nil, err
+ return nil, status.Errorf(codes.Internal, "failed to create cel env")
}
- limitPlusOne := offset.limit + 1
-
- find := &store.FindDatabaseMessage{
- InstanceID: &instanceID,
- Limit: &limitPlusOne,
- Offset: &offset.offset,
+ ast, iss := e.Parse(filter)
+ if iss != nil {
+ return nil, status.Errorf(codes.InvalidArgument, "failed to parse filter %v, error: %v", filter, iss.String())
}
- // Deprecated. Remove this later.
- if instanceID == "-" {
- find.InstanceID = nil
- }
- if request.Filter != "" {
- projectFilter, err := getProjectFilter(request.Filter)
- if err != nil {
- return nil, status.Error(codes.InvalidArgument, err.Error())
+ var getFilter func(expr celast.Expr) (string, error)
+ var positionalArgs []any
+
+ getSubCondition := func(expr celast.Expr, join string) (string, error) {
+ var args []string
+ for _, arg := range expr.AsCall().Args() {
+ s, err := getFilter(arg)
+ if err != nil {
+ return "", err
+ }
+ args = append(args, "("+s+")")
}
- projectID, err := common.GetProjectID(projectFilter)
- if err != nil {
- return nil, status.Errorf(codes.InvalidArgument, "invalid project %q in the filter", projectFilter)
+ return strings.Join(args, fmt.Sprintf(" %s ", join)), nil
+ }
+
+ getVariavleAndValue := func(expr celast.Expr) (string, any) {
+ var variable string
+ var value any
+ for _, arg := range expr.AsCall().Args() {
+ switch arg.Kind() {
+ case celast.IdentKind:
+ variable = arg.AsIdent()
+ case celast.LiteralKind:
+ value = arg.AsLiteral().Value()
+ case celast.ListKind:
+ list := []any{}
+ for _, e := range arg.AsList().Elements() {
+ if e.Kind() == celast.LiteralKind {
+ list = append(list, e.AsLiteral().Value())
+ }
+ }
+ value = list
+ }
}
- find.ProjectID = &projectID
+ return variable, value
}
- databaseMessages, err := s.store.ListDatabases(ctx, find)
- if err != nil {
- return nil, status.Error(codes.Internal, err.Error())
+ parseToSQL := func(variable, value any) (string, error) {
+ switch variable {
+ case "project":
+ projectID, err := common.GetProjectID(value.(string))
+ if err != nil {
+ return "", status.Errorf(codes.InvalidArgument, "invalid project filter %q", value)
+ }
+ positionalArgs = append(positionalArgs, projectID)
+ return fmt.Sprintf("db.project = $%d", len(positionalArgs)), nil
+ case "instance":
+ instanceID, err := common.GetInstanceID(value.(string))
+ if err != nil {
+ return "", status.Errorf(codes.InvalidArgument, "invalid instance filter %q", value)
+ }
+ positionalArgs = append(positionalArgs, instanceID)
+ return fmt.Sprintf("db.instance = $%d", len(positionalArgs)), nil
+ case "environment":
+ environmentID, err := common.GetEnvironmentID(value.(string))
+ if err != nil {
+ return "", status.Errorf(codes.InvalidArgument, "invalid environment filter %q", value)
+ }
+ positionalArgs = append(positionalArgs, environmentID)
+ return fmt.Sprintf(`
+ COALESCE(
+ db.environment,
+ instance.environment
+ ) = $%d`, len(positionalArgs)), nil
+ case "engine":
+ v1Engine, ok := v1pb.Engine_value[value.(string)]
+ if !ok {
+ return "", status.Errorf(codes.InvalidArgument, "invalid engine filter %q", value)
+ }
+ engine := convertEngine(v1pb.Engine(v1Engine))
+ positionalArgs = append(positionalArgs, engine)
+ return fmt.Sprintf("instance.engine = $%d", len(positionalArgs)), nil
+ case "name":
+ positionalArgs = append(positionalArgs, value)
+ return fmt.Sprintf("db.name = $%d", len(positionalArgs)), nil
+ case "label":
+ keyVal := strings.Split(value.(string), ":")
+ if len(keyVal) != 2 {
+ return "", status.Errorf(codes.InvalidArgument, `invalid label filter %q, should in "{label key}:{label value} format"`, value)
+ }
+ labelKey := keyVal[0]
+ labelValues := strings.Split(keyVal[1], ",")
+ positionalArgs = append(positionalArgs, labelValues)
+ return fmt.Sprintf("db.metadata->'labels'->>'%s' = ANY($%d)", labelKey, len(positionalArgs)), nil
+ case "exclude_unassigned":
+ if _, ok := value.(bool); ok {
+ positionalArgs = append(positionalArgs, api.DefaultProjectID)
+ return fmt.Sprintf("db.project != $%d", len(positionalArgs)), nil
+ }
+ return "TRUE", nil
+ default:
+ return "", status.Errorf(codes.InvalidArgument, "unsupport variable %q", variable)
+ }
}
- nextPageToken := ""
- if len(databaseMessages) == limitPlusOne {
- databaseMessages = databaseMessages[:offset.limit]
- if nextPageToken, err = offset.getNextPageToken(); err != nil {
- return nil, status.Errorf(codes.Internal, "failed to marshal next page token, error: %v", err)
+ parseToEngineSQL := func(expr celast.Expr, relation string) (string, error) {
+ variable, value := getVariavleAndValue(expr)
+ if variable != "engine" {
+ return "", status.Errorf(codes.InvalidArgument, `only "engine" support "engine in [xx]"/"!(engine in [xx])" operator`)
}
- }
- response := &v1pb.ListInstanceDatabasesResponse{
- NextPageToken: nextPageToken,
- }
- for _, databaseMessage := range databaseMessages {
- database, err := s.convertToDatabase(ctx, databaseMessage)
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to convert database, error: %v", err)
+ rawEngineList, ok := value.([]any)
+ if !ok {
+ return "", status.Errorf(codes.InvalidArgument, "invalid engine value %q", value)
+ }
+ engineList := []string{}
+ for _, rawEngine := range rawEngineList {
+ v1Engine, ok := v1pb.Engine_value[rawEngine.(string)]
+ if !ok {
+ return "", status.Errorf(codes.InvalidArgument, "invalid engine filter %q", rawEngine)
+ }
+ engine := convertEngine(v1pb.Engine(v1Engine))
+ positionalArgs = append(positionalArgs, engine)
+ engineList = append(engineList, fmt.Sprintf("$%d", len(positionalArgs)))
+ }
+
+ return fmt.Sprintf("instance.engine %s (%s)", relation, strings.Join(engineList, ",")), nil
+ }
+
+ getFilter = func(expr celast.Expr) (string, error) {
+ switch expr.Kind() {
+ case celast.CallKind:
+ functionName := expr.AsCall().FunctionName()
+ switch functionName {
+ case celoperators.LogicalOr:
+ return getSubCondition(expr, "OR")
+ case celoperators.LogicalAnd:
+ return getSubCondition(expr, "AND")
+ case celoperators.Equals:
+ variable, value := getVariavleAndValue(expr)
+ return parseToSQL(variable, value)
+ case celoverloads.Matches:
+ variable := expr.AsCall().Target().AsIdent()
+ args := expr.AsCall().Args()
+ if len(args) != 1 {
+ return "", status.Errorf(codes.InvalidArgument, `invalid args for %q`, variable)
+ }
+ value := args[0].AsLiteral().Value()
+ if variable != "name" {
+ return "", status.Errorf(codes.InvalidArgument, `only "name" support %q operator, but found %q`, celoverloads.Matches, variable)
+ }
+ strValue, ok := value.(string)
+ if !ok {
+ return "", status.Errorf(codes.InvalidArgument, "expect string, got %T, hint: filter literals should be string", value)
+ }
+ return "LOWER(db.name) LIKE '%" + strings.ToLower(strValue) + "%'", nil
+ case celoperators.In:
+ return parseToEngineSQL(expr, "IN")
+ case celoperators.LogicalNot:
+ args := expr.AsCall().Args()
+ if len(args) != 1 {
+ return "", status.Errorf(codes.InvalidArgument, `only support !(engine in ["{engine1}", "{engine2}"]) format`)
+ }
+ return parseToEngineSQL(args[0], "NOT IN")
+ default:
+ return "", status.Errorf(codes.InvalidArgument, "unexpected function %v", functionName)
+ }
+ default:
+ return "", status.Errorf(codes.InvalidArgument, "unexpected expr kind %v", expr.Kind())
}
- response.Databases = append(response.Databases, database)
}
- return response, nil
+
+ where, err := getFilter(ast.NativeRep().Expr())
+ if err != nil {
+ return nil, err
+ }
+
+ return &store.FindDatabaseFilter{
+ Args: positionalArgs,
+ Where: "(" + where + ")",
+ }, nil
}
// ListDatabases lists all databases.
func (s *DatabaseService) ListDatabases(ctx context.Context, request *v1pb.ListDatabasesRequest) (*v1pb.ListDatabasesResponse, error) {
- var projectID *string
- switch {
- case strings.HasPrefix(request.Parent, common.ProjectNamePrefix):
- p, err := common.GetProjectID(request.Parent)
- if err != nil {
- return nil, status.Errorf(codes.InvalidArgument, "invalid project parent %q", request.Parent)
- }
- projectID = &p
- case strings.HasPrefix(request.Parent, common.WorkspacePrefix):
- // List all databases in a workspace.
- default:
- return nil, status.Errorf(codes.InvalidArgument, "invalid parent %q", request.Parent)
+ user, ok := ctx.Value(common.UserContextKey).(*store.UserMessage)
+ if !ok {
+ return nil, status.Errorf(codes.Internal, "user not found")
}
offset, err := parseLimitAndOffset(&pageSize{
token: request.PageToken,
limit: int(request.PageSize),
- maximum: maximumListDatabasePageSize,
+ maximum: 1000,
})
if err != nil {
return nil, err
@@ -203,9 +318,56 @@ func (s *DatabaseService) ListDatabases(ctx context.Context, request *v1pb.ListD
limitPlusOne := offset.limit + 1
find := &store.FindDatabaseMessage{
- ProjectID: projectID,
- Limit: &limitPlusOne,
- Offset: &offset.offset,
+ Limit: &limitPlusOne,
+ Offset: &offset.offset,
+ ShowDeleted: request.ShowDeleted,
+ }
+
+ filter, err := getFindDatabaseFilter(request.Filter)
+ if err != nil {
+ return nil, err
+ }
+ find.Filter = filter
+
+ switch {
+ case strings.HasPrefix(request.Parent, common.ProjectNamePrefix):
+ ok, err := s.iamManager.CheckPermission(ctx, iam.PermissionProjectsGet, user)
+ if err != nil {
+ return nil, err
+ }
+ if !ok {
+ return nil, status.Errorf(codes.PermissionDenied, "user does not have permission %q", iam.PermissionProjectsGet)
+ }
+
+ p, err := common.GetProjectID(request.Parent)
+ if err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, "invalid parent %q", request.Parent)
+ }
+ find.ProjectID = &p
+ case strings.HasPrefix(request.Parent, common.WorkspacePrefix):
+ ok, err := s.iamManager.CheckPermission(ctx, iam.PermissionDatabasesList, user)
+ if err != nil {
+ return nil, err
+ }
+ if !ok {
+ return nil, status.Errorf(codes.PermissionDenied, "user does not have permission %q", iam.PermissionDatabasesList)
+ }
+ case strings.HasPrefix(request.Parent, common.InstanceNamePrefix):
+ ok, err := s.iamManager.CheckPermission(ctx, iam.PermissionInstancesGet, user)
+ if err != nil {
+ return nil, err
+ }
+ if !ok {
+ return nil, status.Errorf(codes.PermissionDenied, "user does not have permission %q", iam.PermissionInstancesGet)
+ }
+
+ instanceID, err := common.GetInstanceID(request.Parent)
+ if err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, "invalid parent %q", request.Parent)
+ }
+ find.InstanceID = &instanceID
+ default:
+ return nil, status.Errorf(codes.InvalidArgument, "invalid parent %q", request.Parent)
}
databaseMessages, err := s.store.ListDatabases(ctx, find)
diff --git a/backend/store/database.go b/backend/store/database.go
index f1dab5d50a..67be4c8ac4 100644
--- a/backend/store/database.go
+++ b/backend/store/database.go
@@ -44,6 +44,11 @@ type UpdateDatabaseMessage struct {
Metadata *storepb.DatabaseMetadata
}
+type FindDatabaseFilter struct {
+ Args []any
+ Where string
+}
+
// FindDatabaseMessage is the message for finding databases.
type FindDatabaseMessage struct {
ProjectID *string
@@ -58,6 +63,7 @@ type FindDatabaseMessage struct {
// IsCaseSensitive is used to ignore case sensitive when finding database.
IsCaseSensitive bool
+ Filter *FindDatabaseFilter
Limit *int
Offset *int
}
@@ -317,6 +323,10 @@ func (s *Store) BatchUpdateDatabaseProject(ctx context.Context, databases []*Dat
func (*Store) listDatabaseImplV2(ctx context.Context, tx *Tx, find *FindDatabaseMessage) ([]*DatabaseMessage, error) {
where, args := []string{"TRUE"}, []any{}
+ if filter := find.Filter; filter != nil {
+ where = append(where, filter.Where)
+ args = append(args, filter.Args...)
+ }
if v := find.ProjectID; v != nil {
where, args = append(where, fmt.Sprintf("db.project = $%d", len(args)+1)), append(args, *v)
}
diff --git a/frontend/src/components/AdvancedSearch/AdvancedSearch.vue b/frontend/src/components/AdvancedSearch/AdvancedSearch.vue
index 98abf10737..66fed83169 100644
--- a/frontend/src/components/AdvancedSearch/AdvancedSearch.vue
+++ b/frontend/src/components/AdvancedSearch/AdvancedSearch.vue
@@ -67,6 +67,7 @@
@hover-item="menuIndex = $event"
/>
<ValueMenu
+ v-if="visibleValueOptions.length > 0"
:show="state.menuView === 'value'"
:params="params"
:scope-option="currentScopeOption"
@@ -194,7 +195,7 @@ const availableScopeOptions = computed((): ScopeOption[] => {
);
return props.scopeOptions.filter((scope) => {
- if (existedScopes.has(scope.id)) {
+ if (existedScopes.has(scope.id) && !scope.allowMultiple) {
return false;
}
return true;
@@ -288,9 +289,12 @@ const moveMenuIndex = (delta: -1 | 1) => {
};
const removeScope = (id: SearchScopeId) => {
- const updated = upsertScope(props.params, {
- id,
- value: "",
+ const updated = upsertScope({
+ params: props.params,
+ scopes: {
+ id,
+ value: "",
+ },
});
emit("update:params", updated);
};
@@ -310,15 +314,33 @@ const selectScope = (
state.menuView = "scope";
}
};
-const selectValue = (value: string) => {
+
+const extractValue = () => {
const id = state.currentScope;
if (!id) {
+ return;
+ }
+ const text = inputText.value;
+ if (!text.startsWith(`${id}:`)) {
+ return;
+ }
+ return text.slice(`${id}:`.length);
+};
+
+const selectValue = (value: string) => {
+ const id = state.currentScope;
+ if (!id || !currentScopeOption.value) {
state.menuView = undefined;
return;
}
- const updated = upsertScope(props.params, {
- id,
- value,
+ const { allowMultiple } = currentScopeOption.value;
+ const updated = upsertScope({
+ params: props.params,
+ scopes: {
+ id,
+ value,
+ },
+ allowMultiple,
});
updated.query = "";
inputText.value = "";
@@ -459,9 +481,14 @@ const handleKeyUp = (e: KeyboardEvent) => {
}
}
if (state.menuView === "value") {
- const option = visibleValueOptions.value[index];
- if (option) {
- selectValue(option.value);
+ if (visibleValueOptions.value.length === 0) {
+ const val = extractValue();
+ if (val) {
+ selectValue(val);
+ return;
+ }
+ } else if (visibleValueOptions.value[index]) {
+ selectValue(visibleValueOptions.value[index].value);
return;
}
}
diff --git a/frontend/src/components/AdvancedSearch/TimeRange.vue b/frontend/src/components/AdvancedSearch/TimeRange.vue
index 0923c82cdc..342da1e6cd 100644
--- a/frontend/src/components/AdvancedSearch/TimeRange.vue
+++ b/frontend/src/components/AdvancedSearch/TimeRange.vue
@@ -41,9 +41,12 @@ const isDateDisabled = (ts: number) => {
const handleUpdate = (values: [number, number] | null) => {
const from = values ? dayjs(values[0]).startOf("day") : null;
const to = values ? dayjs(values[1]).endOf("day") : null;
- const updated = upsertScope(props.params, {
- id: "created",
- value: from && to ? `${from.valueOf()},${to.valueOf()}` : "",
+ const updated = upsertScope({
+ params: props.params,
+ scopes: {
+ id: "created",
+ value: from && to ? `${from.valueOf()},${to.valueOf()}` : "",
+ },
});
emit("update:params", updated);
};
diff --git a/frontend/src/components/AdvancedSearch/types.ts b/frontend/src/components/AdvancedSearch/types.ts
index 15fe89ee2c..c994311c91 100644
--- a/frontend/src/components/AdvancedSearch/types.ts
+++ b/frontend/src/components/AdvancedSearch/types.ts
@@ -6,6 +6,7 @@ export type ScopeOption = {
title: string;
options: ValueOption[];
description?: string;
+ allowMultiple?: boolean;
};
export type ValueOption = {
diff --git a/frontend/src/components/AdvancedSearch/useCommonSearchScopeOptions.ts b/frontend/src/components/AdvancedSearch/useCommonSearchScopeOptions.ts
index 79ad370f53..55bf000d0d 100644
--- a/frontend/src/components/AdvancedSearch/useCommonSearchScopeOptions.ts
+++ b/frontend/src/components/AdvancedSearch/useCommonSearchScopeOptions.ts
@@ -15,8 +15,7 @@ import {
useInstanceResourceList,
useProjectV1Store,
} from "@/store";
-import { useDatabaseV1List } from "@/store/modules/v1/databaseList";
-import { UNKNOWN_ID, type MaybeRef } from "@/types";
+import { UNKNOWN_ID, isValidProjectName, type MaybeRef } from "@/types";
import { engineToJSON } from "@/types/proto/v1/common";
import type { SearchParams, SearchScopeId } from "@/utils";
import {
@@ -51,10 +50,12 @@ export const useCommonSearchScopeOptions = (
return undefined;
});
- const databaseList = computed(() =>
- // Only use the database list from the store if the project is set.
- project.value ? useDatabaseV1List(project.value).databaseList.value : []
- );
+ const databaseList = computed(() => {
+ if (!isValidProjectName(project.value)) {
+ return [];
+ }
+ return databaseV1Store.databaseListByProject(project.value!);
+ });
const instanceList = computed(() => useInstanceResourceList().value);
@@ -158,6 +159,13 @@ export const useCommonSearchScopeOptions = (
};
}),
}),
+ label: () => ({
+ id: "label",
+ title: "Label",
+ description: "Input the {label key}:{label value} then press Enter.",
+ options: [] as ValueOption[],
+ allowMultiple: true,
+ }),
} as Record<SearchScopeId, () => ScopeOption>;
const scopes: ScopeOption[] = [];
diff --git a/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vue b/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vue
index b011cbdc07..1a0fa286b1 100644
--- a/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vue
+++ b/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vue
@@ -15,7 +15,7 @@
<div
class="space-y-4 h-full w-[calc(100vw-8rem)] lg:w-[60rem] max-w-[calc(100vw-8rem)] overflow-x-auto"
>
- <div v-if="ready">
+ <div>
<div class="space-y-3">
<div class="w-full flex items-center space-x-2">
<AdvancedSearch
@@ -23,33 +23,20 @@
:autofocus="false"
:placeholder="$t('database.filter-database')"
:scope-options="scopeOptions"
- />
- <DatabaseLabelFilter
- v-model:selected="state.selectedLabels"
- :database-list="rawDatabaseList"
- :placement="'left-start'"
+ :readonly-scopes="readonlyScopes"
/>
</div>
- <DatabaseV1Table
+
+ <PagedDatabaseTable
mode="ALL_SHORT"
+ :filter="filter"
+ :parent="projectName"
+ :custom-click="true"
:show-sql-editor-button="false"
- :database-list="selectableDatabaseList"
- :keyword="state.params.query.trim().toLowerCase()"
@update:selected-databases="handleDatabasesSelectionChanged"
/>
- <SchemalessDatabaseTable
- v-if="isEditSchema"
- mode="ALL"
- :database-list="schemalessDatabaseList"
- />
</div>
</div>
- <div
- v-if="!ready"
- class="w-full h-[20rem] flex items-center justify-center"
- >
- <BBSpin />
- </div>
</div>
<template #footer>
@@ -119,42 +106,34 @@
<script lang="ts" setup>
import { uniqBy } from "lodash-es";
import { NButton, NCheckbox, NTooltip } from "naive-ui";
-import type { PropType } from "vue";
import { computed, reactive, ref } from "vue";
import { useRouter } from "vue-router";
-import { BBSpin } from "@/bbkit";
import { FeatureModal } from "@/components/FeatureGuard";
-import DatabaseV1Table from "@/components/v2/Model/DatabaseV1Table";
+import { PagedDatabaseTable } from "@/components/v2/Model/DatabaseV1Table";
import {
PROJECT_V1_ROUTE_ISSUE_DETAIL,
PROJECT_V1_ROUTE_PLAN_DETAIL,
} from "@/router/dashboard/projectV1";
-import { useDatabaseV1Store, useProjectByName, useAppFeature } from "@/store";
-import { useDatabaseV1List } from "@/store/modules/v1/databaseList";
-import type { ComposedDatabase, FeatureType } from "@/types";
-import { UNKNOWN_ID, DEFAULT_PROJECT_NAME } from "@/types";
-import { State } from "@/types/proto/v1/common";
-import type { SearchParams } from "@/utils";
+import { useDatabaseV1Store, useAppFeature } from "@/store";
+import {
+ instanceNamePrefix,
+ environmentNamePrefix,
+} from "@/store/modules/v1/common";
+import type { FeatureType } from "@/types";
+import { Engine } from "@/types/proto/v1/common";
+import type { SearchParams, SearchScope } from "@/utils";
import {
allowUsingSchemaEditor,
- instanceV1HasAlterSchema,
- filterDatabaseV1ByKeyword,
- sortDatabaseV1List,
generateIssueTitle,
- extractEnvironmentResourceName,
- extractInstanceResourceName,
extractProjectResourceName,
} from "@/utils";
import AdvancedSearch from "../AdvancedSearch";
import { useCommonSearchScopeOptions } from "../AdvancedSearch/useCommonSearchScopeOptions";
-import { DatabaseLabelFilter, DrawerContent } from "../v2";
+import { DrawerContent } from "../v2";
import SchemaEditorModal from "./SchemaEditorModal.vue";
-import SchemalessDatabaseTable from "./SchemalessDatabaseTable.vue";
type LocalState = {
- label: string;
showSchemaLessDatabaseList: boolean;
- selectedLabels: { key: string; value: string }[];
selectedDatabaseNames: Set<string>;
showSchemaEditorModal: boolean;
params: SearchParams;
@@ -162,22 +141,16 @@ type LocalState = {
planOnly: boolean;
};
-const props = defineProps({
- projectName: {
- type: String,
- required: true,
- },
- type: {
- type: String as PropType<
- "bb.issue.database.schema.update" | "bb.issue.database.data.update"
- >,
- required: true,
- },
- planOnly: {
- type: Boolean,
- default: false,
- },
-});
+const props = withDefaults(
+ defineProps<{
+ projectName: string;
+ type: "bb.issue.database.schema.update" | "bb.issue.database.data.update";
+ planOnly?: boolean;
+ }>(),
+ {
+ planOnly: false,
+ }
+);
const emit = defineEmits(["dismiss"]);
@@ -197,109 +170,63 @@ const schemaEditorContext = ref<{
databaseNameList: [],
});
+const readonlyScopes = computed((): SearchScope[] => [
+ { id: "project", value: extractProjectResourceName(props.projectName) },
+]);
+
const state = reactive<LocalState>({
selectedDatabaseNames: new Set<string>(),
- label: "environment",
showSchemaLessDatabaseList: false,
showSchemaEditorModal: false,
- selectedLabels: [],
params: {
query: "",
- scopes: [],
+ scopes: [...readonlyScopes.value],
},
planOnly: props.planOnly,
});
const scopeOptions = useCommonSearchScopeOptions(
computed(() => state.params),
- computed(() => ["project", "instance", "environment"])
+ computed(() => ["project", "instance", "environment", "label"])
);
-const { project: selectedProject } = useProjectByName(props.projectName);
-
const selectedInstance = computed(() => {
- return (
- state.params.scopes.find((scope) => scope.id === "instance")?.value ??
- `${UNKNOWN_ID}`
- );
+ const instanceId = state.params.scopes.find(
+ (scope) => scope.id === "instance"
+ )?.value;
+ if (!instanceId) {
+ return;
+ }
+ return `${instanceNamePrefix}${instanceId}`;
});
const selectedEnvironment = computed(() => {
- return (
- state.params.scopes.find((scope) => scope.id === "environment")?.value ??
- `${UNKNOWN_ID}`
- );
-});
-
-// Returns true if alter schema, false if change data.
-const isEditSchema = computed((): boolean => {
- return props.type === "bb.issue.database.schema.update";
-});
-
-const { ready } = useDatabaseV1List(props.projectName);
-
-const rawDatabaseList = computed(() => {
- let list: ComposedDatabase[] = [];
- if (selectedProject.value) {
- list = databaseV1Store.databaseListByProject(selectedProject.value.name);
- } else {
- list = databaseV1Store.databaseListByUser;
+ const environmentId = state.params.scopes.find(
+ (scope) => scope.id === "environment"
+ )?.value;
+ if (!environmentId) {
+ return;
}
- list = list.filter(
- (db) => db.state == State.ACTIVE && db.project !== DEFAULT_PROJECT_NAME
- );
- return list;
+ return `${environmentNamePrefix}${environmentId}`;
});
-const filteredDatabaseList = computed(() => {
- const list = rawDatabaseList.value.filter((db) => {
- if (
- selectedEnvironment.value !== `${UNKNOWN_ID}` &&
- extractEnvironmentResourceName(db.effectiveEnvironment) !==
- selectedEnvironment.value
- ) {
- return false;
- }
- if (
- selectedInstance.value !== `${UNKNOWN_ID}` &&
- extractInstanceResourceName(db.instance) !== selectedInstance.value
- ) {
- return false;
- }
-
- const filterByKeyword = filterDatabaseV1ByKeyword(
- db,
- state.params.query.trim(),
- ["name", "environment", "instance", "project"]
- );
- if (!filterByKeyword) {
- return false;
- }
-
- if (state.selectedLabels.length > 0) {
- return state.selectedLabels.some((kv) => db.labels[kv.key] === kv.value);
- }
-
- return true;
- });
-
- return sortDatabaseV1List(list);
+const selectedLabels = computed(() => {
+ return state.params.scopes
+ .filter((scope) => scope.id === "label")
+ .map((scope) => scope.value);
});
-const selectableDatabaseList = computed(() => {
- if (isEditSchema.value) {
- return filteredDatabaseList.value.filter((db) =>
- instanceV1HasAlterSchema(db.instanceResource)
- );
- }
-
- return filteredDatabaseList.value;
-});
+const filter = computed(() => ({
+ instance: selectedInstance.value,
+ environment: selectedEnvironment.value,
+ query: state.params.query,
+ excludeEngines: [Engine.REDIS],
+ labels: selectedLabels.value,
+}));
-const schemalessDatabaseList = computed(() => {
- return filteredDatabaseList.value.filter(
- (db) => !instanceV1HasAlterSchema(db.instanceResource)
- );
+// Returns true if alter schema, false if change data.
+const isEditSchema = computed((): boolean => {
+ return props.type === "bb.issue.database.schema.update";
});
const flattenSelectedDatabaseNameList = computed(() => {
@@ -321,8 +248,8 @@ const allowGenerateMultiDb = computed(() => {
});
const flattenSelectedDatabaseList = computed(() =>
- flattenSelectedDatabaseNameList.value.map(
- (name) => selectableDatabaseList.value.find((db) => db.name === name)!
+ flattenSelectedDatabaseNameList.value.map((name) =>
+ databaseV1Store.getDatabaseByName(name)
)
);
diff --git a/frontend/src/components/AlterSchemaPrepForm/ProjectStandardView.vue b/frontend/src/components/AlterSchemaPrepForm/ProjectStandardView.vue
deleted file mode 100644
index 7db05d27b3..0000000000
--- a/frontend/src/components/AlterSchemaPrepForm/ProjectStandardView.vue
+++ /dev/null
@@ -1,246 +0,0 @@
-<template>
- <!-- multiple stage view -->
- <div class="flex items-center justify-between">
- <div>
- <div v-if="databaseList.length === 0" class="textinfolabel">
- {{ $t("alter-schema.no-databases-in-project") }}
- </div>
- </div>
- <div>
- <slot name="header"></slot>
- </div>
- </div>
- <slot name="sub-header"></slot>
-
- <NCollapse
- arrow-placement="left"
- :default-expanded-names="
- databaseListGroupByEnvironment.map((group) => group.environment.name)
- "
- >
- <NCollapseItem
- v-for="{
- environment,
- databaseList: databaseListInEnvironment,
- } in databaseListGroupByEnvironment"
- :key="environment.name"
- :name="environment.name"
- >
- <template #header>
- <label class="flex items-center gap-x-2" @click.stop.prevent>
- <NCheckbox
- v-bind="
- getAllSelectionStateForEnvironment(
- environment,
- databaseListInEnvironment
- )
- "
- @update:checked="
- toggleAllDatabasesSelectionForEnvironment(
- environment,
- databaseListInEnvironment,
- $event
- )
- "
- />
- <EnvironmentV1Name :environment="environment" :link="false" />
- </label>
- </template>
-
- <template #header-extra>
- <div class="flex items-center text-xs text-gray-500 mr-2">
- {{
- $t(
- "database.n-selected-m-in-total",
- getSelectionStateSummaryForEnvironment(
- environment,
- databaseListInEnvironment
- )
- )
- }}
- </div>
- </template>
-
- <div class="relative bg-white rounded-md -space-y-px px-2">
- <template
- v-for="(database, dbIndex) in databaseListInEnvironment"
- :key="dbIndex"
- >
- <label
- class="border-control-border relative border p-3 flex flex-col gap-y-2 md:flex-row md:pl-4 md:pr-6"
- :class="
- database.state === State.ACTIVE
- ? 'cursor-pointer'
- : 'cursor-not-allowed'
- "
- >
- <div class="radio text-sm flex justify-start md:flex-1">
- <NCheckbox
- :checked="
- isDatabaseSelectedForEnvironment(
- database.name,
- environment.name
- )
- "
- @update:checked="
- (checked) =>
- toggleDatabaseNameForEnvironment(
- database.name,
- environment.name,
- checked
- )
- "
- />
- <span
- class="font-medium ml-2 text-main"
- :class="database.state !== State.ACTIVE && 'opacity-40'"
- >{{ database.databaseName }}</span
- >
- </div>
- <div
- class="flex items-center gap-x-2 ml-6 pl-0 md:ml-0 md:pl-0 md:justify-end"
- >
- <InstanceV1Name
- :instance="database.instanceResource"
- :link="false"
- />
- <span class="textinfolabel">
- {{ hostPortOfInstanceV1(database.instanceResource) }}
- </span>
- </div>
- </label>
- </template>
- </div>
- </NCollapseItem>
- </NCollapse>
-</template>
-
-<script lang="ts" setup>
-import { NCollapse, NCollapseItem, NCheckbox } from "naive-ui";
-import { reactive, computed, watch } from "vue";
-import { EnvironmentV1Name, InstanceV1Name } from "@/components/v2";
-import type { ComposedDatabase } from "@/types";
-import { State } from "@/types/proto/v1/common";
-import type { Environment } from "@/types/proto/v1/environment_service";
-import type { Project } from "@/types/proto/v1/project_service";
-import { hostPortOfInstanceV1 } from "@/utils";
-
-interface LocalState {
- selectedDatabaseNameListForEnvironment: Map<string, string[]>;
-}
-
-const props = defineProps<{
- project?: Project;
- databaseList: ComposedDatabase[];
- environmentList: Environment[];
-}>();
-
-const emit = defineEmits<{
- (event: "select-databases", ...dbList: string[]): void;
-}>();
-
-const state = reactive<LocalState>({
- selectedDatabaseNameListForEnvironment: new Map<string, string[]>(),
-});
-
-watch(
- () => state.selectedDatabaseNameListForEnvironment,
- (selectedDatabaseNameListForEnvironment) => {
- const flattenDatabaseNameList: string[] = [];
- for (const databaseNameList of selectedDatabaseNameListForEnvironment.values()) {
- flattenDatabaseNameList.push(...databaseNameList);
- }
- emit("select-databases", ...flattenDatabaseNameList);
- },
- { deep: true }
-);
-
-const databaseListGroupByEnvironment = computed(() => {
- const listByEnv = props.environmentList.map((environment) => {
- const databaseList = props.databaseList.filter(
- (db) => db.effectiveEnvironment === environment.name
- );
- return {
- environment,
- databaseList,
- };
- });
-
- return listByEnv.filter((group) => group.databaseList.length > 0);
-});
-
-const toggleDatabaseNameForEnvironment = (
- databaseName: string,
- environmentName: string,
- selected: boolean
-) => {
- const map = state.selectedDatabaseNameListForEnvironment;
- const list = map.get(environmentName) || [];
- const index = list.indexOf(databaseName);
- if (selected) {
- // push the databaseId in if needed
- if (index < 0) {
- list.push(databaseName);
- }
- } else {
- // remove the databaseId if exists
- if (index >= 0) {
- list.splice(index, 1);
- }
- }
- // Set or remove the list to the map
- if (list.length > 0) {
- map.set(environmentName, list);
- } else {
- map.delete(environmentName);
- }
-};
-
-const isDatabaseSelectedForEnvironment = (
- databaseName: string,
- environmentName: string
-) => {
- const map = state.selectedDatabaseNameListForEnvironment;
- const list = map.get(environmentName) || [];
- return list.includes(databaseName);
-};
-
-const getAllSelectionStateForEnvironment = (
- environment: Environment,
- databaseList: ComposedDatabase[]
-): { checked: boolean; indeterminate: boolean } => {
- const set = new Set(
- state.selectedDatabaseNameListForEnvironment.get(environment.name) ?? []
- );
- const checked = set.size > 0 && databaseList.every((db) => set.has(db.name));
- const indeterminate = !checked && databaseList.some((db) => set.has(db.name));
-
- return {
- checked,
- indeterminate,
- };
-};
-
-const toggleAllDatabasesSelectionForEnvironment = (
- environment: Environment,
- databaseList: ComposedDatabase[],
- on: boolean
-) => {
- databaseList.forEach((db) =>
- toggleDatabaseNameForEnvironment(db.name, environment.name, on)
- );
-};
-
-const getSelectionStateSummaryForEnvironment = (
- environment: Environment,
- databaseList: ComposedDatabase[]
-) => {
- const set = new Set(
- state.selectedDatabaseNameListForEnvironment.get(environment.name)
- );
- const selected = databaseList.filter((db) => set.has(db.name)).length;
- const total = databaseList.length;
-
- return { selected, total };
-};
-</script>
diff --git a/frontend/src/components/AlterSchemaPrepForm/SchemaEditorModal.vue b/frontend/src/components/AlterSchemaPrepForm/SchemaEditorModal.vue
index 9d3b494530..3053ed219c 100644
--- a/frontend/src/components/AlterSchemaPrepForm/SchemaEditorModal.vue
+++ b/frontend/src/components/AlterSchemaPrepForm/SchemaEditorModal.vue
@@ -127,7 +127,7 @@ import { cloneDeep, head, uniq } from "lodash-es";
import { NTabs, NCheckbox, NButton, NTabPane, useDialog } from "naive-ui";
import { v4 as uuidv4 } from "uuid";
import type { PropType } from "vue";
-import { computed, onMounted, h, reactive, ref, watch } from "vue";
+import { computed, onMounted, h, reactive, ref, watch, watchEffect } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import { BBModal } from "@/bbkit";
@@ -145,6 +145,7 @@ import {
useAppFeature,
useStorageStore,
useDatabaseCatalogV1Store,
+ batchGetOrFetchDatabases,
} from "@/store";
import type { ComposedDatabase } from "@/types";
import { dialectOfEngineV1, isValidProjectName, unknownProject } from "@/types";
@@ -237,11 +238,16 @@ const allowPreviewIssue = computed(() => {
}
});
+watchEffect(async () => {
+ await batchGetOrFetchDatabases(props.databaseNames);
+});
+
const databaseList = computed(() => {
return props.databaseNames.map((database) => {
return databaseV1Store.getDatabaseByName(database);
});
});
+
// Returns the type if it's uniq.
// Returns Engine.UNRECOGNIZED if there are more than ONE types.
const databaseEngine = computed((): Engine => {
@@ -342,7 +348,7 @@ const handleSyncSQLFromSchemaEditor = async () => {
for (const [database, result] of statementMap.entries()) {
if (!result.statement) {
emptyStatementDatabaseList.push(
- useDatabaseV1Store().getDatabaseByName(database)
+ databaseV1Store.getDatabaseByName(database)
);
}
}
@@ -462,7 +468,7 @@ const handlePreviewIssue = async () => {
for (const [database, result] of statementMap.entries()) {
if (!result.statement) {
emptyStatementDatabaseList.push(
- useDatabaseV1Store().getDatabaseByName(database)
+ databaseV1Store.getDatabaseByName(database)
);
}
statementList.push(result.statement);
diff --git a/frontend/src/components/AlterSchemaPrepForm/SchemalessDatabaseTable.vue b/frontend/src/components/AlterSchemaPrepForm/SchemalessDatabaseTable.vue
index 2cf8d80b6c..1050252774 100644
--- a/frontend/src/components/AlterSchemaPrepForm/SchemalessDatabaseTable.vue
+++ b/frontend/src/components/AlterSchemaPrepForm/SchemalessDatabaseTable.vue
@@ -18,7 +18,7 @@
<script setup lang="ts">
import { NCheckbox } from "naive-ui";
import { ref } from "vue";
-import DatabaseV1Table from "@/components/v2/Model/DatabaseV1Table";
+import { DatabaseV1Table } from "@/components/v2/Model/DatabaseV1Table";
import type { ComposedDatabase } from "@/types";
defineProps<{
diff --git a/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue b/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue
index 624a2897d1..5a7b6d735d 100644
--- a/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue
+++ b/frontend/src/components/AnomalyCenter/AnomalyCenterDashboard.vue
@@ -85,11 +85,13 @@ import {
useAnomalyV1Store,
useDatabaseV1Store,
useEnvironmentV1List,
+ batchGetOrFetchDatabases,
} from "@/store";
-import type { ComposedProject } from "@/types";
+import type { ComposedDatabase, ComposedProject } from "@/types";
+import { isValidDatabaseName } from "@/types";
import type { Anomaly } from "@/types/proto/v1/anomaly_service";
import { Anomaly_AnomalySeverity } from "@/types/proto/v1/anomaly_service";
-import { databaseV1Url, sortDatabaseV1List } from "@/utils";
+import { databaseV1Url } from "@/utils";
import {
FeatureAttention,
FeatureAttentionForInstanceLicense,
@@ -103,6 +105,10 @@ type Summary = {
mediumCount: number;
};
+interface LocalDataSource extends BBTableSectionDataSource<Anomaly> {
+ database: ComposedDatabase;
+}
+
const props = defineProps<{
project: ComposedProject;
}>();
@@ -117,48 +123,42 @@ onMounted(async () => {
props.project?.name,
{}
);
-});
-const databaseListByProject = computed(() => {
- return sortDatabaseV1List(
- databaseStore.databaseListByUser.filter((db) => {
- return props.project.name === db.project;
- })
+ await batchGetOrFetchDatabases(
+ allAnomalyList.value.map((anomaly) => anomaly.resource)
);
});
-const databaseAnomalySectionList = computed(
- (): BBTableSectionDataSource<Anomaly>[] => {
- const sectionList: BBTableSectionDataSource<Anomaly>[] = [];
+const databaseAnomalySectionList = computed((): LocalDataSource[] => {
+ const sectionMap: Map<string, LocalDataSource> = new Map();
- for (const database of databaseListByProject.value) {
- const anomalyListOfDatabase = allAnomalyList.value.filter(
- (anomaly) => anomaly.resource === database.name
- );
-
- if (anomalyListOfDatabase.length > 0) {
- sectionList.push({
+ for (const anomaly of allAnomalyList.value) {
+ const database = databaseStore.getDatabaseByName(anomaly.resource);
+ if (isValidDatabaseName(database.name)) {
+ if (!sectionMap.has(database.name)) {
+ sectionMap.set(database.name, {
+ database,
title: `${database.databaseName} (${database.effectiveEnvironmentEntity.title})`,
link: databaseV1Url(database),
- list: anomalyListOfDatabase,
+ list: [],
});
}
+ sectionMap.get(database.name)!.list.push(anomaly);
}
-
- return sectionList;
}
-);
+
+ return [...sectionMap.values()];
+});
const databaseAnomalySummaryList = computed((): Summary[] => {
const envMap: Map<string, Summary> = new Map();
- for (const database of databaseListByProject.value) {
+ for (const item of databaseAnomalySectionList.value) {
+ const { database, list } = item;
let criticalCount = 0;
let highCount = 0;
let mediumCount = 0;
- const anomalyListOfDatabase = allAnomalyList.value.filter(
- (anomaly) => anomaly.resource === database.name
- );
- for (const anomaly of anomalyListOfDatabase) {
+
+ for (const anomaly of list) {
switch (anomaly.severity) {
case Anomaly_AnomalySeverity.CRITICAL:
criticalCount++;
diff --git a/frontend/src/components/AnomalyCenter/DatabaseSchemaDriftAnomalyModal.vue b/frontend/src/components/AnomalyCenter/DatabaseSchemaDriftAnomalyModal.vue
index 5406432bf8..bc23ec122c 100644
--- a/frontend/src/components/AnomalyCenter/DatabaseSchemaDriftAnomalyModal.vue
+++ b/frontend/src/components/AnomalyCenter/DatabaseSchemaDriftAnomalyModal.vue
@@ -23,9 +23,11 @@
</template>
<script lang="ts" setup>
-import { computed, onMounted, ref } from "vue";
+import { computedAsync } from "@vueuse/core";
+import { onMounted, ref } from "vue";
import { BBModal, BBSpin } from "@/bbkit";
import { useChangelogStore, useDatabaseV1Store } from "@/store";
+import { unknownDatabase } from "@/types";
import { Anomaly } from "@/types/proto/v1/anomaly_service";
import { ChangelogView } from "@/types/proto/v1/database_service";
import { DiffEditor } from "../MonacoEditor";
@@ -42,9 +44,9 @@ const isLoading = ref(true);
const originalSchema = ref<string>("");
const modifiedSchema = ref<string>("");
-const database = computed(() => {
- return databaseStore.getDatabaseByName(props.anomaly.resource);
-});
+const database = computedAsync(() => {
+ return databaseStore.getOrFetchDatabaseByName(props.anomaly.resource);
+}, unknownDatabase());
onMounted(async () => {
const database = await databaseStore.getOrFetchDatabaseByName(
diff --git a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogChangeItem.vue b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogChangeItem.vue
index 57bc0dee55..3827333836 100644
--- a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogChangeItem.vue
+++ b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogChangeItem.vue
@@ -49,10 +49,12 @@
</template>
<script setup lang="ts">
+import { computedAsync } from "@vueuse/core";
import { NButton, NTag } from "naive-ui";
import { computed } from "vue";
import { RichDatabaseName } from "@/components/v2";
import { useChangelogStore, useDatabaseV1Store } from "@/store";
+import { unknownDatabase } from "@/types";
import type { Changelist_Change as Change } from "@/types/proto/v1/changelist_service";
import { Changelog } from "@/types/proto/v1/database_service";
import { extractDatabaseResourceName, extractIssueUID } from "@/utils";
@@ -78,8 +80,8 @@ const changelog = computed(() => {
);
});
-const database = computed(() => {
+const database = computedAsync(() => {
const { database } = extractDatabaseResourceName(changelog.value.name);
- return useDatabaseV1Store().getDatabaseByName(database);
-});
+ return useDatabaseV1Store().getOrFetchDatabaseByName(database);
+}, unknownDatabase());
</script>
diff --git a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogForm.vue b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogForm.vue
index fdf1a7747a..0f31b51984 100644
--- a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogForm.vue
+++ b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogForm.vue
@@ -45,7 +45,7 @@
</template>
<script setup lang="ts">
-import { first, orderBy } from "lodash-es";
+import { orderBy } from "lodash-es";
import { NCheckbox, NCheckboxGroup } from "naive-ui";
import { computed, reactive, watch } from "vue";
import { ChangelogDataTable } from "@/components/Changelog";
@@ -85,6 +85,7 @@ type LocalState = {
};
const changelogStore = useChangelogStore();
+const databaseStore = useDatabaseV1Store();
const { project } = useChangelistDetailContext();
const { changesFromChangelog: changes } = useAddChangeContext();
@@ -100,7 +101,7 @@ const state = reactive<LocalState>({
const database = computed(() => {
const name = state.databaseName;
if (!isValidDatabaseName(name)) return undefined;
- return useDatabaseV1Store().getDatabaseByName(name);
+ return databaseStore.getDatabaseByName(name);
});
const filteredChangelogList = computed(() => {
@@ -174,23 +175,13 @@ const handleRemoveChange = (change: Change) => {
const handleClickChange = (change: Change) => {
const changelogName = change.source;
- const database = useDatabaseV1Store().getDatabaseByName(
+ const database = databaseStore.getDatabaseByName(
extractDatabaseResourceName(changelogName).database
);
state.databaseName = database.name;
state.detailChangelogName = changelogName;
};
-// Select the first database automatically
-watch(
- () => project.value.name,
- (project) => {
- const databaseList = useDatabaseV1Store().databaseListByProject(project);
- state.databaseName = first(databaseList)?.name;
- },
- { immediate: true }
-);
-
watch(() => database.value?.name, fetchChangelogList, { immediate: true });
watch(
diff --git a/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/DatabaseForChange.vue b/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/DatabaseForChange.vue
index 96d45d367b..cf217ae9f0 100644
--- a/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/DatabaseForChange.vue
+++ b/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/DatabaseForChange.vue
@@ -25,7 +25,7 @@ const database = asyncComputed(async () => {
const { source } = change;
if (isChangelogChangeSource(change)) {
const { database } = extractDatabaseResourceName(source);
- return useDatabaseV1Store().getDatabaseByName(database);
+ return useDatabaseV1Store().getOrFetchDatabaseByName(database);
} else {
// Raw SQL
return undefined;
diff --git a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskForm.vue b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskForm.vue
index e0af66783a..44adecdd3d 100644
--- a/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskForm.vue
+++ b/frontend/src/components/CustomApproval/Settings/components/RiskCenter/RiskDialog/RiskForm.vue
@@ -182,7 +182,6 @@ const sourceList = computed(() => {
const resolveLocalState = async () => {
const risk = cloneDeep(context.dialog.value!.risk);
-
let expr: SimpleExpr = emptySimpleExpr();
if (risk.condition?.expression) {
const parsedExprs = await batchConvertCELStringToParsedExpr([
diff --git a/frontend/src/components/DataExportPrepForm/DataExportPrepForm.vue b/frontend/src/components/DataExportPrepForm/DataExportPrepForm.vue
index 8d8bd01453..850958168e 100644
--- a/frontend/src/components/DataExportPrepForm/DataExportPrepForm.vue
+++ b/frontend/src/components/DataExportPrepForm/DataExportPrepForm.vue
@@ -17,18 +17,16 @@
v-model:params="state.params"
:placeholder="$t('database.filter-database')"
:scope-options="scopeOptions"
- />
- <DatabaseLabelFilter
- v-model:selected="state.selectedLabels"
- :database-list="rawDatabaseList"
- :placement="'left-start'"
+ :readonly-scopes="readonlyScopes"
/>
</div>
- <DatabaseV1Table
+
+ <PagedDatabaseTable
mode="ALL_SHORT"
- :database-list="filteredDatabaseList"
:single-selection="true"
- :keyword="state.params.query.trim().toLowerCase()"
+ :custom-click="true"
+ :filter="filter"
+ :parent="projectName"
@update:selected-databases="handleDatabasesSelectionChanged"
/>
</div>
@@ -60,118 +58,83 @@ import { NButton } from "naive-ui";
import { computed, reactive } from "vue";
import { useRouter } from "vue-router";
import AdvancedSearch from "@/components/AdvancedSearch";
-import DatabaseV1Table from "@/components/v2/Model/DatabaseV1Table";
+import { PagedDatabaseTable } from "@/components/v2/Model/DatabaseV1Table";
import { PROJECT_V1_ROUTE_ISSUE_DETAIL } from "@/router/dashboard/projectV1";
import { useDatabaseV1Store, useProjectByName } from "@/store";
-import type { ComposedDatabase } from "@/types";
-import { UNKNOWN_ID, DEFAULT_PROJECT_NAME } from "@/types";
-import { State } from "@/types/proto/v1/common";
-import type { SearchParams } from "@/utils";
import {
- filterDatabaseV1ByKeyword,
- sortDatabaseV1List,
- extractEnvironmentResourceName,
- extractInstanceResourceName,
- generateIssueTitle,
- extractProjectResourceName,
-} from "@/utils";
+ instanceNamePrefix,
+ environmentNamePrefix,
+} from "@/store/modules/v1/common";
+import { isValidDatabaseName } from "@/types";
+import type { SearchParams, SearchScope } from "@/utils";
+import { generateIssueTitle, extractProjectResourceName } from "@/utils";
import { useCommonSearchScopeOptions } from "../AdvancedSearch/useCommonSearchScopeOptions";
-import { DatabaseLabelFilter, DrawerContent } from "../v2";
+import { DrawerContent } from "../v2";
type LocalState = {
- label: string;
selectedDatabaseName?: string;
- selectedLabels: { key: string; value: string }[];
params: SearchParams;
};
-const props = defineProps({
- projectName: {
- type: String,
- required: true,
- },
-});
+const props = defineProps<{
+ projectName: string;
+}>();
+
+useProjectByName(props.projectName);
const emit = defineEmits(["dismiss"]);
const router = useRouter();
const databaseV1Store = useDatabaseV1Store();
+const readonlyScopes = computed((): SearchScope[] => [
+ { id: "project", value: extractProjectResourceName(props.projectName) },
+]);
const state = reactive<LocalState>({
- label: "environment",
- selectedLabels: [],
params: {
query: "",
- scopes: [],
+ scopes: [...readonlyScopes.value],
},
});
const scopeOptions = useCommonSearchScopeOptions(
computed(() => state.params),
- ["environment", "instance"]
+ ["environment", "instance", "label"]
);
-const { project: selectedProject } = useProjectByName(props.projectName);
-
const selectedInstance = computed(() => {
- return (
- state.params.scopes.find((scope) => scope.id === "instance")?.value ??
- `${UNKNOWN_ID}`
- );
+ const instanceId = state.params.scopes.find(
+ (scope) => scope.id === "instance"
+ )?.value;
+ if (!instanceId) {
+ return;
+ }
+ return `${instanceNamePrefix}${instanceId}`;
});
const selectedEnvironment = computed(() => {
- return (
- state.params.scopes.find((scope) => scope.id === "environment")?.value ??
- `${UNKNOWN_ID}`
- );
-});
-
-const rawDatabaseList = computed(() => {
- let list: ComposedDatabase[] = [];
- if (selectedProject.value) {
- list = databaseV1Store.databaseListByProject(selectedProject.value.name);
- } else {
- list = databaseV1Store.databaseListByUser;
+ const environmentId = state.params.scopes.find(
+ (scope) => scope.id === "environment"
+ )?.value;
+ if (!environmentId) {
+ return;
}
- list = list.filter(
- (db) => db.state == State.ACTIVE && db.project !== DEFAULT_PROJECT_NAME
- );
- return list;
+ return `${environmentNamePrefix}${environmentId}`;
});
-const filteredDatabaseList = computed(() => {
- let list = [...rawDatabaseList.value];
-
- list = list.filter((db) => {
- if (selectedEnvironment.value !== `${UNKNOWN_ID}`) {
- return (
- extractEnvironmentResourceName(db.effectiveEnvironment) ===
- selectedEnvironment.value
- );
- }
- if (selectedInstance.value !== `${UNKNOWN_ID}`) {
- return (
- extractInstanceResourceName(db.instance) === selectedInstance.value
- );
- }
- return filterDatabaseV1ByKeyword(db, state.params.query.trim(), [
- "name",
- "environment",
- "instance",
- ]);
- });
-
- const labels = state.selectedLabels;
- if (labels.length > 0) {
- list = list.filter((db) => {
- return labels.some((kv) => db.labels[kv.key] === kv.value);
- });
- }
-
- return sortDatabaseV1List(list);
+const selectedLabels = computed(() => {
+ return state.params.scopes
+ .filter((scope) => scope.id === "label")
+ .map((scope) => scope.value);
});
+const filter = computed(() => ({
+ instance: selectedInstance.value,
+ environment: selectedEnvironment.value,
+ query: state.params.query,
+ labels: selectedLabels.value,
+}));
+
const handleDatabasesSelectionChanged = (
selectedDatabaseNameList: Set<string>
): void => {
@@ -186,9 +149,12 @@ const navigateToIssuePage = async () => {
return;
}
- const selectedDatabase = filteredDatabaseList.value.find(
- (db) => db.name === state.selectedDatabaseName
- ) as ComposedDatabase;
+ const selectedDatabase = databaseV1Store.getDatabaseByName(
+ state.selectedDatabaseName
+ );
+ if (!isValidDatabaseName(selectedDatabase.name)) {
+ return;
+ }
const project = selectedDatabase?.projectEntity;
const issueType = "bb.issue.database.data.export";
diff --git a/frontend/src/components/Database/context.ts b/frontend/src/components/Database/context.ts
index 8bc1f27196..db3d992386 100644
--- a/frontend/src/components/Database/context.ts
+++ b/frontend/src/components/Database/context.ts
@@ -1,3 +1,4 @@
+import { computedAsync } from "@vueuse/core";
import type { InjectionKey, Ref } from "vue";
import { computed, inject, provide, ref } from "vue";
import { useAppFeature, useDatabaseV1Store } from "@/store";
@@ -6,7 +7,7 @@ import {
instanceNamePrefix,
} from "@/store/modules/v1/common";
import type { ComposedDatabase, Permission } from "@/types";
-import { DEFAULT_PROJECT_NAME } from "@/types";
+import { DEFAULT_PROJECT_NAME, unknownDatabase } from "@/types";
import {
hasProjectPermissionV2,
instanceV1HasAlterSchema,
@@ -48,11 +49,11 @@ export const provideDatabaseDetailContext = (
const databaseV1Store = useDatabaseV1Store();
- const database: Ref<ComposedDatabase> = computed(() => {
- return databaseV1Store.getDatabaseByName(
+ const database: Ref<ComposedDatabase> = computedAsync(() => {
+ return databaseV1Store.getOrFetchDatabaseByName(
`${instanceNamePrefix}${instanceId.value}/${databaseNamePrefix}${databaseName.value}`
);
- });
+ }, unknownDatabase());
const pagedRevisionTableSessionKey = ref(
`bb.paged-revision-table.${Date.now()}`
diff --git a/frontend/src/components/DatabaseAndGroupSelector/DatabaseAndGroupSelector.vue b/frontend/src/components/DatabaseAndGroupSelector/DatabaseAndGroupSelector.vue
index b43000620f..cd7d807f89 100644
--- a/frontend/src/components/DatabaseAndGroupSelector/DatabaseAndGroupSelector.vue
+++ b/frontend/src/components/DatabaseAndGroupSelector/DatabaseAndGroupSelector.vue
@@ -7,13 +7,14 @@
:autofocus="false"
:placeholder="$t('database.filter-database')"
:scope-options="scopeOptions"
+ :readonly-scopes="readonlyScopes"
/>
- <DatabaseV1Table
+ <PagedDatabaseTable
mode="PROJECT"
- :database-list="filteredDatabaseList"
:show-selection="true"
- :selected-database-names="databaseSelectState.selectedDatabaseNameList"
- :keyword="searchParams.query.trim().toLowerCase()"
+ :custom-click="true"
+ :parent="project.name"
+ :filter="filter"
@update:selected-databases="
databaseSelectState.selectedDatabaseNameList = Array.from($event)
"
@@ -42,22 +43,18 @@ import { head } from "lodash-es";
import { NTabs, NTabPane } from "naive-ui";
import { computed, reactive, ref, watch } from "vue";
import DatabaseGroupDataTable from "@/components/DatabaseGroup/DatabaseGroupDataTable.vue";
-import DatabaseV1Table from "@/components/v2/Model/DatabaseV1Table/DatabaseV1Table.vue";
-import { useDatabaseV1Store, useDBGroupListByProject } from "@/store";
-import { useDatabaseV1List } from "@/store/modules/v1/databaseList";
+import { PagedDatabaseTable } from "@/components/v2/Model/DatabaseV1Table";
+import { useDBGroupListByProject } from "@/store";
import {
- DEFAULT_PROJECT_NAME,
- UNKNOWN_ID,
- type ComposedProject,
-} from "@/types";
-import { State } from "@/types/proto/v1/common";
+ instanceNamePrefix,
+ environmentNamePrefix,
+} from "@/store/modules/v1/common";
+import { type ComposedProject } from "@/types";
import {
CommonFilterScopeIdList,
- extractEnvironmentResourceName,
- extractInstanceResourceName,
- filterDatabaseV1ByKeyword,
- sortDatabaseV1List,
+ extractProjectResourceName,
type SearchParams,
+ type SearchScope,
} from "@/utils";
import AdvancedSearch from "../AdvancedSearch/AdvancedSearch.vue";
import { useCommonSearchScopeOptions } from "../AdvancedSearch/useCommonSearchScopeOptions";
@@ -73,12 +70,15 @@ const emit = defineEmits<{
(event: "update", state: DatabaseSelectState): void;
}>();
-const databaseStore = useDatabaseV1Store();
+const readonlyScopes = computed((): SearchScope[] => [
+ { id: "project", value: extractProjectResourceName(props.project.name) },
+]);
const searchParams = ref<SearchParams>({
query: "",
- scopes: [],
+ scopes: [...readonlyScopes.value],
});
+
const databaseSelectState = reactive<DatabaseSelectState>(
props.databaseSelectState || {
changeSource: "DATABASE",
@@ -86,61 +86,34 @@ const databaseSelectState = reactive<DatabaseSelectState>(
}
);
-useDatabaseV1List(props.project.name);
const { dbGroupList } = useDBGroupListByProject(props.project.name);
-const databaseList = computed(() => {
- const list = databaseStore
- .databaseListByProject(props.project.name)
- .filter(
- (db) =>
- db.state == State.ACTIVE && db.project !== DEFAULT_PROJECT_NAME
- );
- return sortDatabaseV1List(list);
-});
-
const selectedInstance = computed(() => {
- return (
- searchParams.value.scopes.find((scope) => scope.id === "instance")?.value ??
- `${UNKNOWN_ID}`
- );
+ const instanceId = searchParams.value.scopes.find(
+ (scope) => scope.id === "instance"
+ )?.value;
+ if (!instanceId) {
+ return;
+ }
+ return `${instanceNamePrefix}${instanceId}`;
});
const selectedEnvironment = computed(() => {
- return (
- searchParams.value.scopes.find((scope) => scope.id === "environment")
- ?.value ?? `${UNKNOWN_ID}`
- );
-});
-
-const filteredDatabaseList = computed(() => {
- let list = databaseList.value;
- if (selectedEnvironment.value !== `${UNKNOWN_ID}`) {
- list = list.filter(
- (db) =>
- extractEnvironmentResourceName(db.effectiveEnvironment) ===
- selectedEnvironment.value
- );
- }
- if (selectedInstance.value !== `${UNKNOWN_ID}`) {
- list = list.filter(
- (db) =>
- extractInstanceResourceName(db.instance) === selectedInstance.value
- );
+ const environmentId = searchParams.value.scopes.find(
+ (scope) => scope.id === "environment"
+ )?.value;
+ if (!environmentId) {
+ return;
}
- const keyword = searchParams.value.query.trim().toLowerCase();
- if (keyword) {
- list = list.filter((db) =>
- filterDatabaseV1ByKeyword(db, keyword, [
- "name",
- "environment",
- "instance",
- ])
- );
- }
- return list;
+ return `${environmentNamePrefix}${environmentId}`;
});
+const filter = computed(() => ({
+ instance: selectedInstance.value,
+ environment: selectedEnvironment.value,
+ query: searchParams.value.query,
+}));
+
const scopeOptions = useCommonSearchScopeOptions(
computed(() => searchParams.value),
[...CommonFilterScopeIdList]
diff --git a/frontend/src/components/DatabaseGroup/DatabaseGroupForm.vue b/frontend/src/components/DatabaseGroup/DatabaseGroupForm.vue
index 580a22f378..e9b073330e 100644
--- a/frontend/src/components/DatabaseGroup/DatabaseGroupForm.vue
+++ b/frontend/src/components/DatabaseGroup/DatabaseGroupForm.vue
@@ -37,7 +37,7 @@
:enable-raw-expression="true"
:factor-list="FactorList"
:factor-support-dropdown="factorSupportDropdown"
- :option-config-map="getDatabaseGroupOptionConfigMap(project)"
+ :option-config-map="getDatabaseGroupOptionConfigMap()"
/>
<p
v-if="matchingError"
@@ -129,7 +129,6 @@ import {
databaseGroupNamePrefix,
getProjectNameAndDatabaseGroupName,
} from "@/store/modules/v1/common";
-import { useDatabaseV1List } from "@/store/modules/v1/databaseList";
import type {
ComposedDatabase,
ComposedProject,
@@ -180,7 +179,6 @@ const state = reactive<LocalState>({
expr: wrapAsGroup(emptySimpleExpr()),
multitenancy: false,
});
-const { databaseList } = useDatabaseV1List(props.project.name);
const resourceIdField = ref<InstanceType<typeof ResourceIdField>>();
const router = useRouter();
const dialog = useDialog();
@@ -253,7 +251,7 @@ const updateDatabaseMatchingState = useDebounceFn(async () => {
if (!validateSimpleExpr(state.expr)) {
matchingError.value = undefined;
matchedDatabaseList.value = [];
- unmatchedDatabaseList.value = databaseList.value;
+ unmatchedDatabaseList.value = [];
return;
}
@@ -270,7 +268,7 @@ const updateDatabaseMatchingState = useDebounceFn(async () => {
} catch (error) {
matchingError.value = (error as ClientError).details;
matchedDatabaseList.value = [];
- unmatchedDatabaseList.value = databaseList.value;
+ unmatchedDatabaseList.value = [];
}
state.isRequesting = false;
}, 500);
diff --git a/frontend/src/components/DatabaseGroup/utils.ts b/frontend/src/components/DatabaseGroup/utils.ts
index f4f1067102..5269dff71c 100644
--- a/frontend/src/components/DatabaseGroup/utils.ts
+++ b/frontend/src/components/DatabaseGroup/utils.ts
@@ -1,10 +1,7 @@
-import { uniq } from "lodash-es";
import type { SelectOption } from "naive-ui";
import { type OptionConfig } from "@/components/ExprEditor/context";
import type { Factor } from "@/plugins/cel";
-import { useEnvironmentV1Store } from "@/store";
-import { useDatabaseV1List } from "@/store/modules/v1/databaseList";
-import type { ComposedProject } from "@/types";
+import { useEnvironmentV1Store, useInstanceV1Store } from "@/store";
import {
extractEnvironmentResourceName,
extractInstanceResourceName,
@@ -21,7 +18,7 @@ export const factorSupportDropdown: Factor[] = [
"resource.instance_id",
];
-export const getDatabaseGroupOptionConfigMap = (project: ComposedProject) => {
+export const getDatabaseGroupOptionConfigMap = () => {
return FactorList.reduce((map, factor) => {
let options: SelectOption[] = [];
switch (factor) {
@@ -29,7 +26,7 @@ export const getDatabaseGroupOptionConfigMap = (project: ComposedProject) => {
options = getEnvironmentOptions();
break;
case "resource.instance_id":
- options = getInstanceIdOptions(project);
+ options = getInstanceIdOptions();
break;
}
map.set(factor, {
@@ -51,12 +48,9 @@ const getEnvironmentOptions = () => {
});
};
-const getInstanceIdOptions = (project: ComposedProject) => {
- const { databaseList } = useDatabaseV1List(project.name);
- return uniq(
- databaseList.value.map((d) => d.instanceResource.name)
- ).map<SelectOption>((instanceName) => {
- const instanceId = extractInstanceResourceName(instanceName);
+const getInstanceIdOptions = () => {
+ return useInstanceV1Store().instanceList.map<SelectOption>((instance) => {
+ const instanceId = extractInstanceResourceName(instance.name);
return {
label: instanceId,
value: instanceId,
diff --git a/frontend/src/components/GeneralSetting/DatabaseChangeModeSetting.vue b/frontend/src/components/GeneralSetting/DatabaseChangeModeSetting.vue
index 9719c88221..12220b4687 100644
--- a/frontend/src/components/GeneralSetting/DatabaseChangeModeSetting.vue
+++ b/frontend/src/components/GeneralSetting/DatabaseChangeModeSetting.vue
@@ -92,13 +92,12 @@
</template>
<script lang="ts" setup>
-import { isEqual } from "lodash-es";
import { NRadioGroup, NSpace, NRadio, NButton } from "naive-ui";
import { computed, reactive, ref } from "vue";
import { BBModal } from "@/bbkit";
import LearnMoreLink from "@/components/LearnMoreLink.vue";
import { router } from "@/router";
-import { WORKSPACE_ROOT_MODULE } from "@/router/dashboard/workspaceRoutes";
+import { WORKSPACE_ROUTE_LANDING } from "@/router/dashboard/workspaceRoutes";
import { SQL_EDITOR_HOME_MODULE } from "@/router/sqlEditor";
import { useSettingV1Store } from "@/store/modules/v1/setting";
import { DatabaseChangeMode } from "@/types/proto/v1/setting_service";
@@ -137,7 +136,7 @@ const containerRef = ref<HTMLDivElement>();
const state = reactive<LocalState>(getInitialState());
const allowSave = computed((): boolean => {
- return !isEqual(state, getInitialState());
+ return state.databaseChangeMode !== getInitialState().databaseChangeMode;
});
const onUpdate = async () => {
@@ -157,12 +156,12 @@ const onUpdate = async () => {
isSQLEditorRoute(router) &&
state.databaseChangeMode === DatabaseChangeMode.PIPELINE
) {
- router.push({ name: WORKSPACE_ROOT_MODULE });
+ router.replace({ name: WORKSPACE_ROUTE_LANDING });
}
};
const goToSQLEditor = () => {
- router.push({
+ router.replace({
name: SQL_EDITOR_HOME_MODULE,
});
};
diff --git a/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/DatabaseResourceSelector.vue b/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/DatabaseResourceSelector.vue
index 7241b6e14e..c5fef67445 100644
--- a/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/DatabaseResourceSelector.vue
+++ b/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/DatabaseResourceSelector.vue
@@ -1,6 +1,7 @@
<template>
<div class="w-full relative">
<NTransfer
+ id="database-resource-selector"
v-model:value="selectedValueList"
style="height: 512px"
:disabled="disabled"
@@ -20,7 +21,8 @@
</template>
<script setup lang="tsx">
-import { orderBy } from "lodash-es";
+import { useDebounceFn } from "@vueuse/core";
+import { orderBy, uniqBy } from "lodash-es";
import type { TransferRenderSourceList, TreeOption } from "naive-ui";
import { NTransfer, NTree } from "naive-ui";
import { computed, h, onMounted, ref, watch } from "vue";
@@ -28,12 +30,10 @@ import { BBSpin } from "@/bbkit";
import {
useDatabaseV1Store,
useDBSchemaV1Store,
- useProjectByName,
+ batchGetOrFetchDatabases,
} from "@/store";
-import { useDatabaseV1List } from "@/store/modules/v1/databaseList";
-import type { DatabaseResource } from "@/types";
+import type { ComposedDatabase, DatabaseResource } from "@/types";
import { DatabaseMetadataView } from "@/types/proto/v1/database_service";
-import { wrapRefAsPromise } from "@/utils";
import Label from "./Label.vue";
import type { DatabaseTreeOption } from "./common";
import {
@@ -59,7 +59,6 @@ const emit = defineEmits<{
const databaseStore = useDatabaseV1Store();
const dbSchemaStore = useDBSchemaV1Store();
-const { project } = useProjectByName(props.projectName);
const parseResourceToKey = (resource: DatabaseResource): string => {
const data = [
@@ -89,6 +88,8 @@ const selectedValueList = ref<string[]>([]);
const expandedKeys = ref<string[]>([]);
const indeterminateKeys = ref<string[]>([]);
const loading = ref(true);
+const databaseList = ref<ComposedDatabase[]>([]);
+const searchText = ref<string>("");
const cascadeLoopTreeNode = (
treeNode: DatabaseTreeOption,
@@ -100,8 +101,42 @@ const cascadeLoopTreeNode = (
}
};
+const fetchDatabaseList = useDebounceFn(async () => {
+ const { databases } = await databaseStore.fetchDatabases({
+ pageSize: 100,
+ parent: props.projectName,
+ filter: searchText.value ? `name.matches("${searchText.value}")` : "",
+ });
+ databaseList.value = databases;
+}, 500);
+
+watch(() => searchText.value, fetchDatabaseList);
+
onMounted(async () => {
- await wrapRefAsPromise(useDatabaseV1List(props.projectName).ready, true);
+ await fetchDatabaseList();
+ await batchGetOrFetchDatabases(
+ props.databaseResources.map((resource) => resource.databaseFullName)
+ );
+
+ // TODO(ed): I really don't want to do this.
+ // But the transfer component not support native search callback.
+ const selectorElement = document.getElementById("database-resource-selector");
+ const input = selectorElement?.querySelector("input");
+ if (input) {
+ input.addEventListener("input", () => {
+ searchText.value = input.value;
+ });
+ }
+
+ databaseList.value = uniqBy(
+ [
+ ...databaseList.value,
+ ...props.databaseResources.map((resource) =>
+ databaseStore.getDatabaseByName(resource.databaseFullName)
+ ),
+ ],
+ (db) => db.name
+ );
const selectedKeys = props.databaseResources.map(parseResourceToKey);
const databaseNames = new Set(
@@ -195,20 +230,6 @@ const parseKeyToPathes = (key: string): string[] => {
return resp;
};
-const databaseList = computed(() => {
- const list = orderBy(
- databaseStore.databaseListByProject(project.value.name),
- [
- (db) => db.effectiveEnvironmentEntity.order,
- (db) => db.effectiveEnvironmentEntity.title,
- (db) => db.databaseName,
- (db) => db.instanceResource.title,
- ],
- ["desc", "asc", "asc", "asc"]
- );
- return list;
-});
-
const sourceTreeOptions = computed(() => {
return mapTreeOptions({
databaseList: databaseList.value,
@@ -228,7 +249,9 @@ const onTreeNodeLoad = async (node: TreeOption) => {
database: treeNode.value,
view: DatabaseMetadataView.DATABASE_METADATA_VIEW_BASIC,
});
- const database = databaseStore.getDatabaseByName(treeNode.value);
+ const database = await databaseStore.getOrFetchDatabaseByName(
+ treeNode.value
+ );
const children = getSchemaOrTableTreeOptions({
database,
includeCloumn: props.includeCloumn,
diff --git a/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/Label.vue b/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/Label.vue
index f102d5348a..1359b5f1c9 100644
--- a/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/Label.vue
+++ b/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/Label.vue
@@ -17,6 +17,7 @@
</template>
<script setup lang="ts">
+import { computedAsync } from "@vueuse/core";
import { escape } from "lodash-es";
import { computed, h } from "vue";
import DatabaseIcon from "~icons/heroicons-outline/circle-stack";
@@ -34,10 +35,10 @@ const props = defineProps<{
const option = computed(() => props.option);
-const database = computed(() => {
+const database = computedAsync(() => {
const { option } = props;
if (option.level !== "databases") return undefined;
- return useDatabaseV1Store().getDatabaseByName(option.value);
+ return useDatabaseV1Store().getOrFetchDatabaseByName(option.value);
});
const environment = computed(() => {
diff --git a/frontend/src/components/InstanceForm/Buttons.vue b/frontend/src/components/InstanceForm/Buttons.vue
index c1aa5c1a55..508c522cd1 100644
--- a/frontend/src/components/InstanceForm/Buttons.vue
+++ b/frontend/src/components/InstanceForm/Buttons.vue
@@ -55,20 +55,19 @@ import { computed, ref } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import {
+ useDatabaseV1Store,
useInstanceV1Store,
useSubscriptionV1Store,
useGracefulRequest,
pushNotification,
- useDBSchemaV1Store,
} from "@/store";
-import { useDatabaseV1List } from "@/store/modules/v1/databaseList";
import { Engine } from "@/types/proto/v1/common";
import {
DataSource,
DataSourceType,
Instance,
} from "@/types/proto/v1/instance_service";
-import { isValidSpannerHost, defer, wrapRefAsPromise } from "@/utils";
+import { isValidSpannerHost, defer } from "@/utils";
import ScanIntervalInput from "./ScanIntervalInput.vue";
import {
calcDataSourceUpdateMask,
@@ -116,6 +115,7 @@ const {
const router = useRouter();
const { t } = useI18n();
const instanceV1Store = useInstanceV1Store();
+const databaseStore = useDatabaseV1Store();
const subscriptionStore = useSubscriptionV1Store();
const scanIntervalInputRef = ref<InstanceType<typeof ScanIntervalInput>>();
@@ -266,8 +266,6 @@ const doCreate = async () => {
const createdInstance = await instanceV1Store.createInstance(
pendingCreateInstance.value
);
- // Sync the database list after instance is created.
- useDatabaseV1List(createdInstance.name);
if (props.onCreated) {
props.onCreated(createdInstance);
} else {
@@ -387,13 +385,7 @@ const doUpdate = async () => {
};
const refreshInstanceDatabases = async (instance: string) => {
await instanceV1Store.syncInstance(instance, true);
- const { listCache, databaseList, ready } = useDatabaseV1List(instance);
- listCache.deleteCache(instance);
- await wrapRefAsPromise(ready, true);
- const dbSchemaStore = useDBSchemaV1Store();
- databaseList.value.forEach((database) =>
- dbSchemaStore.removeCache(database.name)
- );
+ databaseStore.removeCacheByInstance(instance);
};
/**
* @returns true if blocked by connection testing failure
diff --git a/frontend/src/components/IssueV1/components/GrantRequest/DatabaseResourceTable.vue b/frontend/src/components/IssueV1/components/GrantRequest/DatabaseResourceTable.vue
index 9663497be2..d8c976588f 100644
--- a/frontend/src/components/IssueV1/components/GrantRequest/DatabaseResourceTable.vue
+++ b/frontend/src/components/IssueV1/components/GrantRequest/DatabaseResourceTable.vue
@@ -35,7 +35,7 @@ import { watch } from "vue";
import { useI18n } from "vue-i18n";
import { BBGrid, type BBGridColumn } from "@/bbkit";
import { EnvironmentV1Name, InstanceV1Name } from "@/components/v2";
-import { useDatabaseV1Store } from "@/store";
+import { useDatabaseV1Store, batchGetOrFetchDatabases } from "@/store";
import type { DatabaseResource } from "@/types";
import type { DatabaseGroup } from "@/types/proto/v1/database_group_service";
@@ -79,11 +79,11 @@ const extractComposedDatabase = (databaseResource: DatabaseResource) => {
watch(
() => props.databaseResourceList,
async () => {
- for (const databaseResource of props.databaseResourceList) {
- await databaseStore.getOrFetchDatabaseByName(
- databaseResource.databaseFullName
- );
- }
+ await batchGetOrFetchDatabases(
+ props.databaseResourceList.map(
+ (databaseResource) => databaseResource.databaseFullName
+ )
+ );
},
{
immediate: true,
diff --git a/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue b/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue
index 3787ccce94..0c2bd78e69 100644
--- a/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue
+++ b/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue
@@ -245,7 +245,7 @@ const maybeFormatSQL = async (sheet: Sheet, target: string) => {
if (!formatOnSave.value) {
return;
}
- const db = useDatabaseV1Store().getDatabaseByName(target);
+ const db = await useDatabaseV1Store().getOrFetchDatabaseByName(target);
if (!db) {
return;
}
diff --git a/frontend/src/components/IssueV1/components/IssueSearch/Status.vue b/frontend/src/components/IssueV1/components/IssueSearch/Status.vue
index 1a9f2418fb..3b6aa17067 100644
--- a/frontend/src/components/IssueV1/components/IssueSearch/Status.vue
+++ b/frontend/src/components/IssueV1/components/IssueSearch/Status.vue
@@ -55,9 +55,12 @@ const tab = computed(() => {
const updateStatus = (value: SemanticIssueStatus) => {
if (!["", "OPEN", "CLOSED"].includes(value)) return;
- const updated = upsertScope(props.params, {
- id: "status",
- value: value,
+ const updated = upsertScope({
+ params: props.params,
+ scopes: {
+ id: "status",
+ value: value,
+ },
});
emit("update:params", updated);
};
diff --git a/frontend/src/components/IssueV1/logic/initialize/create.ts b/frontend/src/components/IssueV1/logic/initialize/create.ts
index ad50f73744..c7e0c7ddb3 100644
--- a/frontend/src/components/IssueV1/logic/initialize/create.ts
+++ b/frontend/src/components/IssueV1/logic/initialize/create.ts
@@ -13,17 +13,16 @@ import {
useProjectV1Store,
useSheetV1Store,
useStorageStore,
+ batchGetOrFetchDatabases,
} from "@/store";
import {
databaseNamePrefix,
projectNamePrefix,
} from "@/store/modules/v1/common";
-import { useDatabaseV1List } from "@/store/modules/v1/databaseList";
import type { ComposedProject } from "@/types";
import {
emptyIssue,
isValidDatabaseName,
- isValidProjectName,
TaskTypeListWithStatement,
} from "@/types";
import { DatabaseGroupView } from "@/types/proto/v1/database_group_service";
@@ -46,7 +45,6 @@ import {
hasProjectPermissionV2,
setSheetStatement,
sheetNameOfTaskV1,
- wrapRefAsPromise,
} from "@/utils";
import { getArchiveDatabase } from "../../components/Sidebar/PreBackupSection/common";
import { nextUID } from "../base";
@@ -137,7 +135,7 @@ export const buildPlan = async (params: CreateIssueParams) => {
databaseNameList = dbGroup.matchedDatabases.map((db) => db.name);
}
}
- await prepareDatabaseList(databaseNameList, project.name);
+ await batchGetOrFetchDatabases(databaseNameList);
const plan = Plan.fromPartial({
name: `${project.name}/plans/${nextUID()}`,
});
@@ -168,8 +166,10 @@ export const buildSteps = async (
params: CreateIssueParams,
sheetUID?: string // if specified, all tasks will share the same sheet
) => {
+ await batchGetOrFetchDatabases(databaseNameList);
+ const databaseStore = useDatabaseV1Store();
const databaseList = databaseNameList.map((name) =>
- useDatabaseV1Store().getDatabaseByName(name)
+ databaseStore.getDatabaseByName(name)
);
const databaseListGroupByEnvironment = groupBy(
@@ -238,8 +238,10 @@ export const buildStepsViaChangelist = async (
);
const { changes } = changelist;
+ await batchGetOrFetchDatabases(databaseNameList);
+ const databaseStore = useDatabaseV1Store();
const databaseList = databaseNameList.map((name) =>
- useDatabaseV1Store().getDatabaseByName(name)
+ databaseStore.getDatabaseByName(name)
);
const databaseListGroupByEnvironment = groupBy(
@@ -318,7 +320,8 @@ export const buildSpecForTarget = async (
if (version) {
spec.changeDatabaseConfig.schemaVersion = version;
}
- const database = useDatabaseV1Store().getDatabaseByName(target);
+ const database =
+ await useDatabaseV1Store().getOrFetchDatabaseByName(target);
if (isValidDatabaseName(database.name)) {
// Set default backup behavior for the database.
if (project.autoEnableBackup) {
@@ -460,38 +463,6 @@ const hasInitialSQL = (initialSQL?: InitialSQL) => {
return false;
};
-export const prepareDatabaseList = async (
- databaseNameList: string[],
- projectName: string
-) => {
- const databaseStore = useDatabaseV1Store();
- if (isValidProjectName(projectName)) {
- // For preparing the database if user visits creating issue url directly.
- // It's horrible to fetchDatabaseByName one-by-one when query.databaseList
- // is big (100+ sometimes)
- // So we are fetching databaseList by project since that's better cached.
- const project =
- await useProjectV1Store().getOrFetchProjectByName(projectName);
- await prepareDatabaseListByProject(project.name);
- } else {
- // Otherwise, we don't have the projectName (very rare to see, theoretically)
- // so we need to fetch the first database in databaseList by id,
- // and see what project it belongs.
- if (databaseNameList.length > 0) {
- const firstDB = await databaseStore.getOrFetchDatabaseByName(
- databaseNameList[0]
- );
- if (databaseNameList.length > 1) {
- await prepareDatabaseListByProject(firstDB.project);
- }
- }
- }
-};
-
-const prepareDatabaseListByProject = async (project: string) => {
- await wrapRefAsPromise(useDatabaseV1List(project).ready, true);
-};
-
export const isValidStage = (stage: Stage): boolean => {
for (const task of stage.tasks) {
if (task.type === Task_Type.DATABASE_SCHEMA_BASELINE) {
diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateButton.vue b/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateButton.vue
index 6ffe298351..1981609f3a 100644
--- a/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateButton.vue
+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateButton.vue
@@ -169,7 +169,7 @@ const maybeFormatSQL = async (sheet: Sheet, target: string) => {
if (!formatOnSave.value) {
return;
}
- const db = useDatabaseV1Store().getDatabaseByName(target);
+ const db = await useDatabaseV1Store().getOrFetchDatabaseByName(target);
if (!db) {
return;
}
diff --git a/frontend/src/components/Plan/logic/initialize/create.ts b/frontend/src/components/Plan/logic/initialize/create.ts
index d0147bdae8..cd2cf1f697 100644
--- a/frontend/src/components/Plan/logic/initialize/create.ts
+++ b/frontend/src/components/Plan/logic/initialize/create.ts
@@ -9,12 +9,11 @@ import {
useProjectV1Store,
useSheetV1Store,
useStorageStore,
+ batchGetOrFetchDatabases,
} from "@/store";
import { projectNamePrefix } from "@/store/modules/v1/common";
-import { useDatabaseV1List } from "@/store/modules/v1/databaseList";
import { composePlan } from "@/store/modules/v1/plan";
import type { ComposedProject } from "@/types";
-import { isValidProjectName } from "@/types";
import {
Plan,
Plan_ChangeDatabaseConfig,
@@ -28,7 +27,6 @@ import {
generateSQLForChangeToDatabase,
getSheetStatement,
setSheetStatement,
- wrapRefAsPromise,
} from "@/utils";
import { databaseEngineForSpec, sheetNameForSpec } from "../plan";
import { createEmptyLocalSheet, getLocalSheetByName } from "../sheet";
@@ -61,7 +59,7 @@ export const createPlanSkeleton = async (
`${projectNamePrefix}${projectName}`
);
const databaseNameList = (query.databaseList ?? "").split(",");
- await prepareDatabaseList(databaseNameList, project.name);
+ await batchGetOrFetchDatabases(databaseNameList);
const params: CreatePlanParams = {
databaseNameList,
@@ -109,8 +107,10 @@ export const buildSteps = async (
params: CreatePlanParams,
sheetUID?: string // if specified, all specs will share the same sheet
) => {
+ await batchGetOrFetchDatabases(databaseNameList);
+ const databaseStore = useDatabaseV1Store();
const databaseList = databaseNameList.map((name) =>
- useDatabaseV1Store().getDatabaseByName(name)
+ databaseStore.getDatabaseByName(name)
);
const databaseListGroupByEnvironment = groupBy(
@@ -186,8 +186,10 @@ export const buildStepsViaChangelist = async (
);
const { changes } = changelist;
+ await batchGetOrFetchDatabases(databaseNameList);
+ const databaseStore = useDatabaseV1Store();
const databaseList = databaseNameList.map((name) =>
- useDatabaseV1Store().getDatabaseByName(name)
+ databaseStore.getDatabaseByName(name)
);
const databaseListGroupByEnvironment = groupBy(
@@ -360,38 +362,6 @@ const hasInitialSQL = (initialSQL?: InitialSQL) => {
return false;
};
-export const prepareDatabaseList = async (
- databaseNameList: string[],
- projectName: string
-) => {
- const databaseStore = useDatabaseV1Store();
- if (isValidProjectName(projectName)) {
- // For preparing the database if user visits creating plan url directly.
- // It's horrible to fetchDatabaseByName one-by-one when query.databaseList
- // is big (100+ sometimes)
- // So we are fetching databaseList by project since that's better cached.
- const project =
- await useProjectV1Store().getOrFetchProjectByName(projectName);
- await prepareDatabaseListByProject(project.name);
- } else {
- // Otherwise, we don't have the projectName (very rare to see, theoretically)
- // so we need to fetch the first database in databaseList by id,
- // and see what project it belongs.
- if (databaseNameList.length > 0) {
- const firstDB = await databaseStore.getOrFetchDatabaseByName(
- databaseNameList[0]
- );
- if (databaseNameList.length > 1) {
- await prepareDatabaseListByProject(firstDB.project);
- }
- }
- }
-};
-
-const prepareDatabaseListByProject = async (project: string) => {
- await wrapRefAsPromise(useDatabaseV1List(project).ready, true);
-};
-
export const isValidSpec = (spec: Plan_Spec): boolean => {
if (spec.changeDatabaseConfig) {
const sheetName = sheetNameForSpec(spec);
diff --git a/frontend/src/components/Project/ProjectIssuesPanel.vue b/frontend/src/components/Project/ProjectIssuesPanel.vue
index 008c1b8ee5..cb2157c966 100644
--- a/frontend/src/components/Project/ProjectIssuesPanel.vue
+++ b/frontend/src/components/Project/ProjectIssuesPanel.vue
@@ -213,34 +213,43 @@ const mergeSearchParamsByTab = (params: SearchParams, tab: TabValue) => {
return common;
}
if (tab === "CREATED") {
- return upsertScope(common, {
- id: "creator",
- value: me.value.email,
+ return upsertScope({
+ params: common,
+ scopes: {
+ id: "creator",
+ value: me.value.email,
+ },
});
}
if (tab === "WAITING_APPROVAL") {
- return upsertScope(common, [
- {
- id: "status",
- value: "OPEN",
- },
- {
- id: "approval",
- value: "pending",
- },
- ]);
+ return upsertScope({
+ params: common,
+ scopes: [
+ {
+ id: "status",
+ value: "OPEN",
+ },
+ {
+ id: "approval",
+ value: "pending",
+ },
+ ],
+ });
}
if (tab === "WAITING_ROLLOUT") {
- return upsertScope(common, [
- {
- id: "status",
- value: "OPEN",
- },
- {
- id: "approval",
- value: "approved",
- },
- ]);
+ return upsertScope({
+ params: common,
+ scopes: [
+ {
+ id: "status",
+ value: "OPEN",
+ },
+ {
+ id: "approval",
+ value: "approved",
+ },
+ ],
+ });
}
console.error("[mergeSearchParamsByTab] should never reach this line", tab);
return common;
@@ -369,14 +378,14 @@ watch(
() => {
if (tab.value === "WAITING_APPROVAL" || tab.value === "WAITING_ROLLOUT") {
if (getValueFromSearchParams(state.params, "status") === "CLOSED") {
- upsertScope(
- state.params,
- {
+ upsertScope({
+ params: state.params,
+ scopes: {
id: "status",
value: "OPEN",
},
- true /* mutate */
- );
+ mutate: true,
+ });
}
}
},
diff --git a/frontend/src/components/Project/useCurrentProject.ts b/frontend/src/components/Project/useCurrentProject.ts
index a2b8758677..55667762eb 100644
--- a/frontend/src/components/Project/useCurrentProject.ts
+++ b/frontend/src/components/Project/useCurrentProject.ts
@@ -36,19 +36,19 @@ export const useCurrentProject = (
return String(UNKNOWN_ID);
});
- const database = computed(() => {
+ const database = computedAsync(async () => {
if (unref(params).changelogId) {
const parent = `${instanceNamePrefix}${route.params.instanceId}/${databaseNamePrefix}${route.params.databaseName}`;
- return useDatabaseV1Store().getDatabaseByName(parent);
+ return await useDatabaseV1Store().getOrFetchDatabaseByName(parent);
} else if (unref(params).databaseName) {
- return useDatabaseV1Store().getDatabaseByName(
+ return await useDatabaseV1Store().getOrFetchDatabaseByName(
`${instanceNamePrefix}${
unref(params).instanceId
}/${databaseNamePrefix}${unref(params).databaseName}`
);
}
return unknownDatabase();
- });
+ }, unknownDatabase());
const project = computedAsync(async () => {
if (unref(params).projectId) {
diff --git a/frontend/src/components/ProjectDatabasesPanel.vue b/frontend/src/components/ProjectDatabasesPanel.vue
index a4231de59e..a81176ebc0 100644
--- a/frontend/src/components/ProjectDatabasesPanel.vue
+++ b/frontend/src/components/ProjectDatabasesPanel.vue
@@ -1,17 +1,5 @@
<template>
<div class="space-y-2">
- <div v-if="databaseList.length === 0" class="textinfolabel p-2">
- <i18n-t keypath="project.overview.no-db-prompt" tag="p">
- <template #newDb>
- <span class="text-main">{{ $t("quick-action.new-db") }}</span>
- </template>
- <template #transferInDb>
- <span class="text-main">
- {{ $t("quick-action.transfer-in-db") }}
- </span>
- </template>
- </i18n-t>
- </div>
<div
class="w-full flex flex-col sm:flex-row items-start sm:items-end justify-between gap-2"
>
@@ -21,11 +9,7 @@
:autofocus="false"
:placeholder="$t('database.filter-database')"
:scope-options="scopeOptions"
- />
- <DatabaseLabelFilter
- v-model:selected="state.selectedLabels"
- :database-list="databaseList"
- :placement="'left-start'"
+ :readonly-scopes="readonlyScopes"
/>
<NButton
v-if="allowToCreateDB"
@@ -42,13 +26,11 @@
:project-name="project.name"
:databases="selectedDatabases"
/>
- <DatabaseV1Table
- :key="`database-table.${project.name}`"
+ <PagedDatabaseTable
mode="PROJECT"
- :database-list="filteredDatabaseList"
- :custom-click="true"
- :keyword="state.params.query.trim().toLowerCase()"
- @row-click="handleDatabaseClick"
+ :show-selection="true"
+ :filter="filter"
+ :parent="project.name"
@update:selected-databases="handleDatabasesSelectionChanged"
/>
</div>
@@ -69,45 +51,47 @@
import { PlusIcon } from "lucide-vue-next";
import { NButton } from "naive-ui";
import { reactive, computed } from "vue";
-import { useRouter } from "vue-router";
import { CreateDatabasePrepPanel } from "@/components/CreateDatabasePrepForm";
import { Drawer } from "@/components/v2";
-import DatabaseV1Table from "@/components/v2/Model/DatabaseV1Table";
+import { PagedDatabaseTable } from "@/components/v2/Model/DatabaseV1Table";
+import { useDatabaseV1Store } from "@/store";
+import {
+ instanceNamePrefix,
+ environmentNamePrefix,
+} from "@/store/modules/v1/common";
import type { ComposedDatabase, ComposedProject } from "@/types";
-import { UNKNOWN_ID } from "@/types";
-import type { SearchParams } from "@/utils";
+import { isValidDatabaseName } from "@/types";
+import type { SearchParams, SearchScope } from "@/utils";
import {
- filterDatabaseV1ByKeyword,
CommonFilterScopeIdList,
- extractEnvironmentResourceName,
- extractInstanceResourceName,
- databaseV1Url,
+ extractProjectResourceName,
hasWorkspacePermissionV2,
} from "@/utils";
import AdvancedSearch from "./AdvancedSearch";
import { useCommonSearchScopeOptions } from "./AdvancedSearch/useCommonSearchScopeOptions";
-import { DatabaseOperations, DatabaseLabelFilter } from "./v2";
+import { DatabaseOperations } from "./v2";
interface LocalState {
selectedDatabaseNames: Set<string>;
- selectedLabels: { key: string; value: string }[];
params: SearchParams;
showCreateDrawer: boolean;
}
const props = defineProps<{
project: ComposedProject;
- databaseList: ComposedDatabase[];
}>();
-const router = useRouter();
+const readonlyScopes = computed((): SearchScope[] => [
+ { id: "project", value: extractProjectResourceName(props.project.name) },
+]);
+
+const databaseStore = useDatabaseV1Store();
const state = reactive<LocalState>({
selectedDatabaseNames: new Set(),
- selectedLabels: [],
params: {
query: "",
- scopes: [],
+ scopes: [...readonlyScopes.value],
},
showCreateDrawer: false,
});
@@ -121,61 +105,46 @@ const allowToCreateDB = computed(() => {
const scopeOptions = useCommonSearchScopeOptions(
computed(() => state.params),
- [...CommonFilterScopeIdList]
+ [...CommonFilterScopeIdList, "label"]
);
const selectedInstance = computed(() => {
- return (
- state.params.scopes.find((scope) => scope.id === "instance")?.value ??
- `${UNKNOWN_ID}`
- );
+ const instanceId = state.params.scopes.find(
+ (scope) => scope.id === "instance"
+ )?.value;
+ if (!instanceId) {
+ return;
+ }
+ return `${instanceNamePrefix}${instanceId}`;
});
const selectedEnvironment = computed(() => {
- return (
- state.params.scopes.find((scope) => scope.id === "environment")?.value ??
- `${UNKNOWN_ID}`
- );
+ const environmentId = state.params.scopes.find(
+ (scope) => scope.id === "environment"
+ )?.value;
+ if (!environmentId) {
+ return;
+ }
+ return `${environmentNamePrefix}${environmentId}`;
});
-const filteredDatabaseList = computed(() => {
- let list = props.databaseList;
- if (selectedEnvironment.value !== `${UNKNOWN_ID}`) {
- list = list.filter(
- (db) =>
- extractEnvironmentResourceName(db.effectiveEnvironment) ===
- selectedEnvironment.value
- );
- }
- if (selectedInstance.value !== `${UNKNOWN_ID}`) {
- list = list.filter(
- (db) =>
- extractInstanceResourceName(db.instance) === selectedInstance.value
- );
- }
- const keyword = state.params.query.trim().toLowerCase();
- if (keyword) {
- list = list.filter((db) =>
- filterDatabaseV1ByKeyword(db, keyword, [
- "name",
- "environment",
- "instance",
- ])
- );
- }
- const labels = state.selectedLabels;
- if (labels.length > 0) {
- list = list.filter((db) => {
- return labels.some((kv) => db.labels[kv.key] === kv.value);
- });
- }
- return list;
+const selectedLabels = computed(() => {
+ return state.params.scopes
+ .filter((scope) => scope.id === "label")
+ .map((scope) => scope.value);
});
+const filter = computed(() => ({
+ instance: selectedInstance.value,
+ environment: selectedEnvironment.value,
+ query: state.params.query,
+ labels: selectedLabels.value,
+}));
+
const selectedDatabases = computed((): ComposedDatabase[] => {
- return filteredDatabaseList.value.filter((db) =>
- state.selectedDatabaseNames.has(db.name)
- );
+ return [...state.selectedDatabaseNames]
+ .map((databaseName) => databaseStore.getDatabaseByName(databaseName))
+ .filter((database) => isValidDatabaseName(database.name));
});
const handleDatabasesSelectionChanged = (
@@ -183,13 +152,4 @@ const handleDatabasesSelectionChanged = (
): void => {
state.selectedDatabaseNames = selectedDatabaseNameList;
};
-
-const handleDatabaseClick = (event: MouseEvent, database: ComposedDatabase) => {
- const url = databaseV1Url(database);
- if (event.ctrlKey || event.metaKey) {
- window.open(url, "_blank");
- } else {
- router.push(url);
- }
-};
</script>
diff --git a/frontend/src/components/ProjectMember/ProjectMemberRolePanel/index.vue b/frontend/src/components/ProjectMember/ProjectMemberRolePanel/index.vue
index d3255e9a61..e61d94c5b4 100644
--- a/frontend/src/components/ProjectMember/ProjectMemberRolePanel/index.vue
+++ b/frontend/src/components/ProjectMember/ProjectMemberRolePanel/index.vue
@@ -226,13 +226,14 @@ import {
useProjectIamPolicyStore,
useUserStore,
pushNotification,
+ batchGetOrFetchDatabases,
} from "@/store";
import { groupNamePrefix } from "@/store/modules/v1/common";
import type { ComposedProject, DatabaseResource } from "@/types";
import { PresetRoleType, PRESET_ROLES } from "@/types";
-import { type User } from "@/types/proto/v1/user_service";
import { State } from "@/types/proto/v1/common";
import { Binding } from "@/types/proto/v1/iam_policy";
+import { type User } from "@/types/proto/v1/user_service";
import { displayRoleTitle, hasProjectPermissionV2 } from "@/utils";
import {
convertFromExpr,
@@ -504,16 +505,6 @@ const handleDeleteCondition = async (singleBinding: SingleBinding) => {
});
};
-const extractDatabaseName = (databaseResource?: DatabaseResource) => {
- if (!databaseResource) {
- return "*";
- }
- const database = databaseStore.getDatabaseByName(
- databaseResource.databaseFullName
- );
- return database.databaseName;
-};
-
const extractDatabase = (databaseResource: DatabaseResource) => {
const database = databaseStore.getDatabaseByName(
databaseResource.databaseFullName
@@ -521,6 +512,14 @@ const extractDatabase = (databaseResource: DatabaseResource) => {
return database;
};
+const extractDatabaseName = (databaseResource?: DatabaseResource) => {
+ if (!databaseResource) {
+ return "*";
+ }
+ const database = extractDatabase(databaseResource);
+ return database.databaseName;
+};
+
const extractSchemaName = (databaseResource?: DatabaseResource) => {
if (!databaseResource) {
return "*";
@@ -589,6 +588,11 @@ watch(
Array.isArray(conditionExpr.databaseResources) &&
conditionExpr.databaseResources.length > 0
) {
+ await batchGetOrFetchDatabases(
+ conditionExpr.databaseResources.map(
+ (resource) => resource.databaseFullName
+ )
+ );
for (const resource of conditionExpr.databaseResources) {
singleBindingList.push({
...singleBinding,
diff --git a/frontend/src/components/ProvideSQLEditorContext.vue b/frontend/src/components/ProvideSQLEditorContext.vue
index 79be276513..a54980210b 100644
--- a/frontend/src/components/ProvideSQLEditorContext.vue
+++ b/frontend/src/components/ProvideSQLEditorContext.vue
@@ -39,7 +39,6 @@ import {
import {
usePolicyV1Store,
useProjectV1Store,
- useCurrentUserV1,
useDatabaseV1Store,
useSQLEditorStore,
useSQLEditorTabStore,
@@ -49,12 +48,10 @@ import {
useAppFeature,
useProjectV1List,
} from "@/store";
-import { useDatabaseV1List } from "@/store/modules/v1/databaseList";
import type { SQLEditorConnection } from "@/types";
import {
DEFAULT_PROJECT_NAME,
DEFAULT_SQL_EDITOR_TAB_MODE,
- UNKNOWN_USER_NAME,
isValidDatabaseName,
isValidInstanceName,
isValidProjectName,
@@ -86,7 +83,6 @@ import {
const { t } = useI18n();
const route = useRoute();
const router = useRouter();
-const me = useCurrentUserV1();
const projectStore = useProjectV1Store();
const databaseStore = useDatabaseV1Store();
const editorStore = useSQLEditorStore();
@@ -189,22 +185,6 @@ const handleProjectSwitched = async () => {
tabStore.maybeInitProject(project);
};
-const prepareDatabases = async () => {
- // It will also be called when user logout
- if (me.value.name === UNKNOWN_USER_NAME) {
- return;
- }
- const { project } = editorStore;
- if (!project) {
- editorStore.databaseList = [];
- return;
- }
- // `databaseList` is the database list in the project.
- const { databaseList, ready } = useDatabaseV1List(project);
- await wrapRefAsPromise(ready, true);
- editorStore.databaseList = databaseList.value;
-};
-
const connect = (connection: SQLEditorConnection) => {
tabStore.selectOrAddSimilarNewTab(
{
@@ -433,7 +413,14 @@ const syncURLWithConnection = () => {
() => connection.value?.schema,
() => connection.value?.table,
],
- ([projectName, sheetName, instanceName, databaseName, schema, table]) => {
+ async ([
+ projectName,
+ sheetName,
+ instanceName,
+ databaseName,
+ schema,
+ table,
+ ]) => {
const query = omit(
route.query,
"filter",
@@ -470,7 +457,8 @@ const syncURLWithConnection = () => {
}
}
if (databaseName) {
- const database = databaseStore.getDatabaseByName(databaseName);
+ const database =
+ await databaseStore.getOrFetchDatabaseByName(databaseName);
if (isValidDatabaseName(database.name)) {
if (schema) {
query.schema = schema;
@@ -550,7 +538,6 @@ onMounted(async () => {
initializeProjects(),
groupStore.fetchGroupList(),
]);
- await prepareDatabases();
tabStore.maybeInitProject(editorStore.project);
editorStore.projectContextReady = true;
nextTick(() => {
@@ -565,7 +552,6 @@ onMounted(async () => {
async () => {
editorStore.projectContextReady = false;
await handleProjectSwitched();
- await prepareDatabases();
tabStore.maybeInitProject(editorStore.project);
editorStore.projectContextReady = true;
nextTick(() => {
diff --git a/frontend/src/components/SensitiveData/MaskingExceptionUserTable.vue b/frontend/src/components/SensitiveData/MaskingExceptionUserTable.vue
index 97ae362732..f26f9980dd 100644
--- a/frontend/src/components/SensitiveData/MaskingExceptionUserTable.vue
+++ b/frontend/src/components/SensitiveData/MaskingExceptionUserTable.vue
@@ -45,7 +45,7 @@ import {
getUserEmailInBinding,
getGroupEmailInBinding,
groupBindingPrefix,
- UNKNOWN_DATABASE_NAME,
+ isValidDatabaseName,
} from "@/types";
import { Expr } from "@/types/proto/google/type/expr";
import { MaskingExceptionPolicy_MaskingException_Action } from "@/types/proto/v1/org_policy_service";
@@ -104,12 +104,12 @@ const filteredList = computed(() =>
const isValidDatabaseResource = (access: AccessUser): boolean => {
if (!access.databaseResource) {
- return true;
+ return false;
}
const database = databaseStore.getDatabaseByName(
access.databaseResource.databaseFullName
);
- return database.name !== UNKNOWN_DATABASE_NAME;
+ return isValidDatabaseName(database.name);
};
const getDatabaseAccessResource = (access: AccessUser): VNodeChild => {
diff --git a/frontend/src/components/SyncDatabaseSchemaV1/TargetDatabasesSelectPanel.vue b/frontend/src/components/SyncDatabaseSchemaV1/TargetDatabasesSelectPanel.vue
index b3385fc31b..7dde926273 100644
--- a/frontend/src/components/SyncDatabaseSchemaV1/TargetDatabasesSelectPanel.vue
+++ b/frontend/src/components/SyncDatabaseSchemaV1/TargetDatabasesSelectPanel.vue
@@ -17,19 +17,20 @@
:autofocus="false"
:placeholder="$t('database.filter-database')"
:scope-options="scopeOptions"
+ :readonly-scopes="readonlyScopes"
/>
- <DatabaseV1Table
+
+ <PagedDatabaseTable
class="mt-2"
mode="PROJECT"
- :database-list="filteredDatabaseList"
- :show-selection="true"
+ :parent="project"
+ :filter="filter"
+ :custom-click="true"
:selected-database-names="state.selectedDatabaseNameList"
- :keyword="state.params.query.trim().toLowerCase()"
@update:selected-databases="
state.selectedDatabaseNameList = Array.from($event)
"
/>
- <MaskSpinner v-if="loading || !ready" />
<template #footer>
<div class="flex-1 flex items-center justify-between">
@@ -72,20 +73,16 @@ import { NButton, NTooltip } from "naive-ui";
import { computed, reactive } from "vue";
import { Drawer, DrawerContent } from "@/components/v2";
import { useDatabaseV1Store } from "@/store";
-import { useDatabaseV1List } from "@/store/modules/v1/databaseList";
-import { UNKNOWN_ID } from "@/types";
-import type { Engine } from "@/types/proto/v1/common";
import {
- CommonFilterScopeIdList,
- extractEnvironmentResourceName,
- extractInstanceResourceName,
- filterDatabaseV1ByKeyword,
- type SearchParams,
-} from "@/utils";
+ instanceNamePrefix,
+ environmentNamePrefix,
+} from "@/store/modules/v1/common";
+import type { Engine } from "@/types/proto/v1/common";
+import { CommonFilterScopeIdList, extractProjectResourceName } from "@/utils";
+import type { SearchParams, SearchScope } from "@/utils";
import AdvancedSearch from "../AdvancedSearch";
import { useCommonSearchScopeOptions } from "../AdvancedSearch/useCommonSearchScopeOptions";
-import MaskSpinner from "../misc/MaskSpinner.vue";
-import DatabaseV1Table from "../v2/Model/DatabaseV1Table";
+import { PagedDatabaseTable } from "../v2/Model/DatabaseV1Table";
type LocalState = {
selectedDatabaseNameList: string[];
@@ -99,22 +96,25 @@ const props = defineProps<{
loading?: boolean;
}>();
+const readonlyScopes = computed((): SearchScope[] => [
+ { id: "project", value: extractProjectResourceName(props.project) },
+]);
+
const emit = defineEmits<{
(event: "close"): void;
(event: "update", databaseNameList: string[]): void;
}>();
const databaseStore = useDatabaseV1Store();
+
const state = reactive<LocalState>({
selectedDatabaseNameList: props.selectedDatabaseNameList || [],
params: {
query: "",
- scopes: [],
+ scopes: [...readonlyScopes.value],
},
});
-const { databaseList, ready } = useDatabaseV1List(props.project);
-
const scopeOptions = useCommonSearchScopeOptions(
computed(() => state.params),
[...CommonFilterScopeIdList]
@@ -127,49 +127,31 @@ const selectedDatabaseList = computed(() =>
);
const selectedInstance = computed(() => {
- return (
- state.params.scopes.find((scope) => scope.id === "instance")?.value ??
- `${UNKNOWN_ID}`
- );
+ const instanceId = state.params.scopes.find(
+ (scope) => scope.id === "instance"
+ )?.value;
+ if (!instanceId) {
+ return;
+ }
+ return `${instanceNamePrefix}${instanceId}`;
});
const selectedEnvironment = computed(() => {
- return (
- state.params.scopes.find((scope) => scope.id === "environment")?.value ??
- `${UNKNOWN_ID}`
- );
-});
-
-const filteredDatabaseList = computed(() => {
- let list = databaseList.value.filter(
- (db) => db.instanceResource.engine === props.engine
- );
- if (selectedEnvironment.value !== `${UNKNOWN_ID}`) {
- list = list.filter(
- (db) =>
- extractEnvironmentResourceName(db.effectiveEnvironment) ===
- selectedEnvironment.value
- );
+ const environmentId = state.params.scopes.find(
+ (scope) => scope.id === "environment"
+ )?.value;
+ if (!environmentId) {
+ return;
}
- if (selectedInstance.value !== `${UNKNOWN_ID}`) {
- list = list.filter(
- (db) =>
- extractInstanceResourceName(db.instance) === selectedInstance.value
- );
- }
- const keyword = state.params.query.trim().toLowerCase();
- if (keyword) {
- list = list.filter((db) =>
- filterDatabaseV1ByKeyword(db, keyword, [
- "name",
- "environment",
- "instance",
- ])
- );
- }
- return list;
+ return `${environmentNamePrefix}${environmentId}`;
});
+const filter = computed(() => ({
+ instance: selectedInstance.value,
+ environment: selectedEnvironment.value,
+ query: state.params.query,
+}));
+
const handleConfirm = async () => {
emit("update", state.selectedDatabaseNameList);
};
diff --git a/frontend/src/components/TransferDatabaseForm/TransferDatabaseForm.vue b/frontend/src/components/TransferDatabaseForm/TransferDatabaseForm.vue
index 05bdeadecb..e037146c25 100644
--- a/frontend/src/components/TransferDatabaseForm/TransferDatabaseForm.vue
+++ b/frontend/src/components/TransferDatabaseForm/TransferDatabaseForm.vue
@@ -7,7 +7,6 @@
<TransferSourceSelector
v-model:transfer-source="state.transferSource"
:project="project"
- :raw-database-list="rawDatabaseList"
:environment-filter="state.environmentFilter"
:instance-filter="state.instanceFilter"
:search-text="state.searchText"
@@ -30,27 +29,18 @@
>
<!-- Empty -->
</template>
- <template v-else>
- <div class="w-full relative">
- <div
- v-if="state.loading"
- class="absolute inset-0 z-10 bg-white/70 flex items-center justify-center"
- >
- <BBSpin />
- </div>
- <template v-else>
- <DatabaseV1Table
- mode="PROJECT"
- :database-list="filteredDatabaseList"
- :show-selection="true"
- :selected-database-names="state.selectedDatabaseNameList"
- @update:selected-databases="
- state.selectedDatabaseNameList = Array.from($event)
- "
- />
- </template>
- </div>
- </template>
+ <div v-else class="w-full relative">
+ <PagedDatabaseTable
+ mode="PROJECT"
+ :parent="databaseParent"
+ :filter="filter"
+ :show-selection="true"
+ :custom-click="true"
+ @update:selected-databases="
+ state.selectedDatabaseNameList = Array.from($event)
+ "
+ />
+ </div>
</div>
</div>
@@ -95,13 +85,11 @@
import { NButton, NTooltip } from "naive-ui";
import { computed, reactive, watchEffect } from "vue";
import { toRef } from "vue";
-import { BBSpin } from "@/bbkit";
import {
pushNotification,
useDatabaseV1Store,
useProjectByName,
} from "@/store";
-import { useDatabaseV1List } from "@/store/modules/v1/databaseList";
import type { ComposedDatabase, ComposedProject } from "@/types";
import {
DEFAULT_PROJECT_NAME,
@@ -110,14 +98,9 @@ import {
} from "@/types";
import type { Environment } from "@/types/proto/v1/environment_service";
import type { InstanceResource } from "@/types/proto/v1/instance_service";
-import {
- filterDatabaseV1ByKeyword,
- hasProjectPermissionV2,
- sortDatabaseV1List,
- wrapRefAsPromise,
-} from "@/utils";
+import { hasProjectPermissionV2 } from "@/utils";
import { DrawerContent, ProjectSelect } from "../v2";
-import DatabaseV1Table from "../v2/Model/DatabaseV1Table/DatabaseV1Table.vue";
+import { PagedDatabaseTable } from "../v2/Model/DatabaseV1Table";
import TransferSourceSelector from "./TransferSourceSelector.vue";
import type { TransferSource } from "./utils";
@@ -153,68 +136,21 @@ const state = reactive<LocalState>({
});
const { project } = useProjectByName(toRef(props, "projectName"));
-watchEffect(async () => {
- if (state.transferSource === "OTHER" && !state.fromProjectName) {
- return;
+const databaseParent = computed(() => {
+ if (state.transferSource === "DEFAULT") {
+ return DEFAULT_PROJECT_NAME;
}
-
- let fetchingProject = DEFAULT_PROJECT_NAME;
if (state.fromProjectName) {
- fetchingProject = state.fromProjectName;
- }
- state.loading = true;
- await wrapRefAsPromise(useDatabaseV1List(fetchingProject).ready, true);
- state.loading = false;
-});
-
-const rawDatabaseList = computed(() => {
- if (state.transferSource === "DEFAULT") {
- return databaseStore.databaseListByProject(DEFAULT_PROJECT_NAME);
- } else {
- return databaseStore.databaseList.filter((db) => {
- return (
- db.project !== props.projectName &&
- db.project !== DEFAULT_PROJECT_NAME &&
- hasTransferDatabasePermission(db.projectEntity)
- );
- });
+ return state.fromProjectName;
}
+ return DEFAULT_PROJECT_NAME;
});
-const filteredDatabaseList = computed(() => {
- let list = [...rawDatabaseList.value];
- const keyword = state.searchText.trim();
- list = list.filter((db) =>
- filterDatabaseV1ByKeyword(db, keyword, [
- "name",
- "project",
- "instance",
- "environment",
- ])
- );
-
- list = list.filter((db) => {
- const environment = state.environmentFilter;
- if (environment && db.effectiveEnvironment !== environment.name) {
- return false;
- }
- const instance = state.instanceFilter;
- if (instance && db.instance !== instance.name) {
- return false;
- }
-
- // Other uses project filter
- if (state.transferSource === "OTHER") {
- if (state.fromProjectName && db.project !== state.fromProjectName) {
- return false;
- }
- }
-
- return true;
- });
-
- return sortDatabaseV1List(list);
-});
+const filter = computed(() => ({
+ instance: state.instanceFilter?.name,
+ environment: state.environmentFilter?.name,
+ query: state.searchText,
+}));
const allowTransfer = computed(() => state.selectedDatabaseNameList.length > 0);
@@ -259,7 +195,7 @@ const transferDatabase = async () => {
try {
state.loading = true;
- const updated = await useDatabaseV1Store().transferDatabases(
+ const updated = await databaseStore.transferDatabases(
selectedDatabaseList.value,
props.projectName
);
diff --git a/frontend/src/components/TransferDatabaseForm/TransferSourceSelector.vue b/frontend/src/components/TransferDatabaseForm/TransferSourceSelector.vue
index 5753ec98ed..e2aefe5982 100644
--- a/frontend/src/components/TransferDatabaseForm/TransferSourceSelector.vue
+++ b/frontend/src/components/TransferDatabaseForm/TransferSourceSelector.vue
@@ -22,13 +22,11 @@
<EnvironmentSelect
class="!w-40"
:environment-name="environmentFilter?.name"
- :filter="filterEnvironment"
@update:environment-name="changeEnvironmentFilter"
/>
<InstanceSelect
class="!w-40"
:instance="instanceFilter?.name"
- :filter="filterInstance"
@update:instance-name="changeInstanceFilter"
/>
<SearchBox
@@ -47,10 +45,8 @@
<script lang="ts" setup>
import { NInputGroup, NRadio, NRadioGroup } from "naive-ui";
-import { computed } from "vue";
import { InstanceSelect, SearchBox } from "@/components/v2";
import { useEnvironmentV1Store, useInstanceResourceByName } from "@/store";
-import type { ComposedDatabase } from "@/types";
import {
DEFAULT_PROJECT_NAME,
isValidEnvironmentName,
@@ -62,10 +58,9 @@ import type { Project } from "@/types/proto/v1/project_service";
import EnvironmentSelect from "../v2/Select/EnvironmentSelect.vue";
import type { TransferSource } from "./utils";
-const props = withDefaults(
+withDefaults(
defineProps<{
project: Project;
- rawDatabaseList?: ComposedDatabase[];
transferSource: TransferSource;
hasPermissionForDefaultProject: boolean;
instanceFilter?: InstanceResource;
@@ -73,7 +68,6 @@ const props = withDefaults(
searchText: string;
}>(),
{
- rawDatabaseList: () => [],
instanceFilter: undefined,
environmentFilter: undefined,
searchText: "",
@@ -87,14 +81,6 @@ const emit = defineEmits<{
(event: "search-text-change", searchText: string): void;
}>();
-const nonEmptyEnvironmentNameSet = computed(() => {
- return new Set(props.rawDatabaseList.map((db) => db.effectiveEnvironment));
-});
-
-const nonEmptyInstanceNameSet = computed(() => {
- return new Set(props.rawDatabaseList.map((db) => db.instance));
-});
-
const changeEnvironmentFilter = (name: string | undefined) => {
if (!isValidEnvironmentName(name)) {
return emit("select-environment", undefined);
@@ -111,12 +97,4 @@ const changeInstanceFilter = (name: string | undefined) => {
}
emit("select-instance", useInstanceResourceByName(name));
};
-
-const filterEnvironment = (environment: Environment) => {
- return nonEmptyEnvironmentNameSet.value.has(environment.name);
-};
-
-const filterInstance = (instance: InstanceResource) => {
- return nonEmptyInstanceNameSet.value.has(instance.name);
-};
</script>
diff --git a/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseLabelFilter.vue b/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseLabelFilter.vue
deleted file mode 100644
index 84a87581dd..0000000000
--- a/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseLabelFilter.vue
+++ /dev/null
@@ -1,142 +0,0 @@
-<template>
- <NCascader
- class="bb-database-label-filter"
- :value="cascaderValues"
- :options="options"
- :placeholder="$t('label.filter-by-label')"
- :render-label="renderLabel"
- :placement="placement"
- :multiple="true"
- :show-path="true"
- :check-strategy="'child'"
- :max-tag-count="'responsive'"
- :expand-trigger="'click'"
- :virtual-scroll="true"
- :filterable="true"
- :menu-props="{
- style: '--n-column-width: max-content',
- }"
- :separator="':'"
- style="width: 12rem"
- @update:value="updateCascaderValues"
- />
-</template>
-
-<script setup lang="ts">
-import { orderBy, uniqBy } from "lodash-es";
-import type { CascaderOption } from "naive-ui";
-import { NCascader } from "naive-ui";
-import { computed, h } from "vue";
-import { useI18n } from "vue-i18n";
-import type { ComposedDatabase } from "@/types";
-import { groupBy } from "@/utils";
-
-type KV = { key: string; value: string };
-type KeyOption = CascaderOption & {
- type: "key";
- key: string;
- value: string;
-};
-type KeyValueOption = CascaderOption & {
- type: "kv";
- kv: KV;
- value: string;
-};
-
-const props = withDefaults(
- defineProps<{
- selected: KV[];
- databaseList: ComposedDatabase[];
- placement?: "bottom-start" | "left-start";
- }>(),
- {
- placement: "bottom-start",
- }
-);
-
-const emit = defineEmits<{
- (event: "update:selected", selected: KV[]): void;
-}>();
-
-const { t } = useI18n();
-
-const cascaderValueOfKV = (kv: KV) => {
- return JSON.stringify(kv);
-};
-const distinctKVList = computed(() => {
- const list = props.databaseList.flatMap((db) => {
- return Object.keys(db.labels).map<KV>((key) => ({
- key,
- value: db.labels[key],
- }));
- });
- const distinctList = uniqBy(list, (kv) => `${kv.key}:${kv.value}`);
- const sortedList = orderBy(
- distinctList,
- [
- (kv) => kv.key, // by key ASC
- (kv) => (kv.value ? -1 : 1), // then put empty values at last
- (kv) => kv.value, // then by value ASC
- ],
- ["asc", "asc", "asc"]
- );
- return sortedList;
-});
-const options = computed(() => {
- const groups = groupBy(distinctKVList.value, (kv) => kv.key);
- return Array.from(groups.entries()).map<KeyOption>(([key, group]) => {
- const children = group.map<KeyValueOption>((kv) => ({
- type: "kv",
- kv,
- value: cascaderValueOfKV(kv),
- label: kv.value || t("label.empty-label-value"),
- }));
- return {
- type: "key",
- key,
- value: key,
- label: key,
- children,
- };
- });
-});
-const renderLabel = (cascaderOption: CascaderOption) => {
- const option = cascaderOption as KeyOption | KeyValueOption;
- if (option.type === "key") {
- const { key } = option;
- return key;
- }
- if (option.type === "kv") {
- const { kv } = option;
- if (!kv.value) {
- return h(
- "span",
- {
- class: "text-control-placeholder",
- },
- t("label.empty-label-value")
- );
- }
- return kv.value;
- }
- console.error("should never reach this line", option);
- return "";
-};
-
-const cascaderValues = computed(() => {
- return props.selected.map(cascaderValueOfKV);
-});
-
-const updateCascaderValues = (
- values: string[],
- options: (KeyOption | KeyValueOption)[]
-) => {
- const kvOptions = options.filter(
- (opt) => opt.type === "kv"
- ) as KeyValueOption[];
- emit(
- "update:selected",
- kvOptions.map((opt) => opt.kv)
- );
-};
-</script>
diff --git a/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseV1Table.vue b/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseV1Table.vue
index aaa8ac7386..ccae4035bd 100644
--- a/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseV1Table.vue
+++ b/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseV1Table.vue
@@ -3,18 +3,16 @@
key="database-table"
size="small"
:columns="columnList"
- :data="data"
+ :data="databaseList"
:striped="true"
:bordered="bordered"
:loading="loading"
:row-key="(data: ComposedDatabase) => data.name"
:checked-row-keys="Array.from(state.selectedDatabaseNameList)"
:row-props="rowProps"
- :pagination="{ pageSize: 60 }"
- :paginate-single-page="false"
@update:checked-row-keys="
- (val) => (state.selectedDatabaseNameList = new Set(val as string[]))
- "
+ (val) => (state.selectedDatabaseNameList = new Set(val as string[]))
+ "
/>
</template>
@@ -184,10 +182,6 @@ const columnList = computed((): DatabaseDataTableColumn[] => {
);
});
-const data = computed(() => {
- return [...props.databaseList];
-});
-
const rowProps = (database: ComposedDatabase) => {
return {
style: props.rowClickable ? "cursor: pointer;" : "",
diff --git a/frontend/src/components/v2/Model/DatabaseV1Table/PagedDatabaseTable.vue b/frontend/src/components/v2/Model/DatabaseV1Table/PagedDatabaseTable.vue
new file mode 100644
index 0000000000..bf60fd0870
--- /dev/null
+++ b/frontend/src/components/v2/Model/DatabaseV1Table/PagedDatabaseTable.vue
@@ -0,0 +1,170 @@
+<template>
+ <PagedTable
+ ref="databasePagedTable"
+ :session-key="`bb.databases-table.${parent}`"
+ :fetch-list="fetchDatabses"
+ :class="customClass"
+ :footer-class="footerClass"
+ >
+ <template #table="{ list, loading }">
+ <DatabaseV1Table
+ v-bind="$attrs"
+ :key="`database-table.${parent}`"
+ :loading="loading"
+ :database-list="list"
+ :keyword="keyword"
+ :custom-click="true"
+ @row-click="handleDatabaseClick"
+ @update:selected-databases="$emit('update:selected-databases', $event)"
+ />
+ </template>
+ </PagedTable>
+</template>
+
+<script setup lang="tsx">
+import { useDebounceFn } from "@vueuse/core";
+import { ref, watch, computed } from "vue";
+import type { ComponentExposed } from "vue-component-type-helpers";
+import { useRouter } from "vue-router";
+import PagedTable from "@/components/v2/Model/PagedTable.vue";
+import { useDatabaseV1Store } from "@/store";
+import type { ComposedDatabase } from "@/types";
+import { Engine } from "@/types/proto/v1/common";
+import { autoDatabaseRoute } from "@/utils";
+import DatabaseV1Table from "./DatabaseV1Table.vue";
+
+interface DatabaseFilter {
+ project?: string;
+ instance?: string;
+ environment?: string;
+ query?: string;
+ showDeleted?: boolean;
+ excludeUnassigned?: boolean;
+ // label should be "{label key}:{label value}" format
+ labels?: string[];
+ engines?: Engine[];
+ excludeEngines?: Engine[];
+}
+
+const props = withDefaults(
+ defineProps<{
+ filter?: DatabaseFilter;
+ parent: string;
+ customClass?: string;
+ footerClass?: string;
+ customClick?: boolean;
+ }>(),
+ {
+ customClass: "",
+ footerClass: "",
+ customClick: false,
+ }
+);
+
+const emit = defineEmits<{
+ (event: "row-click", e: MouseEvent, val: ComposedDatabase): void;
+ (event: "update:selected-databases", val: Set<string>): void;
+}>();
+
+const databaseStore = useDatabaseV1Store();
+const router = useRouter();
+
+const databasePagedTable =
+ ref<ComponentExposed<typeof PagedTable<ComposedDatabase>>>();
+
+const keyword = computed(() => {
+ return props.filter?.query?.trim()?.toLowerCase();
+});
+
+const filter = computed(() => {
+ const params: string[] = [];
+ if (props.filter?.project) {
+ params.push(`project == "${props.filter?.project}"`);
+ }
+ if (props.filter?.instance) {
+ params.push(`instance == "${props.filter?.instance}"`);
+ }
+ if (props.filter?.environment) {
+ params.push(`environment == "${props.filter?.environment}"`);
+ }
+ if (props.filter?.excludeUnassigned) {
+ params.push(`exclude_unassigned == true`);
+ }
+ if (props.filter?.engines) {
+ // engine filter should be:
+ // engine in ["MYSQL", "POSTGRES"]
+ params.push(
+ `engine in [${props.filter?.engines.map((e) => `"${e}"`).join(", ")}]`
+ );
+ } else if (props.filter?.excludeEngines) {
+ // engine filter should be:
+ // !(engine in ["REDIS", "MONGODB"])
+ params.push(
+ `!(engine in [${props.filter?.excludeEngines.map((e) => `"${e}"`).join(", ")}])`
+ );
+ }
+ if (keyword.value) {
+ params.push(`name.matches("${keyword.value}")`);
+ }
+ if (props.filter?.labels) {
+ // label filter like:
+ // label == "region:asia,europe" && label == "tenant:bytebase"
+ const labelMap = new Map<string, Set<string>>();
+ for (const label of props.filter.labels) {
+ const sections = label.split(":");
+ if (sections.length !== 2) {
+ continue;
+ }
+ if (!labelMap.has(sections[0])) {
+ labelMap.set(sections[0], new Set());
+ }
+ labelMap.get(sections[0])!.add(sections[1]);
+ }
+ for (const [labelKey, labelValues] of labelMap.entries()) {
+ params.push(`label == "${labelKey}:${[...labelValues].join(",")}"`);
+ }
+ }
+
+ return params.join(" && ");
+});
+
+const fetchDatabses = async ({
+ pageToken,
+ pageSize,
+}: {
+ pageToken: string;
+ pageSize: number;
+}) => {
+ const { nextPageToken, databases } = await databaseStore.fetchDatabases({
+ pageToken,
+ pageSize,
+ filter: filter.value,
+ parent: props.parent,
+ showDeleted: props.filter?.showDeleted,
+ });
+ return {
+ nextPageToken,
+ list: databases,
+ };
+};
+
+watch(
+ () => [filter.value, props.parent],
+ useDebounceFn(async () => {
+ await databasePagedTable.value?.refresh();
+ }, 500)
+);
+
+const handleDatabaseClick = (event: MouseEvent, database: ComposedDatabase) => {
+ if (props.customClick) {
+ emit("row-click", event, database);
+ } else {
+ const url = router.resolve(autoDatabaseRoute(router, database)).fullPath;
+ if (event.ctrlKey || event.metaKey) {
+ window.open(url, "_blank");
+ } else {
+ router.push(url);
+ }
+ }
+};
+</script>
diff --git a/frontend/src/components/v2/Model/DatabaseV1Table/index.ts b/frontend/src/components/v2/Model/DatabaseV1Table/index.ts
index e3a80de672..d5ab219877 100644
--- a/frontend/src/components/v2/Model/DatabaseV1Table/index.ts
+++ b/frontend/src/components/v2/Model/DatabaseV1Table/index.ts
@@ -1,7 +1,5 @@
-import DatabaseLabelFilter from "./DatabaseLabelFilter.vue";
import DatabaseOperations from "./DatabaseOperations.vue";
import DatabaseV1Table from "./DatabaseV1Table.vue";
+import PagedDatabaseTable from "./PagedDatabaseTable.vue";
-export { DatabaseOperations, DatabaseLabelFilter };
-
-export default DatabaseV1Table;
+export { DatabaseOperations, PagedDatabaseTable, DatabaseV1Table };
diff --git a/frontend/src/components/v2/Model/PagedProjectTable.vue b/frontend/src/components/v2/Model/PagedProjectTable.vue
new file mode 100644
index 0000000000..39675d1c4a
--- /dev/null
+++ b/frontend/src/components/v2/Model/PagedProjectTable.vue
@@ -0,0 +1,63 @@
+<template>
+ <PagedTable
+ ref="projectPagedTable"
+ :session-key="sessionKey"
+ :fetch-list="fetchProjects"
+ >
+ <template #table="{ list, loading }">
+ <ProjectV1Table v-bind="$attrs" :loading="loading" :project-list="list" />
+ </template>
+ </PagedTable>
+</template>
+
+<script lang="tsx" setup>
+import { useDebounceFn } from "@vueuse/core";
+import { ref, watch } from "vue";
+import type { ComponentExposed } from "vue-component-type-helpers";
+import PagedTable from "@/components/v2/Model/PagedTable.vue";
+import { useProjectV1Store } from "@/store";
+import { DEFAULT_PROJECT_NAME, type ComposedProject } from "@/types";
+import ProjectV1Table from "./ProjectV1Table.vue";
+
+const props = defineProps<{
+ search: string;
+ sessionKey: string;
+ includeDefault: boolean;
+}>();
+
+const projectStore = useProjectV1Store();
+
+const projectPagedTable =
+ ref<ComponentExposed<typeof PagedTable<ComposedProject>>>();
+
+const fetchProjects = async ({
+ pageToken,
+ pageSize,
+}: {
+ pageToken: string;
+ pageSize: number;
+}) => {
+ const { nextPageToken, projects } = await projectStore.fetchProjectList({
+ showDeleted: false,
+ pageToken,
+ pageSize,
+ query: props.search,
+ });
+ return {
+ nextPageToken: nextPageToken ?? "",
+ list: projects.filter((project) => {
+ if (!props.includeDefault && project.name === DEFAULT_PROJECT_NAME) {
+ return false;
+ }
+ return true;
+ }),
+ };
+};
+
+watch(
+ () => props.search,
+ useDebounceFn(async () => {
+ await projectPagedTable.value?.refresh();
+ }, 500)
+);
+</script>
diff --git a/frontend/src/components/v2/Model/PagedTable.vue b/frontend/src/components/v2/Model/PagedTable.vue
index 10be476354..3f7d5fed20 100644
--- a/frontend/src/components/v2/Model/PagedTable.vue
+++ b/frontend/src/components/v2/Model/PagedTable.vue
@@ -74,7 +74,7 @@ const emit = defineEmits<{
}>();
const options = computed(() => {
- return [50, 100, 200, 500, 1000].map((num) => ({
+ return [50, 100, 200, 500].map((num) => ({
value: num,
label: `${num}`,
}));
@@ -101,7 +101,11 @@ const sessionState = useDynamicLocalStorage<SessionState>(
const isLoggedIn = useIsLoggedIn();
const pageSize = computed(() => {
- return Math.max(options.value[0].value, sessionState.value.pageSize ?? 0);
+ const sizeInSession = sessionState.value.pageSize ?? 0;
+ if (!options.value.find((o) => o.value === sizeInSession)) {
+ return options.value[0].value;
+ }
+ return Math.max(options.value[0].value, sizeInSession);
});
const onPageSizeChange = (size: number) => {
diff --git a/frontend/src/components/v2/Model/index.ts b/frontend/src/components/v2/Model/index.ts
index 7d6cb92584..853dfff25e 100644
--- a/frontend/src/components/v2/Model/index.ts
+++ b/frontend/src/components/v2/Model/index.ts
@@ -2,6 +2,7 @@ import DatabaseV1Name from "./DatabaseV1Name.vue";
import DatabaseView from "./DatabaseView.vue";
import EnvironmentV1Name from "./EnvironmentV1Name.vue";
import EnvironmentV1Table from "./EnvironmentV1Table.vue";
+import PagedProjectTable from "./PagedProjectTable.vue";
import ProductionEnvironmentV1Icon from "./ProductionEnvironmentV1Icon.vue";
import ProjectV1Name from "./ProjectV1Name.vue";
import ProjectV1Table from "./ProjectV1Table.vue";
@@ -18,5 +19,6 @@ export {
ProductionEnvironmentV1Icon,
ProjectV1Name,
ProjectV1Table,
+ PagedProjectTable,
DatabaseView,
};
diff --git a/frontend/src/components/v2/Select/DatabaseSelect.vue b/frontend/src/components/v2/Select/DatabaseSelect.vue
index f3d04bc68a..1634b9ccdb 100644
--- a/frontend/src/components/v2/Select/DatabaseSelect.vue
+++ b/frontend/src/components/v2/Select/DatabaseSelect.vue
@@ -2,22 +2,25 @@
<ResourceSelect
v-bind="$attrs"
class="bb-database-select"
+ :remote="true"
+ :loading="state.loading"
:placeholder="$t('database.select')"
:multiple="multiple"
:value="databaseName"
:values="databaseNames"
:options="options"
:custom-label="renderLabel"
+ @search="handleSearch"
@update:value="(val) => $emit('update:database-name', val)"
@update:values="(val) => $emit('update:database-names', val)"
/>
</template>
<script lang="ts" setup>
-import { computed, h, watch } from "vue";
+import { useDebounceFn } from "@vueuse/core";
+import { computed, h, watch, reactive, watchEffect } from "vue";
import { useI18n } from "vue-i18n";
import { useDatabaseV1Store } from "@/store";
-import { useDatabaseV1List } from "@/store/modules/v1/databaseList";
import type { ComposedDatabase } from "@/types";
import {
isValidDatabaseName,
@@ -31,6 +34,11 @@ import { instanceV1Name, supportedEngineV1List } from "@/utils";
import { InstanceV1EngineIcon } from "../Model";
import ResourceSelect from "./ResourceSelect.vue";
+interface LocalState {
+ loading: boolean;
+ rawDatabaseList: ComposedDatabase[];
+}
+
const props = withDefaults(
defineProps<{
databaseName?: string; // UNKNOWN_DATABASE_NAME stands for "ALL"
@@ -44,6 +52,7 @@ const props = withDefaults(
filter?: (database: ComposedDatabase, index: number) => boolean;
multiple?: boolean;
clearable?: boolean;
+ defaultSelectFirst?: boolean;
}>(),
{
databaseName: undefined,
@@ -57,6 +66,7 @@ const props = withDefaults(
filter: undefined,
multiple: false,
clearable: false,
+ defaultSelectFirst: false,
}
);
@@ -66,54 +76,79 @@ const emit = defineEmits<{
}>();
const { t } = useI18n();
-const { ready } = useDatabaseV1List(props.projectName || props.instanceName);
+const databaseStore = useDatabaseV1Store();
-const rawDatabaseList = computed(() => {
- const list = useDatabaseV1Store().databaseListByUser;
+const state = reactive<LocalState>({
+ loading: true,
+ rawDatabaseList: [],
+});
- return list.filter((db) => {
- if (
- isValidEnvironmentName(props.environmentName) &&
- db.effectiveEnvironment !== props.environmentName
- ) {
- return false;
- }
- if (
- isValidInstanceName(props.instanceName) &&
- props.instanceName !== db.instance
- ) {
- return false;
- }
- if (
- isValidProjectName(props.projectName) &&
- db.project !== props.projectName
- ) {
- return false;
- }
- if (!props.allowedEngineTypeList.includes(db.instanceResource.engine)) {
- return false;
- }
+const filterParams = computed(() => {
+ const list = [];
+ if (isValidEnvironmentName(props.environmentName)) {
+ list.push(`environment == "${props.environmentName}"`);
+ }
+ if (isValidInstanceName(props.instanceName)) {
+ list.push(`instance == "${props.instanceName}"`);
+ }
+ if (isValidProjectName(props.projectName)) {
+ list.push(`project == "${props.projectName}"`);
+ }
+ if (props.allowedEngineTypeList.length > 0) {
+ list.push(
+ `engine in [${props.allowedEngineTypeList.map((e) => `"${e}"`).join(", ")}]`
+ );
+ }
- return true;
- });
+ return list;
});
-const combinedDatabaseList = computed(() => {
- let list = [...rawDatabaseList.value];
+const searchDatabases = async (name: string) => {
+ const dbFilter = [...filterParams.value];
+ if (name) {
+ dbFilter.push(`name.matches("${name}")`);
+ }
+ const { databases } = await databaseStore.fetchDatabases({
+ parent: "workspaces/-",
+ filter: dbFilter.join(" && "),
+ pageSize: 100,
+ });
+ return databases;
+};
- if (props.filter) {
- list = list.filter(props.filter);
+const handleSearch = useDebounceFn(async (search: string) => {
+ state.loading = true;
+ try {
+ const databases = await searchDatabases(search);
+ state.rawDatabaseList = databases;
+ if (!search && props.includeAll) {
+ const dummyAll = {
+ ...unknownDatabase(),
+ databaseName: t("database.all"),
+ };
+ state.rawDatabaseList.unshift(dummyAll);
+ }
+ } finally {
+ state.loading = false;
}
+}, 500);
- if (props.includeAll) {
- const dummyAll = {
- ...unknownDatabase(),
- databaseName: t("database.all"),
- };
- list.unshift(dummyAll);
+watch(
+ () => filterParams.value,
+ () => {
+ handleSearch("");
+ },
+ {
+ immediate: true,
}
+);
- return list;
+const combinedDatabaseList = computed(() => {
+ if (props.filter) {
+ return state.rawDatabaseList.filter(props.filter);
+ }
+
+ return state.rawDatabaseList;
});
const options = computed(() => {
@@ -126,6 +161,17 @@ const options = computed(() => {
});
});
+watchEffect(() => {
+ if (!props.defaultSelectFirst || props.multiple) {
+ return;
+ }
+ if (options.value.length === 0) {
+ return;
+ }
+
+ emit("update:database-name", options.value[0].value);
+});
+
const renderLabel = (database: ComposedDatabase) => {
const children = [h("div", {}, [database.databaseName])];
if (isValidDatabaseName(database.name)) {
@@ -162,7 +208,7 @@ const renderLabel = (database: ComposedDatabase) => {
const resetInvalidSelection = () => {
if (!props.autoReset) return;
if (
- ready.value &&
+ !state.loading &&
props.databaseName &&
!combinedDatabaseList.value.find((item) => item.name === props.databaseName)
) {
@@ -170,14 +216,8 @@ const resetInvalidSelection = () => {
}
};
-watch(
- [
- () => [props.projectName, props.environmentName, props.databaseName],
- combinedDatabaseList,
- ],
- resetInvalidSelection,
- {
- immediate: true,
- }
-);
+watch(() => combinedDatabaseList.value, resetInvalidSelection, {
+ immediate: true,
+ deep: true,
+});
</script>
diff --git a/frontend/src/components/v2/Select/ProjectSelect.vue b/frontend/src/components/v2/Select/ProjectSelect.vue
index 64ff3c70d4..a74d077ff7 100644
--- a/frontend/src/components/v2/Select/ProjectSelect.vue
+++ b/frontend/src/components/v2/Select/ProjectSelect.vue
@@ -24,14 +24,10 @@
<script lang="tsx" setup>
import { useDebounceFn } from "@vueuse/core";
import { intersection } from "lodash-es";
-import { computed, watchEffect, watch, reactive } from "vue";
+import { computed, watchEffect, reactive, onMounted } from "vue";
import { useI18n } from "vue-i18n";
import { ProjectNameCell } from "@/components/v2/Model/DatabaseV1Table/cells";
-import {
- useProjectV1List,
- useProjectV1Store,
- usePermissionStore,
-} from "@/store";
+import { useProjectV1Store, usePermissionStore } from "@/store";
import type { ComposedProject } from "@/types";
import {
unknownProject,
@@ -90,56 +86,45 @@ const state = reactive<LocalState>({
loading: true,
rawProjectList: [],
});
-const { projectList, ready } = useProjectV1List(true /* showDeleted */);
-
-watch(
- () => ready.value,
- () => {
- state.loading = !ready.value;
- if (!ready.value) {
- return;
- }
- state.rawProjectList = [...projectList.value];
- if (
- props.projectName &&
- props.projectName !== DEFAULT_PROJECT_NAME &&
- props.projectName !== UNKNOWN_PROJECT_NAME &&
- isOrphanValue.value
- ) {
- // It may happen the selected id might not be in the project list.
- // e.g. the selected project is deleted after the selection and we
- // are unable to cleanup properly. In such case, the selected project id
- // is orphaned and we just display the id
- const dummyProject = {
- ...unknownProject(),
- name: props.projectName,
- title: extractProjectResourceName(props.projectName),
- };
- state.rawProjectList.unshift(dummyProject);
- }
+const initProjectList = () => {
+ if (
+ props.projectName &&
+ props.projectName !== DEFAULT_PROJECT_NAME &&
+ props.projectName !== UNKNOWN_PROJECT_NAME &&
+ isOrphanValue.value
+ ) {
+ // It may happen the selected id might not be in the project list.
+ // e.g. the selected project is deleted after the selection and we
+ // are unable to cleanup properly. In such case, the selected project id
+ // is orphaned and we just display the id
+ const dummyProject = {
+ ...unknownProject(),
+ name: props.projectName,
+ title: extractProjectResourceName(props.projectName),
+ };
+ state.rawProjectList.unshift(dummyProject);
+ }
+ if (
+ props.projectName === DEFAULT_PROJECT_NAME ||
+ props.includeDefaultProject
+ ) {
if (
- props.projectName === DEFAULT_PROJECT_NAME ||
- props.includeDefaultProject
+ !state.rawProjectList.find((proj) => proj.name === DEFAULT_PROJECT_NAME)
) {
- if (
- !state.rawProjectList.find((proj) => proj.name === DEFAULT_PROJECT_NAME)
- ) {
- state.rawProjectList.unshift({ ...defaultProject() });
- }
+ state.rawProjectList.unshift({ ...defaultProject() });
}
+ }
- if (props.projectName === UNKNOWN_PROJECT_NAME || props.includeAll) {
- const dummyAll = {
- ...unknownProject(),
- title: t("project.all"),
- };
- state.rawProjectList.unshift(dummyAll);
- }
- },
- { immediate: true }
-);
+ if (props.projectName === UNKNOWN_PROJECT_NAME || props.includeAll) {
+ const dummyAll = {
+ ...unknownProject(),
+ title: t("project.all"),
+ };
+ state.rawProjectList.unshift(dummyAll);
+ }
+};
const hasWorkspaceManageProjectPermission = computed(() =>
hasWorkspacePermissionV2("bb.projects.list")
@@ -180,24 +165,32 @@ const combinedProjectList = computed(() => {
return list;
});
-const handleSearch = useDebounceFn(async (search: string) => {
- if (!search) {
- state.rawProjectList = projectList.value;
- return;
- }
+const searchProjects = async (query: string) => {
+ const { projects } = await projectStore.fetchProjectList({
+ query,
+ pageSize: 100,
+ showDeleted: props.includeArchived,
+ });
+ return projects;
+};
+const handleSearch = useDebounceFn(async (search: string) => {
state.loading = true;
try {
- const projects = await projectStore.searchProjects({
- query: search,
- showDeleted: props.includeArchived,
- });
+ const projects = await searchProjects(search);
state.rawProjectList = projects;
+ if (!search) {
+ initProjectList();
+ }
} finally {
state.loading = false;
}
}, 500);
+onMounted(async () => {
+ await handleSearch("");
+});
+
const options = computed(
(): {
resource: ComposedProject;
diff --git a/frontend/src/composables/useExecuteSQL.ts b/frontend/src/composables/useExecuteSQL.ts
index 0bf5e3756f..757b7736ae 100644
--- a/frontend/src/composables/useExecuteSQL.ts
+++ b/frontend/src/composables/useExecuteSQL.ts
@@ -197,7 +197,8 @@ const useExecuteSQL = () => {
const queryContext = tab.queryContext!;
const batchQueryContext = tab.batchQueryContext;
- const selectedDatabase = useDatabaseV1Store().getDatabaseByName(
+
+ const selectedDatabase = await databaseStore.getOrFetchDatabaseByName(
params.connection.database
);
const databaseName = isValidDatabaseName(selectedDatabase.name)
@@ -212,10 +213,11 @@ const useExecuteSQL = () => {
batchQueryContext.databases.length > 0
) {
for (const databaseResourceName of batchQueryContext.databases) {
- const database = databaseStore.getDatabaseByName(databaseResourceName);
- if (database.name === selectedDatabase.name) {
+ if (databaseResourceName === selectedDatabase.name) {
continue;
}
+ const database =
+ await databaseStore.getOrFetchDatabaseByName(databaseResourceName);
batchQueryDatabases.push(database);
}
}
diff --git a/frontend/src/layouts/ProjectV1Layout.vue b/frontend/src/layouts/ProjectV1Layout.vue
index 428a60fa4c..20741725bd 100644
--- a/frontend/src/layouts/ProjectV1Layout.vue
+++ b/frontend/src/layouts/ProjectV1Layout.vue
@@ -80,7 +80,6 @@ import {
usePermissionStore,
} from "@/store";
import { projectNamePrefix } from "@/store/modules/v1/common";
-import { useDatabaseV1List } from "@/store/modules/v1/databaseList";
import {
UNKNOWN_PROJECT_NAME,
DEFAULT_PROJECT_NAME,
@@ -112,8 +111,6 @@ const { t } = useI18n();
const hideQuickAction = useAppFeature("bb.feature.console.hide-quick-action");
const hideDefaultProject = useAppFeature("bb.feature.project.hide-default");
const projectName = computed(() => `${projectNamePrefix}${props.projectId}`);
-// Prepare database list of the project.
-const { ready: databaseListReady } = useDatabaseV1List(projectName);
watchEffect(async () => {
try {
@@ -146,10 +143,7 @@ watchEffect(async () => {
const { project, ready } = useProjectByName(projectName.value);
const initialized = computed(
- () =>
- ready &&
- project.value.name !== UNKNOWN_PROJECT_NAME &&
- databaseListReady.value
+ () => ready && project.value.name !== UNKNOWN_PROJECT_NAME
);
const isDefaultProject = computed((): boolean => {
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 555eccdeb6..a653f13914 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -983,9 +983,6 @@
"request-exporter-role": "Request exporter role"
}
},
- "alter-schema": {
- "no-databases-in-project": "No databases in this project. Click New DB or Transfer in DB to add databases."
- },
"quick-action": {
"create-db": "Create database",
"new-db": "New DB",
@@ -1420,7 +1417,6 @@
"select": "Select table",
"select-tip": "Please select a table to start."
},
- "n-selected-m-in-total": "({selected} selected, {total} in total)",
"all": "All databases",
"show-schemaless-databases": "Show schemaless databases. (Edit Schema is not applicable for schemaless databases.)",
"secret": {
@@ -1504,8 +1500,7 @@
"success-prompt": "Successfully created project {name}."
},
"overview": {
- "info-slot-content": "Bytebase periodically syncs the instance schema. Newly synced databases are first placed here. User should transfer them to the proper application project.",
- "no-db-prompt": "No database belongs to this project. You can add database by clicking {newDb} or {transferInDb} from the top action bar."
+ "info-slot-content": "Bytebase periodically syncs the instance schema. Newly synced databases are first placed here. User should transfer them to the proper application project."
},
"webhook": {
"success-created-prompt": "Successfully created webhook {name}.",
@@ -1940,8 +1935,7 @@
"key-duplicated": "Duplicated keys",
"max-value-length-exceeded": "Value's length cannot exceed {length} characters"
},
- "add-label": "Add label",
- "filter-by-label": "Filter by label"
+ "add-label": "Add label"
},
"oauth": {
"unknown-event": "Unexpected event type, OAuth failed."
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index d71f9ae205..9cd6093a71 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -983,9 +983,6 @@
"request-exporter-role": "Solicitar función de exportación"
}
},
- "alter-schema": {
- "no-databases-in-project": "No hay bases de datos en este proyecto. Haga clic en Nueva BD o Transferir BD para agregar bases de datos."
- },
"quick-action": {
"create-db": "Crear base de datos",
"new-db": "Nueva BD",
@@ -1420,7 +1417,6 @@
"select": "Seleccionar tabla",
"select-tip": "Seleccione una mesa para comenzar."
},
- "n-selected-m-in-total": "({selected} seleccionados, {total} en total)",
"all": "Todas las bases de datos",
"show-schemaless-databases": "Mostrar bases de datos sin esquema. (Editar Schema no se aplica a las bases de datos sin esquema.)",
"secret": {
@@ -1504,8 +1500,7 @@
"success-prompt": "Proyecto {name} creado exitosamente."
},
"overview": {
- "info-slot-content": "Bytebase sincroniza periódicamente el esquema de la instancia. Las bases de datos recién sincronizadas se colocan aquí primero. El usuario debe transferirlas al proyecto de aplicación adecuado.",
- "no-db-prompt": "No hay bases de datos que pertenezcan a este proyecto. Puedes agregar bases de datos haciendo clic en {newDb} o {transferInDb} desde la barra de acciones superior."
+ "info-slot-content": "Bytebase sincroniza periódicamente el esquema de la instancia. Las bases de datos recién sincronizadas se colocan aquí primero. El usuario debe transferirlas al proyecto de aplicación adecuado."
},
"webhook": {
"success-created-prompt": "Webhook {name} creado exitosamente.",
@@ -1939,8 +1934,7 @@
"key-duplicated": "Claves duplicadas",
"max-value-length-exceeded": "La longitud del valor no puede exceder {longitud} caracteres"
},
- "add-label": "Agregar etiqueta",
- "filter-by-label": "Filtrar por etiqueta"
+ "add-label": "Agregar etiqueta"
},
"oauth": {
"unknown-event": "Tipo de evento inesperado, OAuth falló."
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 1d26c97954..bb0ead2702 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -983,9 +983,6 @@
"request-exporter-role": "エクスポートロールのリクエスト"
}
},
- "alter-schema": {
- "no-databases-in-project": "このプロジェクトにはデータベースがありません。 「データベースの作成」または「データベースの転送」をクリックしてデータベースを追加します。"
- },
"quick-action": {
"create-db": "データベースの作成",
"new-db": "データベースの作成",
@@ -1420,7 +1417,6 @@
"select": "テーブルを選択",
"select-tip": "開始するにはテーブルを選択してください。"
},
- "n-selected-m-in-total": "({selected} 個が選択され、合計 {total} 個)",
"all": "すべてのデータベース",
"show-schemaless-databases": "スキーマレス データベースを示します。 (スキーマの変更は、スキーマのないデータベースでは機能しません。)",
"secret": {
@@ -1504,8 +1500,7 @@
"success-prompt": "{name} が正常に作成されました。"
},
"overview": {
- "info-slot-content": "Bytebase はインスタンスのスキーマを定期的に同期します。新しく同期されたデータベースは最初にここに配置され、その後、それらを適切なプロジェクトに転送できます。",
- "no-db-prompt": "現在のプロジェクトに属しているデータベースはありません。上のメニュー バーの {newDb} または {transferInDb} をクリックすると、データベースを追加できます。"
+ "info-slot-content": "Bytebase はインスタンスのスキーマを定期的に同期します。新しく同期されたデータベースは最初にここに配置され、その後、それらを適切なプロジェクトに転送できます。"
},
"webhook": {
"success-created-prompt": "{name} Webhook が正常に作成されました。",
@@ -1939,8 +1934,7 @@
"key-duplicated": "キーが繰り返されました",
"max-value-length-exceeded": "値は {length} 文字を超えることはできません"
},
- "add-label": "タグ付けする",
- "filter-by-label": "タグでフィルタリングする"
+ "add-label": "タグ付けする"
},
"oauth": {
"unknown-event": "不明なイベント タイプ、認証に失敗しました"
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index c1247fbd41..494aef6ebe 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -983,9 +983,6 @@
"request-exporter-role": "Yêu cầu vai trò người xuất"
}
},
- "alter-schema": {
- "no-databases-in-project": "Không có cơ sở dữ liệu nào trong dự án này. Nhấp vào Cơ sở dữ liệu mới hoặc Chuyển vào Cơ sở dữ liệu để thêm cơ sở dữ liệu."
- },
"quick-action": {
"create-db": "Tạo cơ sở dữ liệu",
"new-db": "Cơ sở dữ liệu mới",
@@ -1420,7 +1417,6 @@
"select": "Chọn bảng",
"select-tip": "Vui lòng chọn một bảng để bắt đầu."
},
- "n-selected-m-in-total": "({selected} đã chọn, {total} tổng cộng)",
"all": "Tất cả cơ sở dữ liệu",
"show-schemaless-databases": "Hiển thị cơ sở dữ liệu không có lược đồ. (Chỉnh sửa lược đồ không áp dụng cho cơ sở dữ liệu không có lược đồ.)",
"secret": {
@@ -1504,8 +1500,7 @@
"success-prompt": "Đã tạo thành công dự án {name}."
},
"overview": {
- "info-slot-content": "Bytebase định kỳ đồng bộ hóa lược đồ phiên bản. Các cơ sở dữ liệu mới được đồng bộ hóa trước tiên được đặt ở đây. Người dùng nên chuyển chúng đến dự án ứng dụng thích hợp.",
- "no-db-prompt": "Không có cơ sở dữ liệu nào thuộc dự án này. Bạn có thể thêm cơ sở dữ liệu bằng cách nhấp vào {newDb} hoặc {transferInDb} từ thanh tác vụ trên cùng."
+ "info-slot-content": "Bytebase định kỳ đồng bộ hóa lược đồ phiên bản. Các cơ sở dữ liệu mới được đồng bộ hóa trước tiên được đặt ở đây. Người dùng nên chuyển chúng đến dự án ứng dụng thích hợp."
},
"webhook": {
"success-created-prompt": "Đã tạo thành công webhook {name}.",
@@ -1939,8 +1934,7 @@
"key-duplicated": "Khóa trùng lặp",
"max-value-length-exceeded": "Độ dài giá trị không được vượt quá {length} ký tự"
},
- "add-label": "Thêm nhãn",
- "filter-by-label": "Lọc theo nhãn"
+ "add-label": "Thêm nhãn"
},
"oauth": {
"unknown-event": "Loại sự kiện không mong đợi, OAuth không thành công."
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 341eb42b05..cf24e6854b 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -983,9 +983,6 @@
"request-exporter-role": "申请导出者角色"
}
},
- "alter-schema": {
- "no-databases-in-project": "该项目里没有数据库。点击 创建数据库 或 转移数据库 以添加数据库。"
- },
"quick-action": {
"create-db": "创建数据库",
"new-db": "创建数据库",
@@ -1420,7 +1417,6 @@
"select": "选择表",
"select-tip": "请选择一个表来开始查询。"
},
- "n-selected-m-in-total": "(已选择 {selected},共计 {total})",
"all": "所有数据库",
"show-schemaless-databases": "显示无模式的数据库。(变更 Schema 不适用于无 schema 的数据库. )",
"secret": {
@@ -1504,8 +1500,7 @@
"success-prompt": "成功创建 {name}."
},
"overview": {
- "info-slot-content": "Bytebase 会定时同步实例的 schema,新同步的数据库会首先被置于这里,之后您可以再将他们转移到适当的项目中。",
- "no-db-prompt": "没有数据库属于当前项目。您可以通过点击位于上方菜单栏中的 {newDb} 或者 {transferInDb} 来添加数据库。"
+ "info-slot-content": "Bytebase 会定时同步实例的 schema,新同步的数据库会首先被置于这里,之后您可以再将他们转移到适当的项目中。"
},
"webhook": {
"success-created-prompt": "成功创建 {name} webhook.",
@@ -1939,8 +1934,7 @@
"key-duplicated": "Key 重复了",
"max-value-length-exceeded": "值长的度不能超过 {length} 字符"
},
- "add-label": "添加标签",
- "filter-by-label": "按标签过滤"
+ "add-label": "添加标签"
},
"oauth": {
"unknown-event": "未知的事件类型,认证失败"
diff --git a/frontend/src/store/modules/dbGroup.ts b/frontend/src/store/modules/dbGroup.ts
index 134c4ff0c1..d6e6ba9d3b 100644
--- a/frontend/src/store/modules/dbGroup.ts
+++ b/frontend/src/store/modules/dbGroup.ts
@@ -27,6 +27,7 @@ import { useCache } from "../cache";
import {
useProjectV1Store,
useDatabaseV1Store,
+ batchGetOrFetchDatabases,
batchGetOrFetchProjects,
} from "./v1";
import {
@@ -44,6 +45,7 @@ const batchComposeDatabaseGroup = async (
const composedDatabaseGroupNameList: string[] = [];
const projectStore = useProjectV1Store();
+
await batchGetOrFetchProjects(
databaseGroupList.map((databaseGroup) => {
const [projectName, _] = getProjectNameAndDatabaseGroupName(
@@ -61,6 +63,11 @@ const batchComposeDatabaseGroup = async (
`${projectNamePrefix}${projectName}`
);
+ await batchGetOrFetchDatabases([
+ ...databaseGroup.matchedDatabases.map((db) => db.name),
+ ...databaseGroup.unmatchedDatabases.map((db) => db.name),
+ ]);
+
composedDatabaseGroupMap.set(databaseGroup.name, {
...databaseGroup,
databaseGroupName,
diff --git a/frontend/src/store/modules/slowQuery.ts b/frontend/src/store/modules/slowQuery.ts
index fbe9dfea7b..1f198c398c 100644
--- a/frontend/src/store/modules/slowQuery.ts
+++ b/frontend/src/store/modules/slowQuery.ts
@@ -1,11 +1,11 @@
import { defineStore } from "pinia";
import { databaseServiceClient, instanceServiceClient } from "@/grpcweb";
-import type { ComposedSlowQueryLog, ComposedDatabase } from "@/types";
+import type { ComposedSlowQueryLog } from "@/types";
import type {
ListSlowQueriesRequest,
SlowQueryLog,
} from "@/types/proto/v1/database_service";
-import { useDatabaseV1Store } from "./v1/database";
+import { useDatabaseV1Store, batchGetOrFetchDatabases } from "./v1/database";
export const useSlowQueryStore = defineStore("slow-query", () => {
const fetchSlowQueryLogList = async (
@@ -31,28 +31,16 @@ export const useSlowQueryStore = defineStore("slow-query", () => {
return { fetchSlowQueryLogList, syncSlowQueries };
});
-const databaseRequestCache = new Map<string, Promise<ComposedDatabase>>();
-
-const getOrFetchV1Database = (name: string) => {
- const cached = databaseRequestCache.get(name);
- if (cached) return cached;
- const request = useDatabaseV1Store().getOrFetchDatabaseByName(name);
- databaseRequestCache.set(name, request);
- return request;
-};
-
const composeSlowQueryLogDatabase = async (
slowQueryLogList: SlowQueryLog[]
) => {
const databaseNameList = slowQueryLogList.map((log) => log.resource);
- await Promise.all(
- databaseNameList.map((name) => {
- return getOrFetchV1Database(name);
- })
- );
+ await batchGetOrFetchDatabases(databaseNameList);
+ const databaseStore = useDatabaseV1Store();
+
return slowQueryLogList.map<ComposedSlowQueryLog>((log, index) => ({
id: `${index}`,
log,
- database: useDatabaseV1Store().getDatabaseByName(log.resource),
+ database: databaseStore.getDatabaseByName(log.resource),
}));
};
diff --git a/frontend/src/store/modules/sqlEditor/editor.ts b/frontend/src/store/modules/sqlEditor/editor.ts
index 7e3f040f1b..0410d9d229 100644
--- a/frontend/src/store/modules/sqlEditor/editor.ts
+++ b/frontend/src/store/modules/sqlEditor/editor.ts
@@ -1,11 +1,14 @@
-import { useLocalStorage } from "@vueuse/core";
+import { useLocalStorage, useDebounceFn } from "@vueuse/core";
import { defineStore } from "pinia";
-import { computed, ref, watch } from "vue";
+import { computed, ref, watch, watchEffect } from "vue";
+import { useDatabaseV1Store } from "@/store";
import type { ComposedDatabase } from "@/types";
import { QueryOption_RedisRunCommandsOn } from "@/types/proto/v1/sql_service";
import { hasWorkspacePermissionV2 } from "@/utils";
export const useSQLEditorStore = defineStore("sqlEditor", () => {
+ const databaseStore = useDatabaseV1Store();
+
const resultRowsLimit = useLocalStorage(
"bb.sql-editor.result-rows-limit",
1000
@@ -33,6 +36,29 @@ export const useSQLEditorStore = defineStore("sqlEditor", () => {
// `databaseList` is query-able databases scoped by `project`
const databaseList = ref<ComposedDatabase[]>([]);
+ const loading = ref<boolean>(false);
+
+ const prepareDatabases = useDebounceFn(async (name?: string) => {
+ loading.value = true;
+ try {
+ const { databases } = await databaseStore.fetchDatabases({
+ parent: project.value,
+ pageSize: 100,
+ filter: name ? `name.matches("${name}")` : "",
+ });
+ databaseList.value = [...databases];
+ } catch {
+ databaseList.value = [];
+ } finally {
+ loading.value = false;
+ }
+ }, 500);
+
+ watchEffect(async () => {
+ if (project.value) {
+ await prepareDatabases();
+ }
+ });
watch(project, (project) => {
storedLastViewedProject.value = project;
@@ -52,5 +78,7 @@ export const useSQLEditorStore = defineStore("sqlEditor", () => {
isShowExecutingHint,
executingHintDatabase,
redisCommandOption,
+ prepareDatabases,
+ loading,
};
});
diff --git a/frontend/src/store/modules/sqlEditor/tab.ts b/frontend/src/store/modules/sqlEditor/tab.ts
index f24cd00927..2940b0fa9f 100644
--- a/frontend/src/store/modules/sqlEditor/tab.ts
+++ b/frontend/src/store/modules/sqlEditor/tab.ts
@@ -1,5 +1,5 @@
import type { MaybeRef } from "@vueuse/core";
-import { watchThrottled } from "@vueuse/core";
+import { computedAsync, watchThrottled } from "@vueuse/core";
import { head, omit, pick, uniqBy } from "lodash-es";
import { defineStore, storeToRefs } from "pinia";
import { computed, nextTick, reactive, ref, unref, watch } from "vue";
@@ -9,7 +9,11 @@ import type {
CoreSQLEditorTab,
SQLEditorTab,
} from "@/types";
-import { DEFAULT_SQL_EDITOR_TAB_MODE, isValidDatabaseName } from "@/types";
+import {
+ DEFAULT_SQL_EDITOR_TAB_MODE,
+ isValidDatabaseName,
+ unknownDatabase,
+} from "@/types";
import {
WebStorageHelper,
defaultSQLEditorTab,
@@ -412,9 +416,11 @@ export const useSQLEditorConnectionDetail = (
return useInstanceResourceByName(unref(connection).instance);
});
- const database = computed(() => {
- return useDatabaseV1Store().getDatabaseByName(unref(connection).database);
- });
+ const database = computedAsync(async () => {
+ return useDatabaseV1Store().getOrFetchDatabaseByName(
+ unref(connection).database
+ );
+ }, unknownDatabase());
const environment = computed(() => {
if (isValidDatabaseName(database.value.name)) {
@@ -443,11 +449,12 @@ export const useConnectionOfCurrentSQLEditorTab = () => {
export const resolveOpeningDatabaseListFromSQLEditorTabList = () => {
const { tabList } = useSQLEditorTabStore();
+ const databaseStore = useDatabaseV1Store();
return uniqBy(
tabList.flatMap<SQLEditorTreeNodeMeta<"database">>((tab) => {
const { database } = tab.connection;
if (database) {
- const db = useDatabaseV1Store().getDatabaseByName(database);
+ const db = databaseStore.getDatabaseByName(database);
return [{ type: "database", target: db }];
}
return [];
diff --git a/frontend/src/store/modules/sqlEditor/tree.ts b/frontend/src/store/modules/sqlEditor/tree.ts
index cb5b856c24..6cc234a593 100644
--- a/frontend/src/store/modules/sqlEditor/tree.ts
+++ b/frontend/src/store/modules/sqlEditor/tree.ts
@@ -86,8 +86,7 @@ export const useSQLEditorTreeStore = defineStore("sqlEditorTree", () => {
const nodeListMapById = reactive(new Map<string, TreeNode[]>());
// states
// re-expose `databaseList`, `project`, `currentProject` from sqlEditor store for shortcuts
- const { databaseList, project } =
- storeToRefs(useSQLEditorStore());
+ const { databaseList, project } = storeToRefs(useSQLEditorStore());
const factorList = ref<StatefulFactor[]>(
cloneDeep(factorListInLocalStorage.value)
);
@@ -196,6 +195,13 @@ export const useSQLEditorTreeStore = defineStore("sqlEditorTree", () => {
}
);
+ watch(
+ () => databaseList.value,
+ () => {
+ buildTree();
+ }
+ );
+
watch(
factorList,
(factorList) => {
diff --git a/frontend/src/store/modules/v1/database.ts b/frontend/src/store/modules/v1/database.ts
index 5c1953fb88..e784659581 100644
--- a/frontend/src/store/modules/v1/database.ts
+++ b/frontend/src/store/modules/v1/database.ts
@@ -1,3 +1,4 @@
+import { uniq } from "lodash-es";
import { defineStore } from "pinia";
import { computed, reactive, ref, unref, watch, markRaw } from "vue";
import { databaseServiceClient } from "@/grpcweb";
@@ -15,12 +16,48 @@ import type {
BatchUpdateDatabasesRequest,
} from "@/types/proto/v1/database_service";
import type { InstanceResource } from "@/types/proto/v1/instance_service";
-import { extractDatabaseResourceName, hasProjectPermissionV2 } from "@/utils";
+import {
+ extractDatabaseResourceName,
+ hasProjectPermissionV2,
+ hasWorkspacePermissionV2,
+} from "@/utils";
+import {
+ instanceNamePrefix,
+ projectNamePrefix,
+ workspaceNamePrefix,
+} from "./common";
+import { useDBSchemaV1Store } from "./dbSchema";
import { useEnvironmentV1Store } from "./environment";
import { batchGetOrFetchProjects, useProjectV1Store } from "./project";
+const formatListDatabaseParent = async (
+ parent: string
+): Promise<{ parent: string; filter?: string }> => {
+ if (parent.startsWith(projectNamePrefix)) {
+ const project = await useProjectV1Store().getOrFetchProjectByName(parent);
+ if (!hasProjectPermissionV2(project, "bb.projects.get")) {
+ return {
+ parent: `${workspaceNamePrefix}-`,
+ filter: `project == "${parent}"`,
+ };
+ }
+ return { parent };
+ }
+ if (parent.startsWith(instanceNamePrefix)) {
+ if (!hasWorkspacePermissionV2("bb.instances.get")) {
+ return {
+ parent: `${workspaceNamePrefix}-`,
+ filter: `instance == "${parent}"`,
+ };
+ }
+ return { parent };
+ }
+ return { parent: `${workspaceNamePrefix}-` };
+};
+
export const useDatabaseV1Store = defineStore("database_v1", () => {
const databaseMapByName = reactive(new Map<string, ComposedDatabase>());
+ const dbSchemaStore = useDBSchemaV1Store();
// Getters
const databaseList = computed(() => {
@@ -36,10 +73,44 @@ export const useDatabaseV1Store = defineStore("database_v1", () => {
for (const db of databaseList.value) {
if (db.instance === instance) {
databaseMapByName.delete(db.name);
+ dbSchemaStore.removeCache(db.name);
}
}
};
+ const fetchDatabases = async (params: {
+ pageSize: number;
+ pageToken?: string;
+ parent: string;
+ filter?: string;
+ showDeleted?: boolean;
+ }): Promise<{
+ databases: ComposedDatabase[];
+ nextPageToken: string;
+ }> => {
+ const { parent, filter } = await formatListDatabaseParent(params.parent);
+
+ const { databases, nextPageToken } =
+ await databaseServiceClient.listDatabases({
+ ...params,
+ parent,
+ filter: filter
+ ? params.filter
+ ? `${params.filter} && ${filter}`
+ : filter
+ : params.filter,
+ });
+ if (parent.startsWith(instanceNamePrefix)) {
+ removeCacheByInstance(parent);
+ }
+
+ const composedDatabases = await upsertDatabaseMap(databases);
+ return {
+ databases: composedDatabases,
+ nextPageToken,
+ };
+ };
+
const upsertDatabaseMap = async (databaseList: Database[]) => {
const composedDatabaseList = await batchComposeDatabase(databaseList);
composedDatabaseList.forEach((database) => {
@@ -68,24 +139,12 @@ export const useDatabaseV1Store = defineStore("database_v1", () => {
await fetchDatabaseByName(database);
}
};
- const databaseListByUser = computed(() => {
- return databaseList.value.filter((db) => {
- if (hasProjectPermissionV2(db.projectEntity, "bb.databases.get"))
- return true;
- return false;
- });
- });
const databaseListByProject = (project: string) => {
return databaseList.value.filter((db) => db.project === project);
};
const databaseListByInstance = (instance: string) => {
return databaseList.value.filter((db) => db.instance === instance);
};
- const databaseListByEnvironment = (environment: string) => {
- return databaseList.value.filter(
- (db) => db.effectiveEnvironment === environment
- );
- };
const getDatabaseByName = (name: string) => {
return databaseMapByName.get(name) ?? unknownDatabase();
};
@@ -103,13 +162,18 @@ export const useDatabaseV1Store = defineStore("database_v1", () => {
return composed;
};
+ // TODO(ed):
+ // 1. make sure using `silent = true`
+ // 2. use batchGetOrFetchDatabases
const getOrFetchDatabaseByName = async (name: string, silent = false) => {
const existed = databaseMapByName.get(name);
if (existed) {
return existed;
}
- await fetchDatabaseByName(name, silent);
- return getDatabaseByName(name);
+ if (!isValidDatabaseName(name)) {
+ return unknownDatabase();
+ }
+ return await fetchDatabaseByName(name, silent);
};
const batchUpdateDatabases = async (params: BatchUpdateDatabasesRequest) => {
const updated = await databaseServiceClient.batchUpdateDatabases(params);
@@ -162,10 +226,8 @@ export const useDatabaseV1Store = defineStore("database_v1", () => {
databaseList,
upsertDatabaseMap,
syncDatabase,
- databaseListByUser,
databaseListByProject,
databaseListByInstance,
- databaseListByEnvironment,
getDatabaseByName,
fetchDatabaseByName,
getOrFetchDatabaseByName,
@@ -175,6 +237,7 @@ export const useDatabaseV1Store = defineStore("database_v1", () => {
updateDatabaseInstance,
diffSchema,
transferDatabases,
+ fetchDatabases,
};
});
@@ -201,6 +264,30 @@ export const useDatabaseV1ByName = (name: MaybeRef<string>) => {
};
};
+const databaseRequestCache = new Map<string, Promise<ComposedDatabase>>();
+
+export const batchGetOrFetchDatabases = async (databaseNames: string[]) => {
+ const store = useDatabaseV1Store();
+
+ const distinctDatabaseList = uniq(databaseNames);
+ await Promise.all(
+ distinctDatabaseList.map((databaseName) => {
+ if (!databaseName || !isValidDatabaseName(databaseName)) {
+ return;
+ }
+ const cached = databaseRequestCache.get(databaseName);
+ if (cached) return cached;
+
+ const request = store.getOrFetchDatabaseByName(
+ databaseName,
+ true /* silent */
+ );
+ databaseRequestCache.set(databaseName, request);
+ return request;
+ })
+ );
+};
+
export const batchComposeDatabase = async (databaseList: Database[]) => {
const environmentV1Store = useEnvironmentV1Store();
const projectV1Store = useProjectV1Store();
diff --git a/frontend/src/store/modules/v1/databaseCatalog.ts b/frontend/src/store/modules/v1/databaseCatalog.ts
index e42a89af01..cfb8885633 100644
--- a/frontend/src/store/modules/v1/databaseCatalog.ts
+++ b/frontend/src/store/modules/v1/databaseCatalog.ts
@@ -164,7 +164,9 @@ export const useDatabaseCatalog = (
skipCache: MaybeRef<boolean>
) => {
const store = useDatabaseCatalogV1Store();
- watchEffect(() => {
+ const databaseStore = useDatabaseV1Store();
+
+ watchEffect(async () => {
const { databaseName } = extractDatabaseResourceName(unref(database));
if (
databaseName === String(UNKNOWN_ID) ||
@@ -172,9 +174,9 @@ export const useDatabaseCatalog = (
) {
return;
}
- const db = useDatabaseV1Store().getDatabaseByName(unref(database));
+ const db = await databaseStore.getOrFetchDatabaseByName(unref(database));
if (hasProjectPermissionV2(db.projectEntity, "bb.databaseCatalogs.get")) {
- store.getOrFetchDatabaseCatalog({
+ await store.getOrFetchDatabaseCatalog({
database: unref(database),
skipCache: unref(skipCache),
});
diff --git a/frontend/src/store/modules/v1/databaseList.ts b/frontend/src/store/modules/v1/databaseList.ts
deleted file mode 100644
index 778dab250a..0000000000
--- a/frontend/src/store/modules/v1/databaseList.ts
+++ /dev/null
@@ -1,88 +0,0 @@
-import { computed, unref, watch, type MaybeRef } from "vue";
-import { databaseServiceClient } from "@/grpcweb";
-import { DEFAULT_PAGE_SIZE } from "../common";
-import { useListCache } from "./cache";
-import {
- instanceNamePrefix,
- projectNamePrefix,
- workspaceNamePrefix,
-} from "./common";
-import { useDatabaseV1Store } from "./database";
-
-const formatDatabaseParent = (parent: string) => {
- if (
- parent.startsWith(workspaceNamePrefix) ||
- parent.startsWith(projectNamePrefix) ||
- parent.startsWith(instanceNamePrefix)
- ) {
- return parent;
- }
- // Otherwise, list all databases in the workspace.
- return `${workspaceNamePrefix}-`;
-};
-
-export const useDatabaseV1List = (
- // The parent name of databases to list.
- // * Leave empty or `workspaces/` to list all databases in workspace.
- // * `projects/{project}` to list all databases in the project.
- // * `instances/{instance}` to list all databases in the instance.
- parent?: MaybeRef<string>
-) => {
- const listCache = useListCache("database");
- const store = useDatabaseV1Store();
- const formatParent = computed(() =>
- formatDatabaseParent(unref(parent) || "")
- );
- const cacheKey = computed(() => listCache.getCacheKey(formatParent.value));
- const cache = computed(() => listCache.getCache(cacheKey.value));
-
- watch(
- [() => cache.value],
- async () => {
- // Skip if request is already in progress or cache is available.
- if (cache.value?.isFetching || cache.value) {
- return;
- }
-
- listCache.cacheMap.set(cacheKey.value, {
- timestamp: Date.now(),
- isFetching: true,
- });
- const request = formatParent.value.startsWith(instanceNamePrefix)
- ? databaseServiceClient.listInstanceDatabases
- : databaseServiceClient.listDatabases;
- const { databases } = await request({
- parent: formatParent.value,
- pageSize: DEFAULT_PAGE_SIZE,
- });
- if (formatParent.value.startsWith(instanceNamePrefix)) {
- store.removeCacheByInstance(formatParent.value);
- }
- await store.upsertDatabaseMap(databases);
- listCache.cacheMap.set(cacheKey.value, {
- timestamp: Date.now(),
- isFetching: false,
- });
- },
- {
- deep: true,
- immediate: true,
- }
- );
-
- const databaseList = computed(() => {
- if (formatParent.value.startsWith(projectNamePrefix)) {
- return store.databaseListByProject(formatParent.value);
- } else if (formatParent.value.startsWith(instanceNamePrefix)) {
- return store.databaseListByInstance(formatParent.value);
- }
- // Otherwise, list all databases in the workspace.
- return store.databaseList;
- });
-
- return {
- databaseList,
- listCache,
- ready: computed(() => cache.value && !cache.value.isFetching),
- };
-};
diff --git a/frontend/src/store/modules/v1/instanceResource.ts b/frontend/src/store/modules/v1/instanceResource.ts
index 8ede25e272..d6eb084fe7 100644
--- a/frontend/src/store/modules/v1/instanceResource.ts
+++ b/frontend/src/store/modules/v1/instanceResource.ts
@@ -2,18 +2,15 @@ import { uniqBy } from "lodash-es";
import { computed } from "vue";
import { unknownInstanceResource } from "@/types";
import type { InstanceResource } from "@/types/proto/v1/instance_service";
-import { useDatabaseV1Store } from "./database";
import { useInstanceV1Store } from "./instance";
// Instance resource list is a list of all instance resources in the database list.
// Current user should have access to all instance resources in the list.
export const useInstanceResourceList = () => {
const instanceStore = useInstanceV1Store();
- const databaseStore = useDatabaseV1Store();
return computed(() => {
return uniqBy(
[
- ...databaseStore.databaseList.map((db) => db.instanceResource),
// Merge possible instance resources from the instance store.
...instanceStore.instanceList,
],
diff --git a/frontend/src/store/modules/v1/project.ts b/frontend/src/store/modules/v1/project.ts
index c97a5b157b..7a64ec9614 100644
--- a/frontend/src/store/modules/v1/project.ts
+++ b/frontend/src/store/modules/v1/project.ts
@@ -233,6 +233,8 @@ const batchComposeProjectIamPolicy = async (projectList: Project[]) => {
});
};
+const projectRequestCache = new Map<string, Promise<ComposedProject>>();
+
export const batchGetOrFetchProjects = async (projectNames: string[]) => {
const store = useProjectV1Store();
@@ -246,7 +248,14 @@ export const batchGetOrFetchProjects = async (projectNames: string[]) => {
) {
return;
}
- return store.getOrFetchProjectByName(projectName, true /* silent */);
+ const cached = projectRequestCache.get(projectName);
+ if (cached) return cached;
+ const request = store.getOrFetchProjectByName(
+ projectName,
+ true /* silent */
+ );
+ projectRequestCache.set(projectName, request);
+ return request;
})
);
};
diff --git a/frontend/src/store/modules/v1/worksheet.ts b/frontend/src/store/modules/v1/worksheet.ts
index 378623c8a2..5f12e4a572 100644
--- a/frontend/src/store/modules/v1/worksheet.ts
+++ b/frontend/src/store/modules/v1/worksheet.ts
@@ -18,6 +18,7 @@ import {
import { useCurrentUserV1 } from "../auth";
import { useSQLEditorTabStore } from "../sqlEditor";
import { getUserEmailFromIdentifier } from "./common";
+import { useDatabaseV1Store, batchGetOrFetchDatabases } from "./database";
import { useProjectV1Store, batchGetOrFetchProjects } from "./project";
type WorksheetView = "FULL" | "BASIC";
@@ -28,6 +29,7 @@ export const useWorkSheetStore = defineStore("worksheet_v1", () => {
"bb.worksheet.by-uid"
);
const projectStore = useProjectV1Store();
+ const databaseStore = useDatabaseV1Store();
// Getters
const worksheetList = computed(() => {
@@ -63,13 +65,19 @@ export const useWorkSheetStore = defineStore("worksheet_v1", () => {
cacheByUID.invalidateEntity([uid, "BASIC"]);
}
- await projectStore.getOrFetchProjectByName(worksheet.project);
+ await Promise.all([
+ projectStore.getOrFetchProjectByName(worksheet.project),
+ databaseStore.getOrFetchDatabaseByName(worksheet.database),
+ ]);
cacheByUID.setEntity([uid, view], worksheet);
};
const setListCache = async (worksheets: Worksheet[]) => {
await batchGetOrFetchProjects(
worksheets.map((worksheet) => worksheet.project)
);
+ await batchGetOrFetchDatabases(
+ worksheets.map((worksheet) => worksheet.database)
+ );
for (const worksheet of worksheets) {
await setCache(worksheet, "BASIC");
}
diff --git a/frontend/src/types/proto/google/protobuf/descriptor.ts b/frontend/src/types/proto/google/protobuf/descriptor.ts
index 2fdf22f5e2..ae3f877dc7 100644
--- a/frontend/src/types/proto/google/protobuf/descriptor.ts
+++ b/frontend/src/types/proto/google/protobuf/descriptor.ts
@@ -36,7 +36,7 @@ export enum Edition {
EDITION_2024 = "EDITION_2024",
/**
* EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be
- * used or relied on outside of tests.
+ * used or relyed on outside of tests.
*/
EDITION_1_TEST_ONLY = "EDITION_1_TEST_ONLY",
EDITION_2_TEST_ONLY = "EDITION_2_TEST_ONLY",
@@ -1093,13 +1093,12 @@ export interface MessageOptions {
export interface FieldOptions {
/**
- * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead.
* The ctype option instructs the C++ code generator to use a different
* representation of the field than it normally would. See the specific
* options below. This option is only implemented to support use of
* [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of
- * type "bytes" in the open source release.
- * TODO: make ctype actually deprecated.
+ * type "bytes" in the open source release -- sorry, we'll try to include
+ * other types in a future version!
*/
ctype?:
| FieldOptions_CType
@@ -1315,7 +1314,11 @@ export function fieldOptions_JSTypeToNumber(object: FieldOptions_JSType): number
}
}
-/** If set to RETENTION_SOURCE, the option will be omitted from the binary. */
+/**
+ * If set to RETENTION_SOURCE, the option will be omitted from the binary.
+ * Note: as of January 2023, support for this is in progress and does not yet
+ * have an effect (b/264593489).
+ */
export enum FieldOptions_OptionRetention {
RETENTION_UNKNOWN = "RETENTION_UNKNOWN",
RETENTION_RUNTIME = "RETENTION_RUNTIME",
@@ -1372,7 +1375,8 @@ export function fieldOptions_OptionRetentionToNumber(object: FieldOptions_Option
/**
* This indicates the types of entities that the field may apply to when used
* as an option. If it is unset, then the field may be freely used as an
- * option on any kind of entity.
+ * option on any kind of entity. Note: as of January 2023, support for this is
+ * in progress and does not yet have an effect (b/264593489).
*/
export enum FieldOptions_OptionTargetType {
TARGET_TYPE_UNKNOWN = "TARGET_TYPE_UNKNOWN",
diff --git a/frontend/src/types/proto/v1/database_service.ts b/frontend/src/types/proto/v1/database_service.ts
index 5cab9d87e1..41210aa278 100644
--- a/frontend/src/types/proto/v1/database_service.ts
+++ b/frontend/src/types/proto/v1/database_service.ts
@@ -143,55 +143,18 @@ export interface GetDatabaseRequest {
name: string;
}
-export interface ListInstanceDatabasesRequest {
- /**
- * The parent, which owns this collection of databases.
- * - instances/{instance}: list all databases for an instance. Use
- * "instances/-" to list all databases.
- */
- parent: string;
- /**
- * The maximum number of databases to return. The service may return fewer
- * than this value. If unspecified, at most 10 databases will be returned.
- */
- pageSize: number;
- /**
- * A page token, received from a previous `ListInstanceDatabases` call.
- * Provide this to retrieve the subsequent page.
- *
- * When paginating, all other parameters provided to `ListInstanceDatabases`
- * must match the call that provided the page token.
- */
- pageToken: string;
- /**
- * Deprecated.
- * Filter is used to filter databases returned in the list.
- * For example, `project == "projects/{project}"` can be used to list
- * databases in a project. Note: the project filter will be moved to parent.
- */
- filter: string;
-}
-
-export interface ListInstanceDatabasesResponse {
- /** The databases from the specified request. */
- databases: Database[];
- /**
- * A token, which can be sent as `page_token` to retrieve the next page.
- * If this field is omitted, there are no subsequent pages.
- */
- nextPageToken: string;
-}
-
export interface ListDatabasesRequest {
/**
- * The parent, which owns this collection of databases.
- * - projects/{project}: list all databases in a project.
- * - workspaces/{workspace}: list all databases in a workspace.
+ * - projects/{project}: list databases in a project, require "bb.projects.get" permission.
+ * - workspaces/-: list databases in the workspace, require "bb.databases.list" permission.
+ * - instances/{instances}: list databases in a instance, require "bb.instances.get" permission
*/
parent: string;
/**
* The maximum number of databases to return. The service may return fewer
- * than this value. If unspecified, at most 10 databases will be returned.
+ * than this value.
+ * If unspecified, at most 10 databases will be returned.
+ * The maximum value is 1000; values above 1000 will be coerced to 1000.
*/
pageSize: number;
/**
@@ -202,6 +165,33 @@ export interface ListDatabasesRequest {
* match the call that provided the page token.
*/
pageToken: string;
+ /**
+ * Filter is used to filter databases returned in the list.
+ * Supported filter:
+ * - environment
+ * - name
+ * - project
+ * - instance
+ * - engine
+ * - label
+ * - exclude_unassigned: Not show unassigned databases if specified
+ *
+ * For example:
+ * environment == "environments/{environment resource id}"
+ * project == "projects/{project resource id}"
+ * instance == "instances/{instance resource id}"
+ * name.matches("database name")
+ * engine == "MYSQL"
+ * engine in ["MYSQL", "POSTGRES"]
+ * !(engine in ["MYSQL", "POSTGRES"])
+ * label == "region:asia"
+ * label == "tenant:asia,europe"
+ * label == "region:asia" && label == "tenant:bytebase"
+ * exclude_unassigned == true
+ */
+ filter: string;
+ /** Show deleted database if specified. */
+ showDeleted: boolean;
}
export interface ListDatabasesResponse {
@@ -1916,12 +1906,12 @@ export const GetDatabaseRequest: MessageFns<GetDatabaseRequest> = {
},
};
-function createBaseListInstanceDatabasesRequest(): ListInstanceDatabasesRequest {
- return { parent: "", pageSize: 0, pageToken: "", filter: "" };
+function createBaseListDatabasesRequest(): ListDatabasesRequest {
+ return { parent: "", pageSize: 0, pageToken: "", filter: "", showDeleted: false };
}
-export const ListInstanceDatabasesRequest: MessageFns<ListInstanceDatabasesRequest> = {
- encode(message: ListInstanceDatabasesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+export const ListDatabasesRequest: MessageFns<ListDatabasesRequest> = {
+ encode(message: ListDatabasesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.parent !== "") {
writer.uint32(10).string(message.parent);
}
@@ -1934,13 +1924,16 @@ export const ListInstanceDatabasesRequest: MessageFns<ListInstanceDatabasesReque
if (message.filter !== "") {
writer.uint32(34).string(message.filter);
}
+ if (message.showDeleted !== false) {
+ writer.uint32(40).bool(message.showDeleted);
+ }
return writer;
},
- decode(input: BinaryReader | Uint8Array, length?: number): ListInstanceDatabasesRequest {
+ decode(input: BinaryReader | Uint8Array, length?: number): ListDatabasesRequest {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListInstanceDatabasesRequest();
+ const message = createBaseListDatabasesRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@@ -1976,179 +1969,12 @@ export const ListInstanceDatabasesRequest: MessageFns<ListInstanceDatabasesReque
message.filter = reader.string();
continue;
}
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListInstanceDatabasesRequest {
- return {
- parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
- pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
- pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
- filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
- };
- },
-
- toJSON(message: ListInstanceDatabasesRequest): unknown {
- const obj: any = {};
- if (message.parent !== "") {
- obj.parent = message.parent;
- }
- if (message.pageSize !== 0) {
- obj.pageSize = Math.round(message.pageSize);
- }
- if (message.pageToken !== "") {
- obj.pageToken = message.pageToken;
- }
- if (message.filter !== "") {
- obj.filter = message.filter;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListInstanceDatabasesRequest>): ListInstanceDatabasesRequest {
- return ListInstanceDatabasesRequest.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListInstanceDatabasesRequest>): ListInstanceDatabasesRequest {
- const message = createBaseListInstanceDatabasesRequest();
- message.parent = object.parent ?? "";
- message.pageSize = object.pageSize ?? 0;
- message.pageToken = object.pageToken ?? "";
- message.filter = object.filter ?? "";
- return message;
- },
-};
-
-function createBaseListInstanceDatabasesResponse(): ListInstanceDatabasesResponse {
- return { databases: [], nextPageToken: "" };
-}
-
-export const ListInstanceDatabasesResponse: MessageFns<ListInstanceDatabasesResponse> = {
- encode(message: ListInstanceDatabasesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- for (const v of message.databases) {
- Database.encode(v!, writer.uint32(10).fork()).join();
- }
- if (message.nextPageToken !== "") {
- writer.uint32(18).string(message.nextPageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListInstanceDatabasesResponse {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListInstanceDatabasesResponse();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.databases.push(Database.decode(reader, reader.uint32()));
- continue;
- }
- case 2: {
- if (tag !== 18) {
- break;
- }
-
- message.nextPageToken = reader.string();
- continue;
- }
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ListInstanceDatabasesResponse {
- return {
- databases: globalThis.Array.isArray(object?.databases)
- ? object.databases.map((e: any) => Database.fromJSON(e))
- : [],
- nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
- };
- },
-
- toJSON(message: ListInstanceDatabasesResponse): unknown {
- const obj: any = {};
- if (message.databases?.length) {
- obj.databases = message.databases.map((e) => Database.toJSON(e));
- }
- if (message.nextPageToken !== "") {
- obj.nextPageToken = message.nextPageToken;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ListInstanceDatabasesResponse>): ListInstanceDatabasesResponse {
- return ListInstanceDatabasesResponse.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ListInstanceDatabasesResponse>): ListInstanceDatabasesResponse {
- const message = createBaseListInstanceDatabasesResponse();
- message.databases = object.databases?.map((e) => Database.fromPartial(e)) || [];
- message.nextPageToken = object.nextPageToken ?? "";
- return message;
- },
-};
-
-function createBaseListDatabasesRequest(): ListDatabasesRequest {
- return { parent: "", pageSize: 0, pageToken: "" };
-}
-
-export const ListDatabasesRequest: MessageFns<ListDatabasesRequest> = {
- encode(message: ListDatabasesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.parent !== "") {
- writer.uint32(10).string(message.parent);
- }
- if (message.pageSize !== 0) {
- writer.uint32(16).int32(message.pageSize);
- }
- if (message.pageToken !== "") {
- writer.uint32(26).string(message.pageToken);
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ListDatabasesRequest {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseListDatabasesRequest();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- if (tag !== 10) {
- break;
- }
-
- message.parent = reader.string();
- continue;
- }
- case 2: {
- if (tag !== 16) {
- break;
- }
-
- message.pageSize = reader.int32();
- continue;
- }
- case 3: {
- if (tag !== 26) {
+ case 5: {
+ if (tag !== 40) {
break;
}
- message.pageToken = reader.string();
+ message.showDeleted = reader.bool();
continue;
}
}
@@ -2165,6 +1991,8 @@ export const ListDatabasesRequest: MessageFns<ListDatabasesRequest> = {
parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
+ showDeleted: isSet(object.showDeleted) ? globalThis.Boolean(object.showDeleted) : false,
};
},
@@ -2179,6 +2007,12 @@ export const ListDatabasesRequest: MessageFns<ListDatabasesRequest> = {
if (message.pageToken !== "") {
obj.pageToken = message.pageToken;
}
+ if (message.filter !== "") {
+ obj.filter = message.filter;
+ }
+ if (message.showDeleted !== false) {
+ obj.showDeleted = message.showDeleted;
+ }
return obj;
},
@@ -2190,6 +2024,8 @@ export const ListDatabasesRequest: MessageFns<ListDatabasesRequest> = {
message.parent = object.parent ?? "";
message.pageSize = object.pageSize ?? 0;
message.pageToken = object.pageToken ?? "";
+ message.filter = object.filter ?? "";
+ message.showDeleted = object.showDeleted ?? false;
return message;
},
};
@@ -10780,19 +10616,21 @@ export const DatabaseServiceDefinition = {
},
},
},
- listInstanceDatabases: {
- name: "ListInstanceDatabases",
- requestType: ListInstanceDatabasesRequest,
+ listDatabases: {
+ name: "ListDatabases",
+ requestType: ListDatabasesRequest,
requestStream: false,
- responseType: ListInstanceDatabasesResponse,
+ responseType: ListDatabasesResponse,
responseStream: false,
options: {
_unknownFields: {
8410: [new Uint8Array([0])],
- 800010: [new Uint8Array([16, 98, 98, 46, 105, 110, 115, 116, 97, 110, 99, 101, 115, 46, 103, 101, 116])],
- 800016: [new Uint8Array([1])],
+ 800010: [new Uint8Array([17, 98, 98, 46, 100, 97, 116, 97, 98, 97, 115, 101, 115, 46, 108, 105, 115, 116])],
+ 800016: [new Uint8Array([2])],
578365826: [
new Uint8Array([
+ 112,
+ 90,
36,
18,
34,
@@ -10830,25 +10668,6 @@ export const DatabaseServiceDefinition = {
115,
101,
115,
- ]),
- ],
- },
- },
- },
- listDatabases: {
- name: "ListDatabases",
- requestType: ListDatabasesRequest,
- requestStream: false,
- responseType: ListDatabasesResponse,
- responseStream: false,
- options: {
- _unknownFields: {
- 8410: [new Uint8Array([0])],
- 800010: [new Uint8Array([17, 98, 98, 46, 100, 97, 116, 97, 98, 97, 115, 101, 115, 46, 108, 105, 115, 116])],
- 800016: [new Uint8Array([1])],
- 578365826: [
- new Uint8Array([
- 74,
90,
37,
18,
diff --git a/frontend/src/types/proto/v1/sql_service.ts b/frontend/src/types/proto/v1/sql_service.ts
index 3461a80045..bd39fe94fc 100644
--- a/frontend/src/types/proto/v1/sql_service.ts
+++ b/frontend/src/types/proto/v1/sql_service.ts
@@ -559,7 +559,7 @@ export interface SearchQueryHistoriesRequest {
* - database, for example:
* database = "instances/{instance}/databases/{database}"
* - instance, for example:
- * instance = "instance/{instance}"
+ * instance = "instances/{instance}"
* - type, for example:
* type = "QUERY"
*/
diff --git a/frontend/src/types/v1/database.ts b/frontend/src/types/v1/database.ts
index 6bca1c75c6..11c821c011 100644
--- a/frontend/src/types/v1/database.ts
+++ b/frontend/src/types/v1/database.ts
@@ -76,7 +76,9 @@ export const isValidDatabaseName = (name: any): name is string => {
return Boolean(
instanceName &&
instanceName !== String(UNKNOWN_ID) &&
+ instanceName !== String(EMPTY_ID) &&
databaseName &&
- databaseName !== String(UNKNOWN_ID)
+ databaseName !== String(UNKNOWN_ID) &&
+ databaseName !== String(EMPTY_ID)
);
};
diff --git a/frontend/src/utils/v1/advanced-search/common.ts b/frontend/src/utils/v1/advanced-search/common.ts
index 4bf1bc9a79..60c9d3a73a 100644
--- a/frontend/src/utils/v1/advanced-search/common.ts
+++ b/frontend/src/utils/v1/advanced-search/common.ts
@@ -143,11 +143,17 @@ export const getTsRangeFromSearchParams = (
* @param mutate true to mutate `params`. false to create a deep cloned copy. Default to false.
* @returns `params` itself or a deep-cloned copy.
*/
-export const upsertScope = (
- params: SearchParams,
- scopes: SearchScope | SearchScope[],
- mutate = false
-) => {
+export const upsertScope = ({
+ params,
+ scopes,
+ mutate = false,
+ allowMultiple = false,
+}: {
+ params: SearchParams;
+ scopes: SearchScope | SearchScope[];
+ mutate?: boolean;
+ allowMultiple?: boolean;
+}) => {
const target = mutate ? params : cloneDeep(params);
if (!Array.isArray(scopes)) {
scopes = [scopes];
@@ -158,7 +164,11 @@ export const upsertScope = (
if (!scope.value) {
pullAt(target.scopes, index);
} else {
- target.scopes[index].value = scope.value;
+ if (allowMultiple) {
+ target.scopes.push(scope);
+ } else {
+ target.scopes[index].value = scope.value;
+ }
}
} else {
if (scope.value) {
diff --git a/frontend/src/views/DatabaseDashboard.vue b/frontend/src/views/DatabaseDashboard.vue
index 4d4ae7129a..e93ef21683 100644
--- a/frontend/src/views/DatabaseDashboard.vue
+++ b/frontend/src/views/DatabaseDashboard.vue
@@ -9,11 +9,6 @@
:placeholder="$t('database.filter-database')"
:scope-options="scopeOptions"
/>
- <DatabaseLabelFilter
- v-model:selected="state.selectedLabels"
- :database-list="rawDatabaseList"
- :placement="'left-start'"
- />
<NButton
v-if="
allowToCreateDB && databaseChangeMode !== DatabaseChangeMode.EDITOR
@@ -30,15 +25,14 @@
<div class="space-y-2">
<DatabaseOperations :databases="selectedDatabases" />
-
- <DatabaseV1Table
+ <PagedDatabaseTable
mode="ALL"
- :loading="loading"
:bordered="false"
- :database-list="filteredDatabaseList"
- :custom-click="true"
- :keyword="state.params.query.trim().toLowerCase()"
- @row-click="handleDatabaseClick"
+ :filter="filter"
+ :parent="'workspaces/-'"
+ :footer-class="'mx-4'"
+ :custom-click="!!onClickDatabase"
+ @row-click="onClickDatabase"
@update:selected-databases="handleDatabasesSelectionChanged"
/>
</div>
@@ -56,34 +50,31 @@
<script lang="ts" setup>
import { PlusIcon } from "lucide-vue-next";
import { NButton } from "naive-ui";
-import { computed, onMounted, reactive, ref, watch } from "vue";
+import { computed, onMounted, reactive, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
import AdvancedSearch from "@/components/AdvancedSearch";
import { useCommonSearchScopeOptions } from "@/components/AdvancedSearch/useCommonSearchScopeOptions";
import { CreateDatabasePrepPanel } from "@/components/CreateDatabasePrepForm";
import { Drawer } from "@/components/v2";
-import DatabaseV1Table, {
- DatabaseLabelFilter,
+import {
+ PagedDatabaseTable,
DatabaseOperations,
} from "@/components/v2/Model/DatabaseV1Table";
import { useAppFeature, useDatabaseV1Store, useUIStateStore } from "@/store";
-import { projectNamePrefix } from "@/store/modules/v1/common";
-import { useDatabaseV1List } from "@/store/modules/v1/databaseList";
+import {
+ instanceNamePrefix,
+ projectNamePrefix,
+ environmentNamePrefix,
+} from "@/store/modules/v1/common";
import type { ComposedDatabase } from "@/types";
-import { DEFAULT_PROJECT_NAME } from "@/types";
+import { DEFAULT_PROJECT_NAME, isValidDatabaseName } from "@/types";
import { DatabaseChangeMode } from "@/types/proto/v1/setting_service";
import type { SearchParams } from "@/utils";
import {
- filterDatabaseV1ByKeyword,
- sortDatabaseV1List,
CommonFilterScopeIdList,
- extractEnvironmentResourceName,
- extractInstanceResourceName,
extractProjectResourceName,
buildSearchTextBySearchParams,
buildSearchParamsBySearchText,
- databaseV1Url,
- wrapRefAsPromise,
hasWorkspacePermissionV2,
} from "@/utils";
@@ -91,27 +82,21 @@ interface LocalState {
selectedDatabaseNameList: Set<string>;
params: SearchParams;
showCreateDrawer: boolean;
- selectedLabels: { key: string; value: string }[];
}
-const props = defineProps<{
- onClickDatabase?: (db: ComposedDatabase, event: MouseEvent) => void;
-}>();
-
-const emit = defineEmits<{
- (event: "ready"): void;
+defineProps<{
+ onClickDatabase?: (event: MouseEvent, db: ComposedDatabase) => void;
}>();
const route = useRoute();
const router = useRouter();
const uiStateStore = useUIStateStore();
+const databaseStore = useDatabaseV1Store();
const hideUnassignedDatabases = useAppFeature(
"bb.feature.databases.hide-unassigned"
);
const databaseChangeMode = useAppFeature("bb.feature.database-change-mode");
-const loading = ref(false);
-
const defaultSearchParams = () => {
const params: SearchParams = {
query: "",
@@ -138,7 +123,6 @@ const state = reactive<LocalState>({
selectedDatabaseNameList: new Set(),
showCreateDrawer: false,
params: initializeSearchParamsFromQuery(),
- selectedLabels: [],
});
const allowToCreateDB = computed(() => {
@@ -150,20 +134,53 @@ const allowToCreateDB = computed(() => {
const scopeOptions = useCommonSearchScopeOptions(
computed(() => state.params),
- [...CommonFilterScopeIdList, "project"]
+ [...CommonFilterScopeIdList, "project", "label"]
);
+const selectedLabels = computed(() => {
+ return state.params.scopes
+ .filter((scope) => scope.id === "label")
+ .map((scope) => scope.value);
+});
+
+const selectedProject = computed(() => {
+ const projectId = state.params.scopes.find(
+ (scope) => scope.id === "project"
+ )?.value;
+ if (!projectId) {
+ return;
+ }
+ return `${projectNamePrefix}${projectId}`;
+});
+
const selectedInstance = computed(() => {
- return state.params.scopes.find((scope) => scope.id === "instance")?.value;
+ const instanceId = state.params.scopes.find(
+ (scope) => scope.id === "instance"
+ )?.value;
+ if (!instanceId) {
+ return;
+ }
+ return `${instanceNamePrefix}${instanceId}`;
});
const selectedEnvironment = computed(() => {
- return state.params.scopes.find((scope) => scope.id === "environment")?.value;
+ const environmentId = state.params.scopes.find(
+ (scope) => scope.id === "environment"
+ )?.value;
+ if (!environmentId) {
+ return;
+ }
+ return `${environmentNamePrefix}${environmentId}`;
});
-const selectedProject = computed(() => {
- return state.params.scopes.find((scope) => scope.id === "project")?.value;
-});
+const filter = computed(() => ({
+ instance: selectedInstance.value,
+ environment: selectedEnvironment.value,
+ project: selectedProject.value,
+ query: state.params.query,
+ labels: selectedLabels.value,
+ excludeUnassigned: hideUnassignedDatabases.value,
+}));
onMounted(() => {
if (!uiStateStore.getIntroStateByKey("database.visit")) {
@@ -174,76 +191,10 @@ onMounted(() => {
}
});
-watch(
- () => selectedProject.value,
- async () => {
- loading.value = true;
- let parent = undefined;
- if (selectedProject.value) {
- parent = `${projectNamePrefix}${selectedProject.value}`;
- }
- await wrapRefAsPromise(
- useDatabaseV1List(parent).ready,
- /* expected */ true
- );
- loading.value = false;
- emit("ready");
- },
- {
- immediate: true,
- }
-);
-
-const rawDatabaseList = computed(() => {
- return useDatabaseV1Store().databaseList;
-});
-
-const filteredDatabaseList = computed(() => {
- let list = rawDatabaseList.value;
- if (selectedEnvironment.value) {
- list = list.filter(
- (db) =>
- extractEnvironmentResourceName(db.effectiveEnvironment) ===
- selectedEnvironment.value
- );
- }
- if (selectedInstance.value) {
- list = list.filter(
- (db) =>
- extractInstanceResourceName(db.instance) === selectedInstance.value
- );
- }
- if (selectedProject.value) {
- list = list.filter(
- (db) => extractProjectResourceName(db.project) === selectedProject.value
- );
- }
- if (state.selectedLabels.length > 0) {
- list = list.filter((db) => {
- return state.selectedLabels.some((kv) => db.labels[kv.key] === kv.value);
- });
- }
- if (hideUnassignedDatabases.value) {
- list = list.filter((db) => db.projectEntity.name !== DEFAULT_PROJECT_NAME);
- }
- const keyword = state.params.query.trim().toLowerCase();
- if (keyword) {
- list = list.filter((db) =>
- filterDatabaseV1ByKeyword(db, keyword, [
- "name",
- "environment",
- "instance",
- "project",
- ])
- );
- }
- return sortDatabaseV1List(list);
-});
-
const selectedDatabases = computed((): ComposedDatabase[] => {
- return filteredDatabaseList.value.filter((db) =>
- state.selectedDatabaseNameList.has(db.name)
- );
+ return [...state.selectedDatabaseNameList]
+ .map((databaseName) => databaseStore.getDatabaseByName(databaseName))
+ .filter((database) => isValidDatabaseName(database.name));
});
const handleDatabasesSelectionChanged = (
@@ -252,20 +203,6 @@ const handleDatabasesSelectionChanged = (
state.selectedDatabaseNameList = selectedDatabaseNameList;
};
-const handleDatabaseClick = (event: MouseEvent, database: ComposedDatabase) => {
- if (props.onClickDatabase) {
- props.onClickDatabase(database, event);
- return;
- }
-
- const url = databaseV1Url(database);
- if (event.ctrlKey || event.metaKey) {
- window.open(url, "_blank");
- } else {
- router.push(url);
- }
-};
-
watch(
() => state.params,
() => {
diff --git a/frontend/src/views/DatabaseDetail/DatabaseDetail.vue b/frontend/src/views/DatabaseDetail/DatabaseDetail.vue
index b3ba8d9b9d..ed1c3fcc41 100644
--- a/frontend/src/views/DatabaseDetail/DatabaseDetail.vue
+++ b/frontend/src/views/DatabaseDetail/DatabaseDetail.vue
@@ -198,11 +198,11 @@
</template>
<script lang="ts" setup>
-import { useTitle } from "@vueuse/core";
+import { computedAsync, useTitle } from "@vueuse/core";
import dayjs from "dayjs";
import { ArrowRightLeftIcon } from "lucide-vue-next";
import { NButton, NTabPane, NTabs } from "naive-ui";
-import { computed, reactive, watch, ref, onMounted } from "vue";
+import { computed, reactive, watch, ref, watchEffect } from "vue";
import { useRouter, useRoute } from "vue-router";
import { BBModal } from "@/bbkit";
import SchemaEditorModal from "@/components/AlterSchemaPrepForm/SchemaEditorModal.vue";
@@ -237,7 +237,12 @@ import {
databaseNamePrefix,
instanceNamePrefix,
} from "@/store/modules/v1/common";
-import { UNKNOWN_PROJECT_NAME, unknownEnvironment } from "@/types";
+import {
+ UNKNOWN_PROJECT_NAME,
+ unknownEnvironment,
+ unknownDatabase,
+ isValidDatabaseName,
+} from "@/types";
import type { Anomaly } from "@/types/proto/v1/anomaly_service";
import { State } from "@/types/proto/v1/common";
import { DatabaseChangeMode } from "@/types/proto/v1/setting_service";
@@ -302,13 +307,6 @@ const disableSchemaEditor = useAppFeature(
);
const databaseChangeMode = useAppFeature("bb.feature.database-change-mode");
-onMounted(async () => {
- anomalyList.value = await useAnomalyV1Store().fetchAnomalyList(
- database.value.project,
- { database: database.value.name }
- );
-});
-
watch(
() => route.hash,
(hash) => {
@@ -331,13 +329,23 @@ watch(
{ immediate: true }
);
-const database = computed(() => {
- return databaseV1Store.getDatabaseByName(
+const database = computedAsync(async () => {
+ return databaseV1Store.getOrFetchDatabaseByName(
`${instanceNamePrefix}${props.instanceId}/${databaseNamePrefix}${props.databaseName}`
);
-});
+}, unknownDatabase());
+
const project = computed(() => database.value.projectEntity);
+watchEffect(async () => {
+ if (isValidDatabaseName(database.value.name)) {
+ anomalyList.value = await useAnomalyV1Store().fetchAnomalyList(
+ database.value.project,
+ { database: database.value.name }
+ );
+ }
+});
+
const hasSchemaDiagramFeature = computed((): boolean => {
return instanceV1HasAlterSchema(database.value.instanceResource);
});
diff --git a/frontend/src/views/InstanceDetail.vue b/frontend/src/views/InstanceDetail.vue
index e5d5013bf1..bdfd8ad89c 100644
--- a/frontend/src/views/InstanceDetail.vue
+++ b/frontend/src/views/InstanceDetail.vue
@@ -47,21 +47,14 @@
:scope-options="scopeOptions"
:readonly-scopes="readonlyScopes"
/>
- <DatabaseLabelFilter
- v-model:selected="state.selectedLabels"
- :database-list="databaseList"
- :placement="'left-start'"
- />
</div>
<DatabaseOperations :databases="selectedDatabases" />
- <DatabaseV1Table
- :key="`database-table.${instanceId}`"
+ <PagedDatabaseTable
mode="INSTANCE"
+ :footer-class="'pb-4'"
:show-selection="true"
- :database-list="filteredDatabaseList"
- :custom-click="true"
- :keyword="state.params.query.trim().toLowerCase()"
- @row-click="handleDatabaseClick"
+ :filter="filter"
+ :parent="instance.name"
@update:selected-databases="handleDatabasesSelectionChanged"
/>
</div>
@@ -103,32 +96,30 @@ import {
Buttons as InstanceFormButtons,
} from "@/components/InstanceForm/";
import { InstanceRoleTable, Drawer } from "@/components/v2";
-import DatabaseV1Table, {
+import {
+ PagedDatabaseTable,
DatabaseOperations,
- DatabaseLabelFilter,
} from "@/components/v2/Model/DatabaseV1Table";
import { useBodyLayoutContext } from "@/layouts/common";
import {
pushNotification,
- useDBSchemaV1Store,
+ useDatabaseV1Store,
useInstanceV1Store,
useEnvironmentV1Store,
useAppFeature,
} from "@/store";
-import { instanceNamePrefix } from "@/store/modules/v1/common";
-import { useDatabaseV1List } from "@/store/modules/v1/databaseList";
-import { UNKNOWN_ID, type ComposedDatabase } from "@/types";
+import {
+ instanceNamePrefix,
+ projectNamePrefix,
+ environmentNamePrefix,
+} from "@/store/modules/v1/common";
+import { type ComposedDatabase, isValidDatabaseName } from "@/types";
import { State } from "@/types/proto/v1/common";
import { DatabaseChangeMode } from "@/types/proto/v1/setting_service";
import {
instanceV1HasCreateDatabase,
instanceV1Name,
- wrapRefAsPromise,
- autoDatabaseRoute,
CommonFilterScopeIdList,
- filterDatabaseV1ByKeyword,
- extractEnvironmentResourceName,
- extractProjectResourceName,
} from "@/utils";
import type { SearchParams, SearchScope } from "@/utils";
@@ -141,7 +132,6 @@ interface LocalState {
showCreateDatabaseModal: boolean;
syncingSchema: boolean;
selectedDatabaseNameList: Set<string>;
- selectedLabels: { key: string; value: string }[];
params: SearchParams;
selectedTab: InstanceHash;
}
@@ -164,6 +154,7 @@ if (!props.embedded) {
const { t } = useI18n();
const router = useRouter();
const instanceV1Store = useInstanceV1Store();
+const databaseStore = useDatabaseV1Store();
const databaseChangeMode = useAppFeature("bb.feature.database-change-mode");
const readonlyScopes = computed((): SearchScope[] => [
@@ -174,7 +165,6 @@ const state = reactive<LocalState>({
showCreateDatabaseModal: false,
syncingSchema: false,
selectedDatabaseNameList: new Set(),
- selectedLabels: [],
params: {
query: "",
scopes: [...readonlyScopes.value],
@@ -186,7 +176,7 @@ const route = useRoute();
const scopeOptions = useCommonSearchScopeOptions(
computed(() => state.params),
- [...CommonFilterScopeIdList, "project"]
+ [...CommonFilterScopeIdList, "project", "label"]
);
watch(
@@ -223,55 +213,39 @@ const environment = computed(() => {
);
});
-const { databaseList, listCache, ready } = useDatabaseV1List(
- instance.value.name
-);
-
const selectedEnvironment = computed(() => {
- return (
- state.params.scopes.find((scope) => scope.id === "environment")?.value ??
- `${UNKNOWN_ID}`
- );
+ const environmentId = state.params.scopes.find(
+ (scope) => scope.id === "environment"
+ )?.value;
+ if (!environmentId) {
+ return;
+ }
+ return `${environmentNamePrefix}${environmentId}`;
});
const selectedProject = computed(() => {
- return state.params.scopes.find((scope) => scope.id === "project")?.value;
+ const projectId = state.params.scopes.find(
+ (scope) => scope.id === "project"
+ )?.value;
+ if (!projectId) {
+ return;
+ }
+ return `${projectNamePrefix}${projectId}`;
});
-const filteredDatabaseList = computed(() => {
- let list = databaseList.value;
- if (selectedEnvironment.value !== `${UNKNOWN_ID}`) {
- list = list.filter(
- (db) =>
- extractEnvironmentResourceName(db.effectiveEnvironment) ===
- selectedEnvironment.value
- );
- }
- if (selectedProject.value) {
- list = list.filter(
- (db) => extractProjectResourceName(db.project) === selectedProject.value
- );
- }
- const keyword = state.params.query.trim().toLowerCase();
- if (keyword) {
- list = list.filter((db) =>
- filterDatabaseV1ByKeyword(db, keyword, [
- "name",
- "environment",
- "instance",
- "project",
- ])
- );
- }
- const labels = state.selectedLabels;
- if (labels.length > 0) {
- list = list.filter((db) => {
- return labels.some((kv) => db.labels[kv.key] === kv.value);
- });
- }
- return list;
+const selectedLabels = computed(() => {
+ return state.params.scopes
+ .filter((scope) => scope.id === "label")
+ .map((scope) => scope.value);
});
+const filter = computed(() => ({
+ environment: selectedEnvironment.value,
+ project: selectedProject.value,
+ query: state.params.query,
+ labels: selectedLabels.value,
+}));
+
const instanceRoleList = computed(() => {
return instance.value.roles;
});
@@ -287,16 +261,7 @@ const allowCreateDatabase = computed(() => {
const syncSchema = async (enableFullSync: boolean) => {
await instanceV1Store.syncInstance(instance.value.name, enableFullSync);
// Remove the database list cache for the instance.
- listCache.deleteCache(instance.value.name);
- await wrapRefAsPromise(ready, true);
- if (enableFullSync) {
- // Clear the db schema metadata cache entities.
- // So we will re-fetch new values when needed.
- const dbSchemaStore = useDBSchemaV1Store();
- databaseList.value.forEach((database) =>
- dbSchemaStore.removeCache(database.name)
- );
- }
+ databaseStore.removeCacheByInstance(instance.value.name);
pushNotification({
module: "bytebase",
style: "SUCCESS",
@@ -313,15 +278,6 @@ const createDatabase = () => {
useTitle(instance.value.title);
-const handleDatabaseClick = (event: MouseEvent, database: ComposedDatabase) => {
- const url = router.resolve(autoDatabaseRoute(router, database)).fullPath;
- if (event.ctrlKey || event.metaKey) {
- window.open(url, "_blank");
- } else {
- router.push(url);
- }
-};
-
const handleDatabasesSelectionChanged = (
selectedDatabaseNameList: Set<string>
): void => {
@@ -329,8 +285,8 @@ const handleDatabasesSelectionChanged = (
};
const selectedDatabases = computed((): ComposedDatabase[] => {
- return databaseList.value.filter((db) =>
- state.selectedDatabaseNameList.has(db.name)
- );
+ return [...state.selectedDatabaseNameList]
+ .map((databaseName) => databaseStore.getDatabaseByName(databaseName))
+ .filter((database) => isValidDatabaseName(database.name));
});
</script>
diff --git a/frontend/src/views/MyIssues.vue b/frontend/src/views/MyIssues.vue
index 44d48a93d7..84b96e189d 100644
--- a/frontend/src/views/MyIssues.vue
+++ b/frontend/src/views/MyIssues.vue
@@ -285,48 +285,60 @@ const mergeSearchParamsByTab = (params: SearchParams, tab: TabValue) => {
const myEmail = me.value.email;
if (tab === "CREATED") {
- return upsertScope(common, {
- id: "creator",
- value: myEmail,
+ return upsertScope({
+ params: common,
+ scopes: {
+ id: "creator",
+ value: myEmail,
+ },
});
}
if (tab === "SUBSCRIBED") {
- return upsertScope(common, {
- id: "subscriber",
- value: myEmail,
+ return upsertScope({
+ params: common,
+ scopes: {
+ id: "subscriber",
+ value: myEmail,
+ },
});
}
if (tab === "WAITING_APPROVAL") {
- return upsertScope(common, [
- {
- id: "status",
- value: "OPEN",
- },
- {
- id: "approval",
- value: "pending",
- },
- {
- id: "approver",
- value: myEmail,
- },
- ]);
+ return upsertScope({
+ params: common,
+ scopes: [
+ {
+ id: "status",
+ value: "OPEN",
+ },
+ {
+ id: "approval",
+ value: "pending",
+ },
+ {
+ id: "approver",
+ value: myEmail,
+ },
+ ],
+ });
}
if (tab === "WAITING_ROLLOUT") {
- return upsertScope(common, [
- {
- id: "status",
- value: "OPEN",
- },
- {
- id: "approval",
- value: "approved",
- },
- {
- id: "releaser",
- value: myEmail,
- },
- ]);
+ return upsertScope({
+ params: common,
+ scopes: [
+ {
+ id: "status",
+ value: "OPEN",
+ },
+ {
+ id: "approval",
+ value: "approved",
+ },
+ {
+ id: "releaser",
+ value: myEmail,
+ },
+ ],
+ });
}
console.error("[mergeSearchParamsByTab] should never reach this line", tab);
return common;
@@ -479,14 +491,14 @@ watch(
() => {
if (tab.value === "WAITING_APPROVAL" || tab.value === "WAITING_ROLLOUT") {
if (getValueFromSearchParams(state.params, "status") === "CLOSED") {
- upsertScope(
- state.params,
- {
+ upsertScope({
+ params: state.params,
+ scopes: {
id: "status",
value: "OPEN",
},
- true /* mutate */
- );
+ mutate: true,
+ });
}
}
},
diff --git a/frontend/src/views/ProjectDashboard.vue b/frontend/src/views/ProjectDashboard.vue
index 1a833370e9..71e84e81b4 100644
--- a/frontend/src/views/ProjectDashboard.vue
+++ b/frontend/src/views/ProjectDashboard.vue
@@ -18,20 +18,13 @@
{{ $t("quick-action.new-project") }}
</NButton>
</div>
- <PagedTable
- ref="projectPagedTable"
+ <PagedProjectTable
session-key="bb.project-table"
- :fetch-list="fetchProjects"
+ :search="state.searchText"
:footer-class="'mx-4'"
- >
- <template #table="{ list, loading }">
- <ProjectV1Table
- :bordered="false"
- :loading="loading"
- :project-list="list"
- />
- </template>
- </PagedTable>
+ :bordered="false"
+ :include-default="false"
+ />
</div>
<Drawer
:auto-focus="true"
@@ -44,17 +37,13 @@
</template>
<script lang="ts" setup>
-import { useDebounceFn } from "@vueuse/core";
import { PlusIcon } from "lucide-vue-next";
import { NButton } from "naive-ui";
-import { onMounted, reactive, ref, watch } from "vue";
-import type { ComponentExposed } from "vue-component-type-helpers";
+import { onMounted, reactive } from "vue";
import ProjectCreatePanel from "@/components/Project/ProjectCreatePanel.vue";
-import { SearchBox, ProjectV1Table } from "@/components/v2";
+import { SearchBox, PagedProjectTable } from "@/components/v2";
import { Drawer } from "@/components/v2";
-import PagedTable from "@/components/v2/Model/PagedTable.vue";
-import { useUIStateStore, useProjectV1Store } from "@/store";
-import { DEFAULT_PROJECT_NAME, type ComposedProject } from "@/types";
+import { useUIStateStore } from "@/store";
import { hasWorkspacePermissionV2 } from "@/utils";
interface LocalState {
@@ -66,9 +55,6 @@ const state = reactive<LocalState>({
searchText: "",
showCreateDrawer: false,
});
-const projectStore = useProjectV1Store();
-const projectPagedTable =
- ref<ComponentExposed<typeof PagedTable<ComposedProject>>>();
onMounted(() => {
const uiStateStore = useUIStateStore();
@@ -79,30 +65,4 @@ onMounted(() => {
});
}
});
-
-const fetchProjects = async ({
- pageToken,
- pageSize,
-}: {
- pageToken: string;
- pageSize: number;
-}) => {
- const { nextPageToken, projects } = await projectStore.fetchProjectList({
- showDeleted: false,
- pageToken,
- pageSize,
- query: state.searchText,
- });
- return {
- nextPageToken: nextPageToken ?? "",
- list: projects.filter((project) => project.name !== DEFAULT_PROJECT_NAME),
- };
-};
-
-watch(
- () => state.searchText,
- useDebounceFn(async () => {
- await projectPagedTable.value?.refresh();
- }, 500)
-);
</script>
diff --git a/frontend/src/views/project/ProjectDatabaseDashboard.vue b/frontend/src/views/project/ProjectDatabaseDashboard.vue
index 9789589c57..d606aadff2 100644
--- a/frontend/src/views/project/ProjectDatabaseDashboard.vue
+++ b/frontend/src/views/project/ProjectDatabaseDashboard.vue
@@ -1,13 +1,12 @@
<template>
- <ProjectDatabasesPanel :project="project" :database-list="databaseV1List" />
+ <ProjectDatabasesPanel :project="project" />
</template>
<script lang="ts" setup>
import { computed } from "vue";
import ProjectDatabasesPanel from "@/components/ProjectDatabasesPanel.vue";
-import { useDatabaseV1Store, useAppFeature, useProjectByName } from "@/store";
+import { useProjectByName } from "@/store";
import { projectNamePrefix } from "@/store/modules/v1/common";
-import { sortDatabaseV1List, isDatabaseV1Alterable } from "@/utils";
const props = defineProps<{
projectId: string;
@@ -16,17 +15,4 @@ const props = defineProps<{
const { project } = useProjectByName(
computed(() => `${projectNamePrefix}${props.projectId}`)
);
-const hideInalterableDatabases = useAppFeature(
- "bb.feature.databases.hide-inalterable"
-);
-
-const databaseV1List = computed(() => {
- let list = useDatabaseV1Store().databaseListByProject(project.value.name);
- list = sortDatabaseV1List(list);
- // If embedded in iframe, only show alterable databases.
- if (hideInalterableDatabases.value) {
- list = list.filter((db) => isDatabaseV1Alterable(db));
- }
- return list;
-});
</script>
diff --git a/frontend/src/views/project/ProjectDatabaseGroupDetail.vue b/frontend/src/views/project/ProjectDatabaseGroupDetail.vue
index 653c12967d..44b4e98a8b 100644
--- a/frontend/src/views/project/ProjectDatabaseGroupDetail.vue
+++ b/frontend/src/views/project/ProjectDatabaseGroupDetail.vue
@@ -72,7 +72,7 @@
:enable-raw-expression="true"
:factor-list="FactorList"
:factor-support-dropdown="factorSupportDropdown"
- :option-config-map="getDatabaseGroupOptionConfigMap(project)"
+ :option-config-map="getDatabaseGroupOptionConfigMap()"
/>
</div>
<div class="col-span-2">
diff --git a/frontend/src/views/sql-editor/AsidePanel/AsidePanel.vue b/frontend/src/views/sql-editor/AsidePanel/AsidePanel.vue
index 5b3f6ced1f..31d4245cf7 100644
--- a/frontend/src/views/sql-editor/AsidePanel/AsidePanel.vue
+++ b/frontend/src/views/sql-editor/AsidePanel/AsidePanel.vue
@@ -16,7 +16,7 @@
style="width: 100%"
class="project-select"
:menu-props="{ class: 'project-select-menu' }"
- :project-name="projectName"
+ :project-name="project"
:include-all="false"
:include-default-project="allowAccessDefaultProject"
:loading="!projectContextReady"
@@ -85,10 +85,6 @@ const containerRef = ref<HTMLDivElement>();
const { width: containerWidth } = useElementSize(containerRef);
const hideProjects = useAppFeature("bb.feature.sql-editor.hide-projects");
-const projectName = computed(() => {
- return editorStore.project ?? null;
-});
-
const allowAccessDefaultProject = computed(() => {
return hasProjectPermissionV2(defaultProject(), "bb.projects.get");
});
diff --git a/frontend/src/views/sql-editor/AsidePanel/HistoryPane/HistoryConnectionIcon.vue b/frontend/src/views/sql-editor/AsidePanel/HistoryPane/HistoryConnectionIcon.vue
index 6f50b1a95e..fb68b0fde4 100644
--- a/frontend/src/views/sql-editor/AsidePanel/HistoryPane/HistoryConnectionIcon.vue
+++ b/frontend/src/views/sql-editor/AsidePanel/HistoryPane/HistoryConnectionIcon.vue
@@ -8,10 +8,10 @@
</template>
<script setup lang="ts">
-import { computed } from "vue";
+import { computedAsync } from "@vueuse/core";
import { InstanceV1EngineIcon } from "@/components/v2";
import { useDatabaseV1Store } from "@/store";
-import { isValidInstanceName } from "@/types";
+import { isValidInstanceName, unknownInstance } from "@/types";
import type { QueryHistory } from "@/types/proto/v1/sql_service";
import { extractDatabaseResourceName } from "@/utils";
@@ -19,9 +19,9 @@ const props = defineProps<{
queryHistory: QueryHistory;
}>();
-const instance = computed(() => {
+const instance = computedAsync(async () => {
const { database } = extractDatabaseResourceName(props.queryHistory.database);
- const d = useDatabaseV1Store().getDatabaseByName(database);
+ const d = await useDatabaseV1Store().getOrFetchDatabaseByName(database);
return d.instanceResource;
-});
+}, unknownInstance());
</script>
diff --git a/frontend/src/views/sql-editor/AsidePanel/WorksheetPane/SheetList/SheetList.vue b/frontend/src/views/sql-editor/AsidePanel/WorksheetPane/SheetList/SheetList.vue
index bdeb93955f..e1c03dc341 100644
--- a/frontend/src/views/sql-editor/AsidePanel/WorksheetPane/SheetList/SheetList.vue
+++ b/frontend/src/views/sql-editor/AsidePanel/WorksheetPane/SheetList/SheetList.vue
@@ -44,6 +44,7 @@ const emit = defineEmits<{
const { isInitialized, isLoading, sheetList, fetchSheetList } =
useSheetContextByView(props.view);
+const databaseStore = useDatabaseV1Store();
const filteredWorksheetList = computed(() => {
let sheets = sheetList.value;
@@ -68,7 +69,7 @@ const sortedWorksheetList = computed(() => {
if (!worksheet.database) {
return Number.MAX_VALUE;
}
- const db = useDatabaseV1Store().getDatabaseByName(worksheet.database);
+ const db = databaseStore.getDatabaseByName(worksheet.database);
if (!isValidDatabaseName(db.name)) {
return Number.MAX_VALUE;
}
diff --git a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/ConnectionPane.vue b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/ConnectionPane.vue
index 350b3e94c1..cdb6038fd9 100644
--- a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/ConnectionPane.vue
+++ b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/ConnectionPane.vue
@@ -1,14 +1,21 @@
<template>
<div class="sql-editor-tree gap-y-1 h-full flex flex-col relative">
<div class="flex flex-row gap-x-0.5 px-1 items-center">
- <SearchBox v-model:search-pattern="searchPattern" class="flex-1" />
- <GroupingBar class="shrink-0" />
+ <SearchBox
+ :loading="editrStore.loading"
+ v-model:search-pattern="searchPattern"
+ class="flex-1"
+ />
+ <GroupingBar :disabled="editrStore.loading" class="shrink-0" />
</div>
<div
v-if="hasMissingQueryDatabases"
class="flex items-center space-x-2 px-2 py-2"
>
- <NCheckbox v-model:checked="showMissingQueryDatabases">
+ <NCheckbox
+ :disabled="editrStore.loading"
+ v-model:checked="showMissingQueryDatabases"
+ >
<span class="textinfolabel text-sm">
{{ $t("sql-editor.show-databases-without-query-permission") }}
</span>
@@ -59,12 +66,11 @@
</template>
<script lang="ts" setup>
-import { useElementSize, useMounted } from "@vueuse/core";
+import { computedAsync, useElementSize, useMounted } from "@vueuse/core";
import { head } from "lodash-es";
import { NTree, NDropdown, NCheckbox, type TreeOption } from "naive-ui";
import { storeToRefs } from "pinia";
-import { ref, computed, nextTick, watch, h } from "vue";
-import { onMounted } from "vue";
+import { ref, nextTick, watch, h, onMounted } from "vue";
import MaskSpinner from "@/components/misc/MaskSpinner.vue";
import { useEmitteryEventListener } from "@/composables/useEmitteryEventListener";
import {
@@ -73,6 +79,7 @@ import {
useSQLEditorTabStore,
resolveOpeningDatabaseListFromSQLEditorTabList,
useSQLEditorTreeStore,
+ useSQLEditorStore,
idForSQLEditorTreeNodeTarget,
useConnectionOfCurrentSQLEditorTab,
useInstanceResourceByName,
@@ -103,6 +110,7 @@ import { setConnection, useDropdown } from "./actions";
const treeStore = useSQLEditorTreeStore();
const tabStore = useSQLEditorTabStore();
+const editrStore = useSQLEditorStore();
const databaseStore = useDatabaseV1Store();
const isLoggedIn = useIsLoggedIn();
@@ -135,15 +143,22 @@ const { height: treeContainerHeight } = useElementSize(
const treeRef = ref<InstanceType<typeof NTree>>();
const searchPattern = ref("");
+watch(
+ () => searchPattern.value,
+ (search) => editrStore.prepareDatabases(search)
+);
+
// Highlight the current tab's connection node.
-const selectedKeys = computed(() => {
+const selectedKeys = computedAsync(async () => {
const connection = tabStore.currentTab?.connection;
if (!connection) {
return [];
}
if (connection.database) {
- const database = databaseStore.getDatabaseByName(connection.database);
+ const database = await databaseStore.getOrFetchDatabaseByName(
+ connection.database
+ );
const node = head(treeStore.nodesByTarget("database", database));
if (!node) return [];
return [node.key];
@@ -153,7 +168,7 @@ const selectedKeys = computed(() => {
return nodes.map((node) => node.key);
}
return [];
-});
+}, []);
const { expandedKeys, hasMissingQueryDatabases, showMissingQueryDatabases } =
storeToRefs(treeStore);
const upsertExpandedKeys = (key: string) => {
diff --git a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/SearchBox/index.vue b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/SearchBox/index.vue
index cccd29df3b..d26713313b 100644
--- a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/SearchBox/index.vue
+++ b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/SearchBox/index.vue
@@ -29,7 +29,7 @@ import { NAutoComplete } from "naive-ui";
import { computed, watchEffect, h, ref } from "vue";
import { useI18n } from "vue-i18n";
import { EnvironmentV1Name, InstanceV1EngineIcon } from "@/components/v2";
-import { useDatabaseV1Store } from "@/store";
+import { useDatabaseV1Store, batchGetOrFetchDatabases } from "@/store";
import type { CoreSQLEditorTab } from "@/types";
import { DEFAULT_SQL_EDITOR_TAB_MODE, isValidDatabaseName } from "@/types";
import {
@@ -127,8 +127,8 @@ const renderLabel = (option: SelectOption) => {
);
};
-const handleDatabaseSelect = (databaseName: string) => {
- const database = databaseStore.getDatabaseByName(databaseName);
+const handleDatabaseSelect = async (databaseName: string) => {
+ const database = await databaseStore.getOrFetchDatabaseByName(databaseName);
const coreTab: CoreSQLEditorTab = {
connection: {
...emptySQLEditorConnection(),
@@ -147,15 +147,6 @@ const handleEscapeKey = (_e: KeyboardEvent) => {
};
watchEffect(async () => {
- for (const databaseName of searchHistory.value) {
- try {
- await databaseStore.getOrFetchDatabaseByName(
- databaseName,
- true /* silent */
- );
- } catch {
- // nothing
- }
- }
+ await batchGetOrFetchDatabases(searchHistory.value);
});
</script>
diff --git a/frontend/src/views/sql-editor/EditorCommon/BatchQueryDatabasesSelector.vue b/frontend/src/views/sql-editor/EditorCommon/BatchQueryDatabasesSelector.vue
index 8268e41c64..e33e74882b 100644
--- a/frontend/src/views/sql-editor/EditorCommon/BatchQueryDatabasesSelector.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/BatchQueryDatabasesSelector.vue
@@ -11,7 +11,7 @@
<NButton
size="small"
:type="
- selectedDatabaseNames.length > 0 && hasBatchQueryFeature
+ state.selectedDatabaseNames.length > 0 && hasBatchQueryFeature
? 'primary'
: 'default'
"
@@ -33,60 +33,55 @@
<p class="text-gray-500 mb-1 w-full leading-4">
{{
$t("sql-editor.batch-query.description", {
- count: selectedDatabaseNames.length,
+ count: state.selectedDatabaseNames.length,
project: project.title,
})
}}
</p>
<div class="w-full flex flex-col justify-start items-start">
- <template v-if="databases.length > 0">
- <div
- class="w-full mt-1 flex flex-row justify-start items-start flex-wrap gap-2"
+ <div
+ class="w-full mt-1 flex flex-row justify-start items-start flex-wrap gap-2"
+ >
+ <p v-if="state.selectedDatabaseNames.length === 0">
+ {{ $t("sql-editor.batch-query.select-database") }}
+ </p>
+ <NTag
+ v-for="databaseName in state.selectedDatabaseNames"
+ :key="databaseName"
+ closable
+ @close="() => handleUncheckDatabaseRow(databaseName)"
>
- <p v-if="selectedDatabaseNames.length === 0">
- {{ $t("sql-editor.batch-query.select-database") }}
- </p>
- <NTag
- v-for="databaseName in selectedDatabaseNames"
- :key="databaseName"
- closable
- @close="() => handleUncheckDatabaseRow(databaseName)"
- >
- <div class="flex flex-row justify-center items-center">
- <InstanceV1EngineIcon
- :instance="
- databaseStore.getDatabaseByName(databaseName)
- .instanceResource
- "
- />
- <span class="text-sm text-control-light mx-1">
- {{
- databaseStore.getDatabaseByName(databaseName)
- .effectiveEnvironmentEntity.title
- }}
- </span>
- {{ databaseStore.getDatabaseByName(databaseName).databaseName }}
- </div>
- </NTag>
- </div>
- <NDivider class="!my-3" />
- </template>
+ <div class="flex flex-row justify-center items-center">
+ <InstanceV1EngineIcon
+ :instance="
+ databaseStore.getDatabaseByName(databaseName).instanceResource
+ "
+ />
+ <span class="text-sm text-control-light mx-1">
+ {{
+ databaseStore.getDatabaseByName(databaseName)
+ .effectiveEnvironmentEntity.title
+ }}
+ </span>
+ {{ databaseStore.getDatabaseByName(databaseName).databaseName }}
+ </div>
+ </NTag>
+ </div>
+ <NDivider class="!my-3" />
<div class="w-full flex flex-row justify-end items-center mb-3">
<SearchBox
v-model:value="state.keyword"
:placeholder="$t('sql-editor.search-databases')"
/>
</div>
- <NDataTable
- size="small"
- class="batch-query-database-table"
- :checked-row-keys="selectedDatabaseNames"
- :columns="dataTableColumns"
- :data="filteredDatabaseList"
- :max-height="640"
- :virtual-scroll="true"
- :row-key="(row: ComposedDatabase) => row.name"
- @update:checked-row-keys="handleDatabaseRowCheck"
+ <PagedDatabaseTable
+ mode="PROJECT_SHORT"
+ :show-selection="true"
+ :filter="filter"
+ :parent="project.name"
+ :schemaless="true"
+ :selected-database-names="state.selectedDatabaseNames"
+ @update:selected-databases="handleDatabaseRowCheck"
/>
</div>
</div>
@@ -101,21 +96,11 @@
<script lang="ts" setup>
import { SquareStackIcon } from "lucide-vue-next";
-import type { DataTableRowKey, DataTableColumn } from "naive-ui";
-import {
- NPopover,
- NDivider,
- NDataTable,
- NTag,
- NButton,
- NPerformantEllipsis,
-} from "naive-ui";
-import { computed, reactive, ref, watch } from "vue";
-import { h } from "vue";
-import { useI18n } from "vue-i18n";
+import { NPopover, NDivider, NTag, NButton } from "naive-ui";
+import { computed, reactive, watch } from "vue";
import { FeatureBadge, FeatureModal } from "@/components/FeatureGuard";
import { InstanceV1EngineIcon, SearchBox } from "@/components/v2";
-import { DatabaseLabelsCell } from "@/components/v2/Model/DatabaseV1Table/cells";
+import { PagedDatabaseTable } from "@/components/v2/Model/DatabaseV1Table";
import {
hasFeature,
useAppFeature,
@@ -123,25 +108,24 @@ import {
useDatabaseV1Store,
useSQLEditorTabStore,
} from "@/store/modules";
-import { isValidDatabaseName, type ComposedDatabase } from "@/types";
-import { isDatabaseV1Queryable } from "@/utils";
+import { isValidDatabaseName } from "@/types";
interface LocalState {
keyword: string;
showFeatureModal: boolean;
+ selectedDatabaseNames: string[];
}
-const { t } = useI18n();
const databaseStore = useDatabaseV1Store();
const tabStore = useSQLEditorTabStore();
const state = reactive<LocalState>({
keyword: "",
showFeatureModal: false,
+ selectedDatabaseNames: [],
});
// Save the stringified label key-value pairs.
const currentTab = computed(() => tabStore.currentTab);
const { database: selectedDatabase } = useConnectionOfCurrentSQLEditorTab();
-const selectedDatabaseNames = ref<string[]>([]);
const hasBatchQueryFeature = hasFeature("bb.feature.batch-query");
const disallowBatchQuery = useAppFeature(
"bb.feature.sql-editor.disallow-batch-query"
@@ -150,22 +134,9 @@ const { database } = useConnectionOfCurrentSQLEditorTab();
const project = computed(() => selectedDatabase.value.projectEntity);
-const databases = computed(() => {
- return (
- databaseStore
- .databaseListByProject(project.value.name)
- // Don't show the currently selected database.
- .filter((db) => db.name !== selectedDatabase.value.name)
- // Only show databases that the user has permission to query.
- .filter((db) => isDatabaseV1Queryable(db))
- // Only show databases with same engine.
- .filter(
- (db) =>
- db.instanceResource.engine ===
- selectedDatabase.value.instanceResource.engine
- )
- );
-});
+const filter = computed(() => ({
+ query: state.keyword,
+}));
const showBatchQuerySelector = computed(() => {
if (disallowBatchQuery.value) {
@@ -181,102 +152,12 @@ const showBatchQuerySelector = computed(() => {
);
});
-const filteredDatabaseList = computed(() => {
- const keyword = state.keyword.trim();
- if (!keyword) {
- return databases.value;
- }
- return databases.value.filter((db) => {
- if (db.databaseName.toLowerCase().includes(keyword)) {
- return true;
- }
- for (const key in db.labels) {
- const value = db.labels[key];
- if (value.toLowerCase().includes(keyword)) {
- return true;
- }
- }
-
- return false;
- });
-});
-
-const dataTableColumns = computed((): DataTableColumn<ComposedDatabase>[] => {
- return [
- {
- type: "selection",
- width: 40,
- },
- {
- title: t("common.database"),
- key: "databaseName",
- resizable: true,
- width: 100,
- ellipsis: {
- tooltip: true,
- },
- render(row: ComposedDatabase) {
- return row.databaseName;
- },
- },
- {
- title: t("common.environment"),
- key: "environment",
- resizable: true,
- width: 100,
- ellipsis: {
- tooltip: true,
- },
- render(row: ComposedDatabase) {
- return row.effectiveEnvironmentEntity.title;
- },
- },
- {
- title: t("common.instance"),
- key: "instance",
- resizable: true,
- width: 120,
- render(row: ComposedDatabase) {
- return h(
- "div",
- {
- class:
- "flex flex-row justify-start items-center gap-1 whitespace-nowrap overflow-hidden",
- },
- [
- h(InstanceV1EngineIcon, {
- instance: row.instanceResource,
- }),
- h(
- NPerformantEllipsis,
- { class: "overflow-hidden truncate" },
- { default: () => row.instanceResource.title }
- ),
- ]
- );
- },
- },
- {
- title: t("common.labels"),
- key: "labels",
- resizable: true,
- render(row: ComposedDatabase) {
- return h(DatabaseLabelsCell, {
- labels: row.labels,
- showCount: 1,
- placeholder: "",
- });
- },
- },
- ];
-});
-
-const handleDatabaseRowCheck = (keys: DataTableRowKey[]) => {
- selectedDatabaseNames.value = keys as string[];
+const handleDatabaseRowCheck = (keys: Set<string>) => {
+ state.selectedDatabaseNames = [...keys];
};
const handleUncheckDatabaseRow = (databaseName: string) => {
- selectedDatabaseNames.value = selectedDatabaseNames.value.filter(
+ state.selectedDatabaseNames = state.selectedDatabaseNames.filter(
(name) => name !== databaseName
);
};
@@ -287,10 +168,10 @@ const handleTriggerClick = () => {
}
};
-watch(selectedDatabaseNames, () => {
+watch(state.selectedDatabaseNames, () => {
tabStore.updateCurrentTab({
batchQueryContext: {
- databases: selectedDatabaseNames.value,
+ databases: state.selectedDatabaseNames,
},
});
});
@@ -298,17 +179,10 @@ watch(selectedDatabaseNames, () => {
watch(
() => currentTab.value?.batchQueryContext?.databases,
(databases) => {
- selectedDatabaseNames.value = databases ?? [];
+ state.selectedDatabaseNames = databases ?? [];
},
{
immediate: true,
}
);
</script>
-
-<style lang="postcss" scoped>
-.batch-query-database-table :deep(.n-data-table-td),
-.batch-query-database-table :deep(.n-data-table-th) {
- @apply px-0.5;
-}
-</style>
diff --git a/frontend/src/views/sql-editor/EditorCommon/ExecuteHint.vue b/frontend/src/views/sql-editor/EditorCommon/ExecuteHint.vue
index 07c90f9075..28dca57e1e 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ExecuteHint.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ExecuteHint.vue
@@ -148,7 +148,7 @@ const handleClose = () => {
emit("close");
};
-const gotoCreateIssue = () => {
+const gotoCreateIssue = async () => {
const database = tabStore.currentTab?.connection.database ?? "";
if (!database) {
pushNotification({
@@ -161,7 +161,7 @@ const gotoCreateIssue = () => {
emit("close");
- const db = useDatabaseV1Store().getDatabaseByName(database);
+ const db = await useDatabaseV1Store().getOrFetchDatabaseByName(database);
const sqlStorageKey = `bb.issues.sql.${uuidv4()}`;
useStorageStore().put(sqlStorageKey, statement.value);
const route = router.resolve({
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/RequestQueryButton.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/RequestQueryButton.vue
index 425849c916..a10a5de93e 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/RequestQueryButton.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/RequestQueryButton.vue
@@ -16,6 +16,7 @@
</template>
<script setup lang="ts">
+import { computedAsync } from "@vueuse/core";
import { NButton } from "naive-ui";
import { computed, ref } from "vue";
import GrantRequestPanel from "@/components/GrantRequestPanel";
@@ -23,6 +24,7 @@ import { useDatabaseV1Store } from "@/store";
import {
isValidDatabaseName,
PresetRoleType,
+ unknownDatabase,
type DatabaseResource,
} from "@/types";
import { hasPermissionToCreateRequestGrantIssue } from "@/utils";
@@ -40,12 +42,14 @@ const props = withDefaults(
const showPanel = ref(false);
const dbStore = useDatabaseV1Store();
-const database = computed(() =>
- dbStore.getDatabaseByName(props.databaseResource.databaseFullName)
+const database = computedAsync(
+ () =>
+ dbStore.getOrFetchDatabaseByName(props.databaseResource.databaseFullName),
+ unknownDatabase()
);
const available = computed(() => {
- if (!isValidDatabaseName(props.databaseResource.databaseFullName)) {
+ if (!isValidDatabaseName(database.value.name)) {
return false;
}
diff --git a/frontend/src/views/sql-editor/EditorCommon/SheetConnectionIcon.vue b/frontend/src/views/sql-editor/EditorCommon/SheetConnectionIcon.vue
index 0ee39d2da7..2b190f8cce 100644
--- a/frontend/src/views/sql-editor/EditorCommon/SheetConnectionIcon.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/SheetConnectionIcon.vue
@@ -6,8 +6,8 @@
</template>
<script setup lang="ts">
+import { computedAsync } from "@vueuse/core";
import { UnlinkIcon } from "lucide-vue-next";
-import { computed } from "vue";
import { EngineIcon } from "@/components/Icon";
import { useDatabaseV1Store } from "@/store";
import type { SQLEditorTab } from "@/types";
@@ -19,12 +19,14 @@ const props = defineProps<{
tab?: SQLEditorTab;
}>();
-const instance = computed(() => {
+const instance = computedAsync(async () => {
const { sheet, tab } = props;
if (sheet) {
if (!sheet.database) return undefined;
- return useDatabaseV1Store().getDatabaseByName(sheet.database)
- .instanceResource;
+ const database = await useDatabaseV1Store().getOrFetchDatabaseByName(
+ sheet.database
+ );
+ return database.instanceResource;
}
if (tab) {
return connectionForSQLEditorTab(tab).instance;
diff --git a/frontend/src/views/sql-editor/EditorPanel/Panels/Panels.vue b/frontend/src/views/sql-editor/EditorPanel/Panels/Panels.vue
index 142d8d6546..8de2155b60 100644
--- a/frontend/src/views/sql-editor/EditorPanel/Panels/Panels.vue
+++ b/frontend/src/views/sql-editor/EditorPanel/Panels/Panels.vue
@@ -107,7 +107,9 @@ useEmitteryEventListener(AIEvents, "run-statement", async ({ statement }) => {
});
await nextAnimationFrame();
const connection = tab.value.connection;
- const database = useDatabaseV1Store().getDatabaseByName(connection.database);
+ const database = await useDatabaseV1Store().getOrFetchDatabaseByName(
+ connection.database
+ );
execute({
connection,
statement,
diff --git a/frontend/src/views/sql-editor/EditorPanel/TerminalPanel/TerminalPanel.vue b/frontend/src/views/sql-editor/EditorPanel/TerminalPanel/TerminalPanel.vue
index 9a8029d0d4..c298bfc2f1 100644
--- a/frontend/src/views/sql-editor/EditorPanel/TerminalPanel/TerminalPanel.vue
+++ b/frontend/src/views/sql-editor/EditorPanel/TerminalPanel/TerminalPanel.vue
@@ -79,6 +79,7 @@
<script lang="ts" setup>
import { useElementSize } from "@vueuse/core";
import { computed, defineAsyncComponent, ref, unref, watch } from "vue";
+import { watchEffect } from "vue";
import { BBSpin } from "@/bbkit";
import type { IStandaloneCodeEditor } from "@/components/MonacoEditor";
import {
@@ -111,6 +112,18 @@ const queryList = computed(() => {
return unref(queryState.value.queryItemList);
});
+watchEffect(async () => {
+ await Promise.all(
+ queryList.value.map((query) => {
+ if (query && query.params) {
+ return databaseStore.getOrFetchDatabaseByName(
+ query.params.connection.database
+ );
+ }
+ })
+ );
+});
+
const queryListContainerRef = ref<HTMLDivElement>();
const queryListRef = ref<HTMLDivElement>();
diff --git a/frontend/src/views/sql-editor/SQLEditorHomePage.vue b/frontend/src/views/sql-editor/SQLEditorHomePage.vue
index 9f5095f7f2..9958b2958b 100644
--- a/frontend/src/views/sql-editor/SQLEditorHomePage.vue
+++ b/frontend/src/views/sql-editor/SQLEditorHomePage.vue
@@ -122,8 +122,8 @@ const { width: windowWidth } = useWindowSize();
useEmitteryEventListener(
editorEvents,
"alter-schema",
- ({ databaseName, schema, table }) => {
- const database = databaseStore.getDatabaseByName(databaseName);
+ async ({ databaseName, schema, table }) => {
+ const database = await databaseStore.getOrFetchDatabaseByName(databaseName);
const exampleSQL = ["ALTER TABLE"];
if (table) {
if (schema) {
diff --git a/frontend/src/views/sql-editor/Setting/Database/Database.vue b/frontend/src/views/sql-editor/Setting/Database/Database.vue
index 684b59eb22..75a8ed2ee6 100644
--- a/frontend/src/views/sql-editor/Setting/Database/Database.vue
+++ b/frontend/src/views/sql-editor/Setting/Database/Database.vue
@@ -3,10 +3,7 @@
class="w-full h-full flex flex-col gap-4 py-4 overflow-y-auto"
v-bind="$attrs"
>
- <DatabaseDashboard
- :on-click-database="handleClickDatabase"
- @ready="ready = true"
- />
+ <DatabaseDashboard :on-click-database="handleClickDatabase" />
</div>
<Drawer v-model:show="state.detail.show">
@@ -20,7 +17,7 @@
</template>
<script setup lang="ts">
-import { onMounted, reactive, ref, watch } from "vue";
+import { onMounted, reactive, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
import { Drawer, DrawerContent } from "@/components/v2";
import {
@@ -29,7 +26,7 @@ import {
} from "@/router/sqlEditor";
import { useDatabaseV1Store } from "@/store";
import { isValidDatabaseName, type ComposedDatabase } from "@/types";
-import { extractDatabaseResourceName, wrapRefAsPromise } from "@/utils";
+import { extractDatabaseResourceName } from "@/utils";
import DatabaseDashboard from "@/views/DatabaseDashboard.vue";
import Detail from "./Detail.vue";
@@ -51,46 +48,44 @@ const state = reactive<LocalState>({
show: false,
},
});
-const ready = ref(false);
-const handleClickDatabase = (db: ComposedDatabase) => {
+const handleClickDatabase = (_: MouseEvent, db: ComposedDatabase) => {
state.detail = {
show: true,
database: db,
};
};
-onMounted(() => {
- wrapRefAsPromise(ready, true).then(() => {
- const maybeDatabase = `instances/${route.params.instanceId || -1}/databases/${route.params.databaseName || -1}`;
- if (isValidDatabaseName(maybeDatabase)) {
- const db = useDatabaseV1Store().getDatabaseByName(maybeDatabase);
- if (db) {
- state.detail.show = true;
- state.detail.database = db;
- }
+onMounted(async () => {
+ const maybeDatabase = `instances/${route.params.instanceId || -1}/databases/${route.params.databaseName || -1}`;
+ if (isValidDatabaseName(maybeDatabase)) {
+ const db =
+ await useDatabaseV1Store().getOrFetchDatabaseByName(maybeDatabase);
+ if (db) {
+ state.detail.show = true;
+ state.detail.database = db;
}
+ }
- watch(
- [() => state.detail.show, () => state.detail.database?.name],
- ([show, database]) => {
- if (show && database) {
- const { instanceName: instanceId, databaseName } =
- extractDatabaseResourceName(database);
- router.replace({
- name: SQL_EDITOR_SETTING_DATABASE_DETAIL_MODULE,
- params: {
- instanceId,
- databaseName,
- },
- });
- } else {
- router.replace({
- name: SQL_EDITOR_SETTING_DATABASES_MODULE,
- });
- }
+ watch(
+ [() => state.detail.show, () => state.detail.database?.name],
+ ([show, database]) => {
+ if (show && database) {
+ const { instanceName: instanceId, databaseName } =
+ extractDatabaseResourceName(database);
+ router.replace({
+ name: SQL_EDITOR_SETTING_DATABASE_DETAIL_MODULE,
+ params: {
+ instanceId,
+ databaseName,
+ },
+ });
+ } else {
+ router.replace({
+ name: SQL_EDITOR_SETTING_DATABASES_MODULE,
+ });
}
- );
- });
+ }
+ );
});
</script>
diff --git a/frontend/src/views/sql-editor/Setting/Environment/Environment.vue b/frontend/src/views/sql-editor/Setting/Environment/Environment.vue
index ccf289a063..2eb375226a 100644
--- a/frontend/src/views/sql-editor/Setting/Environment/Environment.vue
+++ b/frontend/src/views/sql-editor/Setting/Environment/Environment.vue
@@ -2,32 +2,6 @@
<div
class="w-full h-full flex flex-col gap-4 pt-4 px-4 overflow-hidden relative"
>
- <div
- v-if="allowCreate || allowReorder"
- class="flex items-center justify-end space-x-2 px-2"
- >
- <NButton
- v-if="allowCreate"
- type="primary"
- @click="handleClickCreateEnvironment"
- >
- <template #icon>
- <PlusIcon class="h-4 w-4" />
- </template>
- <NEllipsis>
- {{ $t("environment.create") }}
- </NEllipsis>
- </NButton>
- <NButton v-if="allowReorder" @click="startReorder">
- <template #icon>
- <ListOrderedIcon class="h-4 w-4" />
- </template>
- <NEllipsis>
- {{ $t("common.reorder") }}
- </NEllipsis>
- </NButton>
- </div>
-
<div class="flex-1 overflow-y-auto">
<NTabs
type="line"
@@ -35,7 +9,7 @@
:value="state.selectedId"
size="large"
justify-content="start"
- tab-style="margin: 0; padding: 0 2.5rem 0.5rem 2rem;"
+ tab-style="margin: 0 1rem; padding-left: 2rem; padding: 0 2.5rem 0.5rem 2.5rem;"
@update:value="onTabChange"
>
<NTabPane
@@ -70,6 +44,33 @@
</NButton>
</div>
</NTabPane>
+ <template #suffix>
+ <div
+ v-if="!state.reorder"
+ class="flex items-center justify-end space-x-2 px-2 pb-1"
+ >
+ <NButton
+ v-if="allowCreate"
+ type="primary"
+ @click="handleClickCreateEnvironment"
+ >
+ <template #icon>
+ <PlusIcon class="h-4 w-4" />
+ </template>
+ <NEllipsis>
+ {{ $t("environment.create") }}
+ </NEllipsis>
+ </NButton>
+ <NButton v-if="allowReorder" @click="startReorder">
+ <template #icon>
+ <ListOrderedIcon class="h-4 w-4" />
+ </template>
+ <NEllipsis>
+ {{ $t("common.reorder") }}
+ </NEllipsis>
+ </NButton>
+ </div>
+ </template>
</NTabs>
</div>
</div>
@@ -331,7 +332,7 @@ const renderTab = (env: Environment, index: number) => {
}
}
- return h("div", { class: "flex items-center space-x-2" }, child);
+ return h("div", { class: "flex items-center space-x-2 py-1" }, child);
};
onMounted(() => {
diff --git a/frontend/src/views/sql-editor/Setting/Project/Detail.vue b/frontend/src/views/sql-editor/Setting/Project/Detail.vue
index 6ab77155e3..da0937e7ce 100644
--- a/frontend/src/views/sql-editor/Setting/Project/Detail.vue
+++ b/frontend/src/views/sql-editor/Setting/Project/Detail.vue
@@ -28,17 +28,11 @@
</div>
</div>
- <div class="relative">
- <DatabaseV1Table
- v-if="ready"
- mode="PROJECT_SHORT"
- :database-list="databaseList"
- :show-selection="false"
- :custom-click="true"
- @row-click="handleDatabaseClick"
- />
- </div>
- <MaskSpinner v-if="!ready" />
+ <PagedDatabaseTable
+ mode="PROJECT_SHORT"
+ :show-selection="false"
+ :parent="project.name"
+ />
<Drawer v-model:show="state.transfer.show">
<TransferDatabaseForm
@@ -75,21 +69,14 @@
import { ChevronsDownIcon, SettingsIcon, UsersIcon } from "lucide-vue-next";
import { NButton } from "naive-ui";
import { computed, reactive } from "vue";
-import { useRouter } from "vue-router";
import ProjectMemberPanel from "@/components/ProjectMember/ProjectMemberPanel.vue";
import ProjectSettingPanel from "@/components/ProjectSettingPanel.vue";
import { TransferDatabaseForm } from "@/components/TransferDatabaseForm";
-import MaskSpinner from "@/components/misc/MaskSpinner.vue";
import { Drawer, DrawerContent } from "@/components/v2";
-import DatabaseV1Table from "@/components/v2/Model/DatabaseV1Table";
-import { useDatabaseV1List } from "@/store/modules/v1/databaseList";
-import {
- DEFAULT_PROJECT_NAME,
- type ComposedDatabase,
- type ComposedProject,
-} from "@/types";
+import { PagedDatabaseTable } from "@/components/v2/Model/DatabaseV1Table";
+import { DEFAULT_PROJECT_NAME, type ComposedProject } from "@/types";
import { State } from "@/types/proto/v1/common";
-import { autoDatabaseRoute, hasProjectPermissionV2 } from "@/utils";
+import { hasProjectPermissionV2 } from "@/utils";
type LocalState = {
transfer: {
@@ -107,8 +94,6 @@ const props = defineProps<{
project: ComposedProject;
}>();
-const router = useRouter();
-const { databaseList, ready } = useDatabaseV1List(props.project.name);
const state = reactive<LocalState>({
transfer: { show: false },
setting: { show: false },
@@ -142,8 +127,4 @@ const allowEditMembers = computed(() => {
return hasProjectPermissionV2(props.project, "bb.projects.setIamPolicy");
});
-
-const handleDatabaseClick = (event: MouseEvent, database: ComposedDatabase) => {
- router.push(autoDatabaseRoute(router, database));
-};
</script>
diff --git a/frontend/src/views/sql-editor/Setting/Project/Project.vue b/frontend/src/views/sql-editor/Setting/Project/Project.vue
index a8a0f93219..0018cd74e2 100644
--- a/frontend/src/views/sql-editor/Setting/Project/Project.vue
+++ b/frontend/src/views/sql-editor/Setting/Project/Project.vue
@@ -1,6 +1,6 @@
<template>
- <div class="w-full flex flex-col gap-4 py-4 px-4 overflow-y-auto">
- <div class="flex items-center space-x-2">
+ <div class="w-full flex flex-col gap-4 py-4 overflow-y-auto">
+ <div class="flex items-center space-x-2 px-4">
<SearchBox
v-model:value="state.keyword"
style="max-width: 100%"
@@ -17,22 +17,15 @@
</NButton>
</div>
- <PagedTable
- ref="projectPagedTable"
+ <PagedProjectTable
session-key="bb.sql-editor.project-table"
- :fetch-list="fetchProjects"
+ :search="state.keyword"
:footer-class="'mx-4'"
- >
- <template #table="{ list, loading }">
- <ProjectV1Table
- :bordered="false"
- :loading="loading"
- :project-list="list"
- :prevent-default="true"
- @row-click="showProjectDetail"
- />
- </template>
- </PagedTable>
+ :bordered="false"
+ :include-default="false"
+ :prevent-default="true"
+ @row-click="showProjectDetail"
+ />
<Drawer
:show="state.detail.show"
@@ -60,21 +53,17 @@
</template>
<script setup lang="ts">
-import { useDebounceFn } from "@vueuse/core";
import { PlusIcon } from "lucide-vue-next";
import { NButton, NEllipsis } from "naive-ui";
-import { reactive, watch, ref } from "vue";
-import type { ComponentExposed } from "vue-component-type-helpers";
+import { reactive, watch } from "vue";
import { useRouter } from "vue-router";
import ProjectCreatePanel from "@/components/Project/ProjectCreatePanel.vue";
import {
Drawer,
DrawerContent,
- ProjectV1Table,
+ PagedProjectTable,
SearchBox,
} from "@/components/v2";
-import PagedTable from "@/components/v2/Model/PagedTable.vue";
-import { useProjectV1Store } from "@/store";
import type { ComposedProject } from "@/types";
import Detail from "./Detail.vue";
@@ -87,10 +76,6 @@ interface LocalState {
}
const router = useRouter();
-const projectStore = useProjectV1Store();
-const projectPagedTable =
- ref<ComponentExposed<typeof PagedTable<ComposedProject>>>();
-
const state = reactive<LocalState>({
keyword: "",
detail: {
@@ -99,29 +84,6 @@ const state = reactive<LocalState>({
},
});
-watch(
- () => state.keyword,
- useDebounceFn(async () => {
- await projectPagedTable.value?.refresh();
- }, 500)
-);
-
-const fetchProjects = async ({
- pageToken,
- pageSize,
-}: {
- pageToken: string;
- pageSize: number;
-}) => {
- const { nextPageToken, projects } = await projectStore.fetchProjectList({
- showDeleted: false,
- pageToken,
- pageSize,
- query: state.keyword,
- });
- return { nextPageToken, list: projects };
-};
-
const handleClickNewProject = () => {
state.detail.show = true;
state.detail.project = undefined;
diff --git a/frontend/src/views/sql-editor/SheetPanel/SheetTable/SheetConnection.vue b/frontend/src/views/sql-editor/SheetPanel/SheetTable/SheetConnection.vue
index f2e00fb954..664961a636 100644
--- a/frontend/src/views/sql-editor/SheetPanel/SheetTable/SheetConnection.vue
+++ b/frontend/src/views/sql-editor/SheetPanel/SheetTable/SheetConnection.vue
@@ -28,6 +28,7 @@
</template>
<script lang="ts" setup>
+import { computedAsync } from "@vueuse/core";
import { computed } from "vue";
import {
DatabaseV1Name,
@@ -43,10 +44,10 @@ const props = defineProps<{
}>();
const databaseStore = useDatabaseV1Store();
-const database = computed(() => {
+const database = computedAsync(async () => {
const { sheet } = props;
if (!props.sheet.database) return undefined;
- const db = databaseStore.getDatabaseByName(sheet.database);
+ const db = await databaseStore.getOrFetchDatabaseByName(sheet.database);
if (!isValidDatabaseName(db.name)) return undefined;
return db;
});
diff --git a/frontend/src/views/sql-editor/TabList/TabItem/AdminLabel.vue b/frontend/src/views/sql-editor/TabList/TabItem/AdminLabel.vue
index b1649cef85..ae4128677e 100644
--- a/frontend/src/views/sql-editor/TabList/TabItem/AdminLabel.vue
+++ b/frontend/src/views/sql-editor/TabList/TabItem/AdminLabel.vue
@@ -18,12 +18,17 @@
</template>
<script lang="ts" setup>
+import { computedAsync } from "@vueuse/core";
import { ChevronRightIcon } from "lucide-vue-next";
import { computed } from "vue";
import { EnvironmentV1Name } from "@/components/v2";
import { useAppFeature, useDatabaseV1Store } from "@/store";
import { type SQLEditorTab, UNKNOWN_ENVIRONMENT_NAME } from "@/types";
-import { isValidInstanceName, isValidDatabaseName } from "@/types";
+import {
+ isValidInstanceName,
+ isValidDatabaseName,
+ unknownDatabase,
+} from "@/types";
const props = defineProps<{
tab: SQLEditorTab;
@@ -31,9 +36,11 @@ const props = defineProps<{
const connection = computed(() => props.tab.connection);
-const database = computed(() => {
- return useDatabaseV1Store().getDatabaseByName(connection.value.database);
-});
+const database = computedAsync(async () => {
+ return useDatabaseV1Store().getOrFetchDatabaseByName(
+ connection.value.database
+ );
+}, unknownDatabase());
const instance = computed(() => {
return database.value.instanceResource;
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index db70aef5b5..855c63e31f 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -1256,7 +1256,7 @@ paths:
get:
tags:
- DatabaseService
- operationId: DatabaseService_ListInstanceDatabases
+ operationId: DatabaseService_ListDatabases
parameters:
- name: instance
in: path
@@ -1268,36 +1268,61 @@ paths:
in: query
description: |-
The maximum number of databases to return. The service may return fewer
- than this value. If unspecified, at most 10 databases will be returned.
+ than this value.
+ If unspecified, at most 10 databases will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
schema:
type: integer
format: int32
- name: pageToken
in: query
description: |-
- A page token, received from a previous `ListInstanceDatabases` call.
+ A page token, received from a previous `ListDatabases` call.
Provide this to retrieve the subsequent page.
- When paginating, all other parameters provided to `ListInstanceDatabases`
- must match the call that provided the page token.
+ When paginating, all other parameters provided to `ListDatabases` must
+ match the call that provided the page token.
schema:
type: string
- name: filter
in: query
description: |-
- Deprecated.
- Filter is used to filter databases returned in the list.
- For example, `project == "projects/{project}"` can be used to list
- databases in a project. Note: the project filter will be moved to parent.
+ Filter is used to filter databases returned in the list.
+ Supported filter:
+ - environment
+ - name
+ - project
+ - instance
+ - engine
+ - label
+ - exclude_unassigned: Not show unassigned databases if specified
+
+ For example:
+ environment == "environments/{environment resource id}"
+ project == "projects/{project resource id}"
+ instance == "instances/{instance resource id}"
+ name.matches("database name")
+ engine == "MYSQL"
+ engine in ["MYSQL", "POSTGRES"]
+ !(engine in ["MYSQL", "POSTGRES"])
+ label == "region:asia"
+ label == "tenant:asia,europe"
+ label == "region:asia" && label == "tenant:bytebase"
+ exclude_unassigned == true
schema:
type: string
+ - name: showDeleted
+ in: query
+ description: Show deleted database if specified.
+ schema:
+ type: boolean
responses:
"200":
description: OK
content:
application/json:
schema:
- $ref: '#/components/schemas/ListInstanceDatabasesResponse'
+ $ref: '#/components/schemas/ListDatabasesResponse'
default:
description: Default error response
content:
@@ -3964,7 +3989,9 @@ paths:
in: query
description: |-
The maximum number of databases to return. The service may return fewer
- than this value. If unspecified, at most 10 databases will be returned.
+ than this value.
+ If unspecified, at most 10 databases will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
schema:
type: integer
format: int32
@@ -3978,6 +4005,38 @@ paths:
match the call that provided the page token.
schema:
type: string
+ - name: filter
+ in: query
+ description: |-
+ Filter is used to filter databases returned in the list.
+ Supported filter:
+ - environment
+ - name
+ - project
+ - instance
+ - engine
+ - label
+ - exclude_unassigned: Not show unassigned databases if specified
+
+ For example:
+ environment == "environments/{environment resource id}"
+ project == "projects/{project resource id}"
+ instance == "instances/{instance resource id}"
+ name.matches("database name")
+ engine == "MYSQL"
+ engine in ["MYSQL", "POSTGRES"]
+ !(engine in ["MYSQL", "POSTGRES"])
+ label == "region:asia"
+ label == "tenant:asia,europe"
+ label == "region:asia" && label == "tenant:bytebase"
+ exclude_unassigned == true
+ schema:
+ type: string
+ - name: showDeleted
+ in: query
+ description: Show deleted database if specified.
+ schema:
+ type: boolean
responses:
"200":
description: OK
@@ -7588,7 +7647,9 @@ paths:
in: query
description: |-
The maximum number of databases to return. The service may return fewer
- than this value. If unspecified, at most 10 databases will be returned.
+ than this value.
+ If unspecified, at most 10 databases will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
schema:
type: integer
format: int32
@@ -7602,6 +7663,38 @@ paths:
match the call that provided the page token.
schema:
type: string
+ - name: filter
+ in: query
+ description: |-
+ Filter is used to filter databases returned in the list.
+ Supported filter:
+ - environment
+ - name
+ - project
+ - instance
+ - engine
+ - label
+ - exclude_unassigned: Not show unassigned databases if specified
+
+ For example:
+ environment == "environments/{environment resource id}"
+ project == "projects/{project resource id}"
+ instance == "instances/{instance resource id}"
+ name.matches("database name")
+ engine == "MYSQL"
+ engine in ["MYSQL", "POSTGRES"]
+ !(engine in ["MYSQL", "POSTGRES"])
+ label == "region:asia"
+ label == "tenant:asia,europe"
+ label == "region:asia" && label == "tenant:bytebase"
+ exclude_unassigned == true
+ schema:
+ type: string
+ - name: showDeleted
+ in: query
+ description: Show deleted database if specified.
+ schema:
+ type: boolean
responses:
"200":
description: OK
@@ -10400,19 +10493,6 @@ components:
items:
type: string
description: All database name list in the instance.
- ListInstanceDatabasesResponse:
- type: object
- properties:
- databases:
- type: array
- items:
- $ref: '#/components/schemas/Database'
- description: The databases from the specified request.
- nextPageToken:
- type: string
- description: |-
- A token, which can be sent as `page_token` to retrieve the next page.
- If this field is omitted, there are no subsequent pages.
ListInstanceRolesResponse:
type: object
properties:
@@ -12668,7 +12748,7 @@ components:
- database, for example:
database = "instances/{instance}/databases/{database}"
- instance, for example:
- instance = "instance/{instance}"
+ instance = "instances/{instance}"
- type, for example:
type = "QUERY"
SearchQueryHistoriesResponse:
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 93ed14f73f..313c35e10a 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -127,8 +127,6 @@
- [ListChangelogsResponse](#bytebase-v1-ListChangelogsResponse)
- [ListDatabasesRequest](#bytebase-v1-ListDatabasesRequest)
- [ListDatabasesResponse](#bytebase-v1-ListDatabasesResponse)
- - [ListInstanceDatabasesRequest](#bytebase-v1-ListInstanceDatabasesRequest)
- - [ListInstanceDatabasesResponse](#bytebase-v1-ListInstanceDatabasesResponse)
- [ListRevisionsRequest](#bytebase-v1-ListRevisionsRequest)
- [ListRevisionsResponse](#bytebase-v1-ListRevisionsResponse)
- [ListSecretsRequest](#bytebase-v1-ListSecretsRequest)
@@ -2587,11 +2585,15 @@ Combine multiple functions with &#34;&amp;&amp;&#34; and &#34;||&#34;, we MUST u
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| parent | [string](#string) | | The parent, which owns this collection of databases. - projects/{project}: list all databases in a project. - workspaces/{workspace}: list all databases in a workspace. |
-| page_size | [int32](#int32) | | The maximum number of databases to return. The service may return fewer than this value. If unspecified, at most 10 databases will be returned. |
+| parent | [string](#string) | | - projects/{project}: list databases in a project, require &#34;bb.projects.get&#34; permission. - workspaces/-: list databases in the workspace, require &#34;bb.databases.list&#34; permission. - instances/{instances}: list databases in a instance, require &#34;bb.instances.get&#34; permission |
+| page_size | [int32](#int32) | | The maximum number of databases to return. The service may return fewer than this value. If unspecified, at most 10 databases will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |
| page_token | [string](#string) | | A page token, received from a previous `ListDatabases` call. Provide this to retrieve the subsequent page.
When paginating, all other parameters provided to `ListDatabases` must match the call that provided the page token. |
+| filter | [string](#string) | | Filter is used to filter databases returned in the list. Supported filter: - environment - name - project - instance - engine - label - exclude_unassigned: Not show unassigned databases if specified
+
+For example: environment == &#34;environments/{environment resource id}&#34; project == &#34;projects/{project resource id}&#34; instance == &#34;instances/{instance resource id}&#34; name.matches(&#34;database name&#34;) engine == &#34;MYSQL&#34; engine in [&#34;MYSQL&#34;, &#34;POSTGRES&#34;] !(engine in [&#34;MYSQL&#34;, &#34;POSTGRES&#34;]) label == &#34;region:asia&#34; label == &#34;tenant:asia,europe&#34; label == &#34;region:asia&#34; &amp;&amp; label == &#34;tenant:bytebase&#34; exclude_unassigned == true |
+| show_deleted | [bool](#bool) | | Show deleted database if specified. |
@@ -2614,42 +2616,6 @@ When paginating, all other parameters provided to `ListDatabases` must match the
-<a name="bytebase-v1-ListInstanceDatabasesRequest"></a>
-
-### ListInstanceDatabasesRequest
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| parent | [string](#string) | | The parent, which owns this collection of databases. - instances/{instance}: list all databases for an instance. Use &#34;instances/-&#34; to list all databases. |
-| page_size | [int32](#int32) | | The maximum number of databases to return. The service may return fewer than this value. If unspecified, at most 10 databases will be returned. |
-| page_token | [string](#string) | | A page token, received from a previous `ListInstanceDatabases` call. Provide this to retrieve the subsequent page.
-
-When paginating, all other parameters provided to `ListInstanceDatabases` must match the call that provided the page token. |
-| filter | [string](#string) | | Deprecated. Filter is used to filter databases returned in the list. For example, `project == &#34;projects/{project}&#34;` can be used to list databases in a project. Note: the project filter will be moved to parent. |
-
-
-
-
-
-
-<a name="bytebase-v1-ListInstanceDatabasesResponse"></a>
-
-### ListInstanceDatabasesResponse
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| databases | [Database](#bytebase-v1-Database) | repeated | The databases from the specified request. |
-| next_page_token | [string](#string) | | A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. |
-
-
-
-
-
-
<a name="bytebase-v1-ListRevisionsRequest"></a>
### ListRevisionsRequest
@@ -3343,7 +3309,6 @@ LIST, HASH (https://www.postgresql.org/docs/current/ddl-partitioning.html)
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| GetDatabase | [GetDatabaseRequest](#bytebase-v1-GetDatabaseRequest) | [Database](#bytebase-v1-Database) | |
-| ListInstanceDatabases | [ListInstanceDatabasesRequest](#bytebase-v1-ListInstanceDatabasesRequest) | [ListInstanceDatabasesResponse](#bytebase-v1-ListInstanceDatabasesResponse) | |
| ListDatabases | [ListDatabasesRequest](#bytebase-v1-ListDatabasesRequest) | [ListDatabasesResponse](#bytebase-v1-ListDatabasesResponse) | |
| UpdateDatabase | [UpdateDatabaseRequest](#bytebase-v1-UpdateDatabaseRequest) | [Database](#bytebase-v1-Database) | |
| BatchUpdateDatabases | [BatchUpdateDatabasesRequest](#bytebase-v1-BatchUpdateDatabasesRequest) | [BatchUpdateDatabasesResponse](#bytebase-v1-BatchUpdateDatabasesResponse) | |
@@ -9159,7 +9124,7 @@ for field description.
| ----- | ---- | ----- | ----------- |
| page_size | [int32](#int32) | | The maximum number of histories to return. The service may return fewer than this value. If unspecified, at most 10 history entries will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |
| page_token | [string](#string) | | A page token, received from a previous `ListQueryHistory` call. Provide this to retrieve the subsequent page. |
-| filter | [string](#string) | | filter is the filter to apply on the search query history, follow the [ebnf](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) syntax. Support filter by: - database, for example: database = &#34;instances/{instance}/databases/{database}&#34; - instance, for example: instance = &#34;instance/{instance}&#34; - type, for example: type = &#34;QUERY&#34; |
+| filter | [string](#string) | | filter is the filter to apply on the search query history, follow the [ebnf](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) syntax. Support filter by: - database, for example: database = &#34;instances/{instance}/databases/{database}&#34; - instance, for example: instance = &#34;instances/{instance}&#34; - type, for example: type = &#34;QUERY&#34; |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index dba27d0286..392ef7f785 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -657,14 +657,6 @@
<a href="#bytebase.v1.ListDatabasesResponse"><span class="badge">M</span>ListDatabasesResponse</a>
</li>
- <li>
- <a href="#bytebase.v1.ListInstanceDatabasesRequest"><span class="badge">M</span>ListInstanceDatabasesRequest</a>
- </li>
-
- <li>
- <a href="#bytebase.v1.ListInstanceDatabasesResponse"><span class="badge">M</span>ListInstanceDatabasesResponse</a>
- </li>
-
<li>
<a href="#bytebase.v1.ListRevisionsRequest"><span class="badge">M</span>ListRevisionsRequest</a>
</li>
@@ -7793,9 +7785,9 @@ If this field is omitted, there are no subsequent pages. </p></td>
<td>parent</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>The parent, which owns this collection of databases.
-- projects/{project}: list all databases in a project.
-- workspaces/{workspace}: list all databases in a workspace. </p></td>
+ <td><p>- projects/{project}: list databases in a project, require &#34;bb.projects.get&#34; permission.
+- workspaces/-: list databases in the workspace, require &#34;bb.databases.list&#34; permission.
+- instances/{instances}: list databases in a instance, require &#34;bb.instances.get&#34; permission </p></td>
</tr>
<tr>
@@ -7803,7 +7795,9 @@ If this field is omitted, there are no subsequent pages. </p></td>
<td><a href="#int32">int32</a></td>
<td></td>
<td><p>The maximum number of databases to return. The service may return fewer
-than this value. If unspecified, at most 10 databases will be returned. </p></td>
+than this value.
+If unspecified, at most 10 databases will be returned.
+The maximum value is 1000; values above 1000 will be coerced to 1000. </p></td>
</tr>
<tr>
@@ -7817,91 +7811,39 @@ When paginating, all other parameters provided to `ListDatabases` must
match the call that provided the page token. </p></td>
</tr>
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.ListDatabasesResponse">ListDatabasesResponse</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
<tr>
- <td>databases</td>
- <td><a href="#bytebase.v1.Database">Database</a></td>
- <td>repeated</td>
- <td><p>The databases from the specified request. </p></td>
- </tr>
-
- <tr>
- <td>next_page_token</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>A token, which can be sent as `page_token` to retrieve the next page.
-If this field is omitted, there are no subsequent pages. </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.v1.ListInstanceDatabasesRequest">ListInstanceDatabasesRequest</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>parent</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The parent, which owns this collection of databases.
-- instances/{instance}: list all databases for an instance. Use
-&#34;instances/-&#34; to list all databases. </p></td>
- </tr>
-
- <tr>
- <td>page_size</td>
- <td><a href="#int32">int32</a></td>
- <td></td>
- <td><p>The maximum number of databases to return. The service may return fewer
-than this value. If unspecified, at most 10 databases will be returned. </p></td>
- </tr>
-
- <tr>
- <td>page_token</td>
+ <td>filter</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>A page token, received from a previous `ListInstanceDatabases` call.
-Provide this to retrieve the subsequent page.
+ <td><p>Filter is used to filter databases returned in the list.
+Supported filter:
+- environment
+- name
+- project
+- instance
+- engine
+- label
+- exclude_unassigned: Not show unassigned databases if specified
-When paginating, all other parameters provided to `ListInstanceDatabases`
-must match the call that provided the page token. </p></td>
+For example:
+environment == &#34;environments/{environment resource id}&#34;
+project == &#34;projects/{project resource id}&#34;
+instance == &#34;instances/{instance resource id}&#34;
+name.matches(&#34;database name&#34;)
+engine == &#34;MYSQL&#34;
+engine in [&#34;MYSQL&#34;, &#34;POSTGRES&#34;]
+!(engine in [&#34;MYSQL&#34;, &#34;POSTGRES&#34;])
+label == &#34;region:asia&#34;
+label == &#34;tenant:asia,europe&#34;
+label == &#34;region:asia&#34; &amp;&amp; label == &#34;tenant:bytebase&#34;
+exclude_unassigned == true </p></td>
</tr>
<tr>
- <td>filter</td>
- <td><a href="#string">string</a></td>
+ <td>show_deleted</td>
+ <td><a href="#bool">bool</a></td>
<td></td>
- <td><p>Deprecated.
-Filter is used to filter databases returned in the list.
-For example, `project == &#34;projects/{project}&#34;` can be used to list
-databases in a project. Note: the project filter will be moved to parent. </p></td>
+ <td><p>Show deleted database if specified. </p></td>
</tr>
</tbody>
@@ -7911,7 +7853,7 @@ databases in a project. Note: the project filter will be moved to parent. </p></
- <h3 id="bytebase.v1.ListInstanceDatabasesResponse">ListInstanceDatabasesResponse</h3>
+ <h3 id="bytebase.v1.ListDatabasesResponse">ListDatabasesResponse</h3>
<p></p>
@@ -9992,13 +9934,6 @@ view, function names.</p></td>
<td><p></p></td>
</tr>
- <tr>
- <td>ListInstanceDatabases</td>
- <td><a href="#bytebase.v1.ListInstanceDatabasesRequest">ListInstanceDatabasesRequest</a></td>
- <td><a href="#bytebase.v1.ListInstanceDatabasesResponse">ListInstanceDatabasesResponse</a></td>
- <td><p></p></td>
- </tr>
-
<tr>
<td>ListDatabases</td>
<td><a href="#bytebase.v1.ListDatabasesRequest">ListDatabasesRequest</a></td>
@@ -10156,19 +10091,16 @@ view, function names.</p></td>
<tr>
- <td>ListInstanceDatabases</td>
+ <td>ListDatabases</td>
<td>GET</td>
- <td>/v1/{parent=instances/*}/databases</td>
+ <td>/v1/{parent=projects/*}/databases</td>
<td></td>
</tr>
-
-
-
<tr>
<td>ListDatabases</td>
<td>GET</td>
- <td>/v1/{parent=projects/*}/databases</td>
+ <td>/v1/{parent=instances/*}/databases</td>
<td></td>
</tr>
@@ -25309,7 +25241,7 @@ syntax. Support filter by:
- database, for example:
database = &#34;instances/{instance}/databases/{database}&#34;
- instance, for example:
- instance = &#34;instance/{instance}&#34;
+ instance = &#34;instances/{instance}&#34;
- type, for example:
type = &#34;QUERY&#34; </p></td>
</tr>
diff --git a/proto/generated-go/v1/database_service.pb.go b/proto/generated-go/v1/database_service.pb.go
index 9b30278489..90ac4e8924 100644
--- a/proto/generated-go/v1/database_service.pb.go
+++ b/proto/generated-go/v1/database_service.pb.go
@@ -202,7 +202,7 @@ func (x TablePartitionMetadata_Type) Number() protoreflect.EnumNumber {
// Deprecated: Use TablePartitionMetadata_Type.Descriptor instead.
func (TablePartitionMetadata_Type) EnumDescriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{24, 0}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{22, 0}
}
type ColumnMetadata_IdentityGeneration int32
@@ -251,7 +251,7 @@ func (x ColumnMetadata_IdentityGeneration) Number() protoreflect.EnumNumber {
// Deprecated: Use ColumnMetadata_IdentityGeneration.Descriptor instead.
func (ColumnMetadata_IdentityGeneration) EnumDescriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{25, 0}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{23, 0}
}
type GenerationMetadata_Type int32
@@ -300,7 +300,7 @@ func (x GenerationMetadata_Type) Number() protoreflect.EnumNumber {
// Deprecated: Use GenerationMetadata_Type.Descriptor instead.
func (GenerationMetadata_Type) EnumDescriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{26, 0}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{24, 0}
}
type TaskMetadata_State int32
@@ -349,7 +349,7 @@ func (x TaskMetadata_State) Number() protoreflect.EnumNumber {
// Deprecated: Use TaskMetadata_State.Descriptor instead.
func (TaskMetadata_State) EnumDescriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{34, 0}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{32, 0}
}
type StreamMetadata_Type int32
@@ -395,7 +395,7 @@ func (x StreamMetadata_Type) Number() protoreflect.EnumNumber {
// Deprecated: Use StreamMetadata_Type.Descriptor instead.
func (StreamMetadata_Type) EnumDescriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{35, 0}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{33, 0}
}
type StreamMetadata_Mode int32
@@ -447,7 +447,7 @@ func (x StreamMetadata_Mode) Number() protoreflect.EnumNumber {
// Deprecated: Use StreamMetadata_Mode.Descriptor instead.
func (StreamMetadata_Mode) EnumDescriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{35, 1}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{33, 1}
}
type Changelog_Status int32
@@ -499,7 +499,7 @@ func (x Changelog_Status) Number() protoreflect.EnumNumber {
// Deprecated: Use Changelog_Status.Descriptor instead.
func (Changelog_Status) EnumDescriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{68, 0}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{66, 0}
}
type Changelog_Type int32
@@ -557,7 +557,7 @@ func (x Changelog_Type) Number() protoreflect.EnumNumber {
// Deprecated: Use Changelog_Type.Descriptor instead.
func (Changelog_Type) EnumDescriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{68, 1}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{66, 1}
}
type GetDatabaseRequest struct {
@@ -606,44 +606,66 @@ func (x *GetDatabaseRequest) GetName() string {
return ""
}
-type ListInstanceDatabasesRequest struct {
+type ListDatabasesRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
- // The parent, which owns this collection of databases.
- // - instances/{instance}: list all databases for an instance. Use
- // "instances/-" to list all databases.
+ // - projects/{project}: list databases in a project, require "bb.projects.get" permission.
+ // - workspaces/-: list databases in the workspace, require "bb.databases.list" permission.
+ // - instances/{instances}: list databases in a instance, require "bb.instances.get" permission
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// The maximum number of databases to return. The service may return fewer
- // than this value. If unspecified, at most 10 databases will be returned.
+ // than this value.
+ // If unspecified, at most 10 databases will be returned.
+ // The maximum value is 1000; values above 1000 will be coerced to 1000.
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
- // A page token, received from a previous `ListInstanceDatabases` call.
+ // A page token, received from a previous `ListDatabases` call.
// Provide this to retrieve the subsequent page.
//
- // When paginating, all other parameters provided to `ListInstanceDatabases`
- // must match the call that provided the page token.
+ // When paginating, all other parameters provided to `ListDatabases` must
+ // match the call that provided the page token.
PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
- // Deprecated.
// Filter is used to filter databases returned in the list.
- // For example, `project == "projects/{project}"` can be used to list
- // databases in a project. Note: the project filter will be moved to parent.
- Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"`
+ // Supported filter:
+ // - environment
+ // - name
+ // - project
+ // - instance
+ // - engine
+ // - label
+ // - exclude_unassigned: Not show unassigned databases if specified
+ //
+ // For example:
+ // environment == "environments/{environment resource id}"
+ // project == "projects/{project resource id}"
+ // instance == "instances/{instance resource id}"
+ // name.matches("database name")
+ // engine == "MYSQL"
+ // engine in ["MYSQL", "POSTGRES"]
+ // !(engine in ["MYSQL", "POSTGRES"])
+ // label == "region:asia"
+ // label == "tenant:asia,europe"
+ // label == "region:asia" && label == "tenant:bytebase"
+ // exclude_unassigned == true
+ Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"`
+ // Show deleted database if specified.
+ ShowDeleted bool `protobuf:"varint,5,opt,name=show_deleted,json=showDeleted,proto3" json:"show_deleted,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
-func (x *ListInstanceDatabasesRequest) Reset() {
- *x = ListInstanceDatabasesRequest{}
+func (x *ListDatabasesRequest) Reset() {
+ *x = ListDatabasesRequest{}
mi := &file_v1_database_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
-func (x *ListInstanceDatabasesRequest) String() string {
+func (x *ListDatabasesRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
-func (*ListInstanceDatabasesRequest) ProtoMessage() {}
+func (*ListDatabasesRequest) ProtoMessage() {}
-func (x *ListInstanceDatabasesRequest) ProtoReflect() protoreflect.Message {
+func (x *ListDatabasesRequest) ProtoReflect() protoreflect.Message {
mi := &file_v1_database_service_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -655,162 +677,44 @@ func (x *ListInstanceDatabasesRequest) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
-// Deprecated: Use ListInstanceDatabasesRequest.ProtoReflect.Descriptor instead.
-func (*ListInstanceDatabasesRequest) Descriptor() ([]byte, []int) {
+// Deprecated: Use ListDatabasesRequest.ProtoReflect.Descriptor instead.
+func (*ListDatabasesRequest) Descriptor() ([]byte, []int) {
return file_v1_database_service_proto_rawDescGZIP(), []int{1}
}
-func (x *ListInstanceDatabasesRequest) GetParent() string {
+func (x *ListDatabasesRequest) GetParent() string {
if x != nil {
return x.Parent
}
return ""
}
-func (x *ListInstanceDatabasesRequest) GetPageSize() int32 {
+func (x *ListDatabasesRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
-func (x *ListInstanceDatabasesRequest) GetPageToken() string {
+func (x *ListDatabasesRequest) GetPageToken() string {
if x != nil {
return x.PageToken
}
return ""
}
-func (x *ListInstanceDatabasesRequest) GetFilter() string {
+func (x *ListDatabasesRequest) GetFilter() string {
if x != nil {
return x.Filter
}
return ""
}
-type ListInstanceDatabasesResponse struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The databases from the specified request.
- Databases []*Database `protobuf:"bytes,1,rep,name=databases,proto3" json:"databases,omitempty"`
- // A token, which can be sent as `page_token` to retrieve the next page.
- // If this field is omitted, there are no subsequent pages.
- NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *ListInstanceDatabasesResponse) Reset() {
- *x = ListInstanceDatabasesResponse{}
- mi := &file_v1_database_service_proto_msgTypes[2]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *ListInstanceDatabasesResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ListInstanceDatabasesResponse) ProtoMessage() {}
-
-func (x *ListInstanceDatabasesResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[2]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use ListInstanceDatabasesResponse.ProtoReflect.Descriptor instead.
-func (*ListInstanceDatabasesResponse) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{2}
-}
-
-func (x *ListInstanceDatabasesResponse) GetDatabases() []*Database {
- if x != nil {
- return x.Databases
- }
- return nil
-}
-
-func (x *ListInstanceDatabasesResponse) GetNextPageToken() string {
- if x != nil {
- return x.NextPageToken
- }
- return ""
-}
-
-type ListDatabasesRequest struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- // The parent, which owns this collection of databases.
- // - projects/{project}: list all databases in a project.
- // - workspaces/{workspace}: list all databases in a workspace.
- Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
- // The maximum number of databases to return. The service may return fewer
- // than this value. If unspecified, at most 10 databases will be returned.
- PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
- // A page token, received from a previous `ListDatabases` call.
- // Provide this to retrieve the subsequent page.
- //
- // When paginating, all other parameters provided to `ListDatabases` must
- // match the call that provided the page token.
- PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
-}
-
-func (x *ListDatabasesRequest) Reset() {
- *x = ListDatabasesRequest{}
- mi := &file_v1_database_service_proto_msgTypes[3]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *ListDatabasesRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ListDatabasesRequest) ProtoMessage() {}
-
-func (x *ListDatabasesRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[3]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use ListDatabasesRequest.ProtoReflect.Descriptor instead.
-func (*ListDatabasesRequest) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{3}
-}
-
-func (x *ListDatabasesRequest) GetParent() string {
- if x != nil {
- return x.Parent
- }
- return ""
-}
-
-func (x *ListDatabasesRequest) GetPageSize() int32 {
- if x != nil {
- return x.PageSize
- }
- return 0
-}
-
-func (x *ListDatabasesRequest) GetPageToken() string {
+func (x *ListDatabasesRequest) GetShowDeleted() bool {
if x != nil {
- return x.PageToken
+ return x.ShowDeleted
}
- return ""
+ return false
}
type ListDatabasesResponse struct {
@@ -826,7 +730,7 @@ type ListDatabasesResponse struct {
func (x *ListDatabasesResponse) Reset() {
*x = ListDatabasesResponse{}
- mi := &file_v1_database_service_proto_msgTypes[4]
+ mi := &file_v1_database_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -838,7 +742,7 @@ func (x *ListDatabasesResponse) String() string {
func (*ListDatabasesResponse) ProtoMessage() {}
func (x *ListDatabasesResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[4]
+ mi := &file_v1_database_service_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -851,7 +755,7 @@ func (x *ListDatabasesResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListDatabasesResponse.ProtoReflect.Descriptor instead.
func (*ListDatabasesResponse) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{4}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{2}
}
func (x *ListDatabasesResponse) GetDatabases() []*Database {
@@ -883,7 +787,7 @@ type UpdateDatabaseRequest struct {
func (x *UpdateDatabaseRequest) Reset() {
*x = UpdateDatabaseRequest{}
- mi := &file_v1_database_service_proto_msgTypes[5]
+ mi := &file_v1_database_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -895,7 +799,7 @@ func (x *UpdateDatabaseRequest) String() string {
func (*UpdateDatabaseRequest) ProtoMessage() {}
func (x *UpdateDatabaseRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[5]
+ mi := &file_v1_database_service_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -908,7 +812,7 @@ func (x *UpdateDatabaseRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateDatabaseRequest.ProtoReflect.Descriptor instead.
func (*UpdateDatabaseRequest) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{5}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{3}
}
func (x *UpdateDatabaseRequest) GetDatabase() *Database {
@@ -941,7 +845,7 @@ type BatchUpdateDatabasesRequest struct {
func (x *BatchUpdateDatabasesRequest) Reset() {
*x = BatchUpdateDatabasesRequest{}
- mi := &file_v1_database_service_proto_msgTypes[6]
+ mi := &file_v1_database_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -953,7 +857,7 @@ func (x *BatchUpdateDatabasesRequest) String() string {
func (*BatchUpdateDatabasesRequest) ProtoMessage() {}
func (x *BatchUpdateDatabasesRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[6]
+ mi := &file_v1_database_service_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -966,7 +870,7 @@ func (x *BatchUpdateDatabasesRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use BatchUpdateDatabasesRequest.ProtoReflect.Descriptor instead.
func (*BatchUpdateDatabasesRequest) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{6}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{4}
}
func (x *BatchUpdateDatabasesRequest) GetParent() string {
@@ -993,7 +897,7 @@ type BatchUpdateDatabasesResponse struct {
func (x *BatchUpdateDatabasesResponse) Reset() {
*x = BatchUpdateDatabasesResponse{}
- mi := &file_v1_database_service_proto_msgTypes[7]
+ mi := &file_v1_database_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1005,7 +909,7 @@ func (x *BatchUpdateDatabasesResponse) String() string {
func (*BatchUpdateDatabasesResponse) ProtoMessage() {}
func (x *BatchUpdateDatabasesResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[7]
+ mi := &file_v1_database_service_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1018,7 +922,7 @@ func (x *BatchUpdateDatabasesResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use BatchUpdateDatabasesResponse.ProtoReflect.Descriptor instead.
func (*BatchUpdateDatabasesResponse) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{7}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{5}
}
func (x *BatchUpdateDatabasesResponse) GetDatabases() []*Database {
@@ -1039,7 +943,7 @@ type SyncDatabaseRequest struct {
func (x *SyncDatabaseRequest) Reset() {
*x = SyncDatabaseRequest{}
- mi := &file_v1_database_service_proto_msgTypes[8]
+ mi := &file_v1_database_service_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1051,7 +955,7 @@ func (x *SyncDatabaseRequest) String() string {
func (*SyncDatabaseRequest) ProtoMessage() {}
func (x *SyncDatabaseRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[8]
+ mi := &file_v1_database_service_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1064,7 +968,7 @@ func (x *SyncDatabaseRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use SyncDatabaseRequest.ProtoReflect.Descriptor instead.
func (*SyncDatabaseRequest) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{8}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{6}
}
func (x *SyncDatabaseRequest) GetName() string {
@@ -1082,7 +986,7 @@ type SyncDatabaseResponse struct {
func (x *SyncDatabaseResponse) Reset() {
*x = SyncDatabaseResponse{}
- mi := &file_v1_database_service_proto_msgTypes[9]
+ mi := &file_v1_database_service_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1094,7 +998,7 @@ func (x *SyncDatabaseResponse) String() string {
func (*SyncDatabaseResponse) ProtoMessage() {}
func (x *SyncDatabaseResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[9]
+ mi := &file_v1_database_service_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1107,7 +1011,7 @@ func (x *SyncDatabaseResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use SyncDatabaseResponse.ProtoReflect.Descriptor instead.
func (*SyncDatabaseResponse) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{9}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{7}
}
type GetDatabaseMetadataRequest struct {
@@ -1127,7 +1031,7 @@ type GetDatabaseMetadataRequest struct {
func (x *GetDatabaseMetadataRequest) Reset() {
*x = GetDatabaseMetadataRequest{}
- mi := &file_v1_database_service_proto_msgTypes[10]
+ mi := &file_v1_database_service_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1139,7 +1043,7 @@ func (x *GetDatabaseMetadataRequest) String() string {
func (*GetDatabaseMetadataRequest) ProtoMessage() {}
func (x *GetDatabaseMetadataRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[10]
+ mi := &file_v1_database_service_proto_msgTypes[8]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1152,7 +1056,7 @@ func (x *GetDatabaseMetadataRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetDatabaseMetadataRequest.ProtoReflect.Descriptor instead.
func (*GetDatabaseMetadataRequest) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{10}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{8}
}
func (x *GetDatabaseMetadataRequest) GetName() string {
@@ -1189,7 +1093,7 @@ type GetDatabaseSchemaRequest struct {
func (x *GetDatabaseSchemaRequest) Reset() {
*x = GetDatabaseSchemaRequest{}
- mi := &file_v1_database_service_proto_msgTypes[11]
+ mi := &file_v1_database_service_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1201,7 +1105,7 @@ func (x *GetDatabaseSchemaRequest) String() string {
func (*GetDatabaseSchemaRequest) ProtoMessage() {}
func (x *GetDatabaseSchemaRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[11]
+ mi := &file_v1_database_service_proto_msgTypes[9]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1214,7 +1118,7 @@ func (x *GetDatabaseSchemaRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetDatabaseSchemaRequest.ProtoReflect.Descriptor instead.
func (*GetDatabaseSchemaRequest) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{11}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{9}
}
func (x *GetDatabaseSchemaRequest) GetName() string {
@@ -1251,7 +1155,7 @@ type DiffSchemaRequest struct {
func (x *DiffSchemaRequest) Reset() {
*x = DiffSchemaRequest{}
- mi := &file_v1_database_service_proto_msgTypes[12]
+ mi := &file_v1_database_service_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1263,7 +1167,7 @@ func (x *DiffSchemaRequest) String() string {
func (*DiffSchemaRequest) ProtoMessage() {}
func (x *DiffSchemaRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[12]
+ mi := &file_v1_database_service_proto_msgTypes[10]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1276,7 +1180,7 @@ func (x *DiffSchemaRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DiffSchemaRequest.ProtoReflect.Descriptor instead.
func (*DiffSchemaRequest) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{12}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{10}
}
func (x *DiffSchemaRequest) GetName() string {
@@ -1347,7 +1251,7 @@ type DiffSchemaResponse struct {
func (x *DiffSchemaResponse) Reset() {
*x = DiffSchemaResponse{}
- mi := &file_v1_database_service_proto_msgTypes[13]
+ mi := &file_v1_database_service_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1359,7 +1263,7 @@ func (x *DiffSchemaResponse) String() string {
func (*DiffSchemaResponse) ProtoMessage() {}
func (x *DiffSchemaResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[13]
+ mi := &file_v1_database_service_proto_msgTypes[11]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1372,7 +1276,7 @@ func (x *DiffSchemaResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use DiffSchemaResponse.ProtoReflect.Descriptor instead.
func (*DiffSchemaResponse) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{13}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{11}
}
func (x *DiffSchemaResponse) GetDiff() string {
@@ -1416,7 +1320,7 @@ type Database struct {
func (x *Database) Reset() {
*x = Database{}
- mi := &file_v1_database_service_proto_msgTypes[14]
+ mi := &file_v1_database_service_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1428,7 +1332,7 @@ func (x *Database) String() string {
func (*Database) ProtoMessage() {}
func (x *Database) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[14]
+ mi := &file_v1_database_service_proto_msgTypes[12]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1441,7 +1345,7 @@ func (x *Database) ProtoReflect() protoreflect.Message {
// Deprecated: Use Database.ProtoReflect.Descriptor instead.
func (*Database) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{14}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{12}
}
func (x *Database) GetName() string {
@@ -1536,7 +1440,7 @@ type DatabaseMetadata struct {
func (x *DatabaseMetadata) Reset() {
*x = DatabaseMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[15]
+ mi := &file_v1_database_service_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1548,7 +1452,7 @@ func (x *DatabaseMetadata) String() string {
func (*DatabaseMetadata) ProtoMessage() {}
func (x *DatabaseMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[15]
+ mi := &file_v1_database_service_proto_msgTypes[13]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1561,7 +1465,7 @@ func (x *DatabaseMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use DatabaseMetadata.ProtoReflect.Descriptor instead.
func (*DatabaseMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{15}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{13}
}
func (x *DatabaseMetadata) GetName() string {
@@ -1645,7 +1549,7 @@ type SchemaMetadata struct {
func (x *SchemaMetadata) Reset() {
*x = SchemaMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[16]
+ mi := &file_v1_database_service_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1657,7 +1561,7 @@ func (x *SchemaMetadata) String() string {
func (*SchemaMetadata) ProtoMessage() {}
func (x *SchemaMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[16]
+ mi := &file_v1_database_service_proto_msgTypes[14]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1670,7 +1574,7 @@ func (x *SchemaMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use SchemaMetadata.ProtoReflect.Descriptor instead.
func (*SchemaMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{16}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{14}
}
func (x *SchemaMetadata) GetName() string {
@@ -1792,7 +1696,7 @@ type EnumTypeMetadata struct {
func (x *EnumTypeMetadata) Reset() {
*x = EnumTypeMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[17]
+ mi := &file_v1_database_service_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1804,7 +1708,7 @@ func (x *EnumTypeMetadata) String() string {
func (*EnumTypeMetadata) ProtoMessage() {}
func (x *EnumTypeMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[17]
+ mi := &file_v1_database_service_proto_msgTypes[15]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1817,7 +1721,7 @@ func (x *EnumTypeMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use EnumTypeMetadata.ProtoReflect.Descriptor instead.
func (*EnumTypeMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{17}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{15}
}
func (x *EnumTypeMetadata) GetName() string {
@@ -1865,7 +1769,7 @@ type EventMetadata struct {
func (x *EventMetadata) Reset() {
*x = EventMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[18]
+ mi := &file_v1_database_service_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1877,7 +1781,7 @@ func (x *EventMetadata) String() string {
func (*EventMetadata) ProtoMessage() {}
func (x *EventMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[18]
+ mi := &file_v1_database_service_proto_msgTypes[16]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1890,7 +1794,7 @@ func (x *EventMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use EventMetadata.ProtoReflect.Descriptor instead.
func (*EventMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{18}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{16}
}
func (x *EventMetadata) GetName() string {
@@ -1967,7 +1871,7 @@ type SequenceMetadata struct {
func (x *SequenceMetadata) Reset() {
*x = SequenceMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[19]
+ mi := &file_v1_database_service_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1979,7 +1883,7 @@ func (x *SequenceMetadata) String() string {
func (*SequenceMetadata) ProtoMessage() {}
func (x *SequenceMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[19]
+ mi := &file_v1_database_service_proto_msgTypes[17]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1992,7 +1896,7 @@ func (x *SequenceMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use SequenceMetadata.ProtoReflect.Descriptor instead.
func (*SequenceMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{19}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{17}
}
func (x *SequenceMetadata) GetName() string {
@@ -2108,7 +2012,7 @@ type TriggerMetadata struct {
func (x *TriggerMetadata) Reset() {
*x = TriggerMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[20]
+ mi := &file_v1_database_service_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2120,7 +2024,7 @@ func (x *TriggerMetadata) String() string {
func (*TriggerMetadata) ProtoMessage() {}
func (x *TriggerMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[20]
+ mi := &file_v1_database_service_proto_msgTypes[18]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2133,7 +2037,7 @@ func (x *TriggerMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use TriggerMetadata.ProtoReflect.Descriptor instead.
func (*TriggerMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{20}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{18}
}
func (x *TriggerMetadata) GetName() string {
@@ -2215,7 +2119,7 @@ type ExternalTableMetadata struct {
func (x *ExternalTableMetadata) Reset() {
*x = ExternalTableMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[21]
+ mi := &file_v1_database_service_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2227,7 +2131,7 @@ func (x *ExternalTableMetadata) String() string {
func (*ExternalTableMetadata) ProtoMessage() {}
func (x *ExternalTableMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[21]
+ mi := &file_v1_database_service_proto_msgTypes[19]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2240,7 +2144,7 @@ func (x *ExternalTableMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use ExternalTableMetadata.ProtoReflect.Descriptor instead.
func (*ExternalTableMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{21}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{19}
}
func (x *ExternalTableMetadata) GetName() string {
@@ -2319,7 +2223,7 @@ type TableMetadata struct {
func (x *TableMetadata) Reset() {
*x = TableMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[22]
+ mi := &file_v1_database_service_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2331,7 +2235,7 @@ func (x *TableMetadata) String() string {
func (*TableMetadata) ProtoMessage() {}
func (x *TableMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[22]
+ mi := &file_v1_database_service_proto_msgTypes[20]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2344,7 +2248,7 @@ func (x *TableMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use TableMetadata.ProtoReflect.Descriptor instead.
func (*TableMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{22}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{20}
}
func (x *TableMetadata) GetName() string {
@@ -2500,7 +2404,7 @@ type CheckConstraintMetadata struct {
func (x *CheckConstraintMetadata) Reset() {
*x = CheckConstraintMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[23]
+ mi := &file_v1_database_service_proto_msgTypes[21]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2512,7 +2416,7 @@ func (x *CheckConstraintMetadata) String() string {
func (*CheckConstraintMetadata) ProtoMessage() {}
func (x *CheckConstraintMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[23]
+ mi := &file_v1_database_service_proto_msgTypes[21]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2525,7 +2429,7 @@ func (x *CheckConstraintMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use CheckConstraintMetadata.ProtoReflect.Descriptor instead.
func (*CheckConstraintMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{23}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{21}
}
func (x *CheckConstraintMetadata) GetName() string {
@@ -2584,7 +2488,7 @@ type TablePartitionMetadata struct {
func (x *TablePartitionMetadata) Reset() {
*x = TablePartitionMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[24]
+ mi := &file_v1_database_service_proto_msgTypes[22]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2596,7 +2500,7 @@ func (x *TablePartitionMetadata) String() string {
func (*TablePartitionMetadata) ProtoMessage() {}
func (x *TablePartitionMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[24]
+ mi := &file_v1_database_service_proto_msgTypes[22]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2609,7 +2513,7 @@ func (x *TablePartitionMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use TablePartitionMetadata.ProtoReflect.Descriptor instead.
func (*TablePartitionMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{24}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{22}
}
func (x *TablePartitionMetadata) GetName() string {
@@ -2704,7 +2608,7 @@ type ColumnMetadata struct {
func (x *ColumnMetadata) Reset() {
*x = ColumnMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[25]
+ mi := &file_v1_database_service_proto_msgTypes[23]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2716,7 +2620,7 @@ func (x *ColumnMetadata) String() string {
func (*ColumnMetadata) ProtoMessage() {}
func (x *ColumnMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[25]
+ mi := &file_v1_database_service_proto_msgTypes[23]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2729,7 +2633,7 @@ func (x *ColumnMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use ColumnMetadata.ProtoReflect.Descriptor instead.
func (*ColumnMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{25}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{23}
}
func (x *ColumnMetadata) GetName() string {
@@ -2882,7 +2786,7 @@ type GenerationMetadata struct {
func (x *GenerationMetadata) Reset() {
*x = GenerationMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[26]
+ mi := &file_v1_database_service_proto_msgTypes[24]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2894,7 +2798,7 @@ func (x *GenerationMetadata) String() string {
func (*GenerationMetadata) ProtoMessage() {}
func (x *GenerationMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[26]
+ mi := &file_v1_database_service_proto_msgTypes[24]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2907,7 +2811,7 @@ func (x *GenerationMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use GenerationMetadata.ProtoReflect.Descriptor instead.
func (*GenerationMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{26}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{24}
}
func (x *GenerationMetadata) GetType() GenerationMetadata_Type {
@@ -2946,7 +2850,7 @@ type ViewMetadata struct {
func (x *ViewMetadata) Reset() {
*x = ViewMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[27]
+ mi := &file_v1_database_service_proto_msgTypes[25]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -2958,7 +2862,7 @@ func (x *ViewMetadata) String() string {
func (*ViewMetadata) ProtoMessage() {}
func (x *ViewMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[27]
+ mi := &file_v1_database_service_proto_msgTypes[25]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -2971,7 +2875,7 @@ func (x *ViewMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use ViewMetadata.ProtoReflect.Descriptor instead.
func (*ViewMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{27}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{25}
}
func (x *ViewMetadata) GetName() string {
@@ -3038,7 +2942,7 @@ type DependencyColumn struct {
func (x *DependencyColumn) Reset() {
*x = DependencyColumn{}
- mi := &file_v1_database_service_proto_msgTypes[28]
+ mi := &file_v1_database_service_proto_msgTypes[26]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -3050,7 +2954,7 @@ func (x *DependencyColumn) String() string {
func (*DependencyColumn) ProtoMessage() {}
func (x *DependencyColumn) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[28]
+ mi := &file_v1_database_service_proto_msgTypes[26]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -3063,7 +2967,7 @@ func (x *DependencyColumn) ProtoReflect() protoreflect.Message {
// Deprecated: Use DependencyColumn.ProtoReflect.Descriptor instead.
func (*DependencyColumn) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{28}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{26}
}
func (x *DependencyColumn) GetSchema() string {
@@ -3110,7 +3014,7 @@ type MaterializedViewMetadata struct {
func (x *MaterializedViewMetadata) Reset() {
*x = MaterializedViewMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[29]
+ mi := &file_v1_database_service_proto_msgTypes[27]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -3122,7 +3026,7 @@ func (x *MaterializedViewMetadata) String() string {
func (*MaterializedViewMetadata) ProtoMessage() {}
func (x *MaterializedViewMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[29]
+ mi := &file_v1_database_service_proto_msgTypes[27]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -3135,7 +3039,7 @@ func (x *MaterializedViewMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use MaterializedViewMetadata.ProtoReflect.Descriptor instead.
func (*MaterializedViewMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{29}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{27}
}
func (x *MaterializedViewMetadata) GetName() string {
@@ -3199,7 +3103,7 @@ type DependencyTable struct {
func (x *DependencyTable) Reset() {
*x = DependencyTable{}
- mi := &file_v1_database_service_proto_msgTypes[30]
+ mi := &file_v1_database_service_proto_msgTypes[28]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -3211,7 +3115,7 @@ func (x *DependencyTable) String() string {
func (*DependencyTable) ProtoMessage() {}
func (x *DependencyTable) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[30]
+ mi := &file_v1_database_service_proto_msgTypes[28]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -3224,7 +3128,7 @@ func (x *DependencyTable) ProtoReflect() protoreflect.Message {
// Deprecated: Use DependencyTable.ProtoReflect.Descriptor instead.
func (*DependencyTable) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{30}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{28}
}
func (x *DependencyTable) GetSchema() string {
@@ -3267,7 +3171,7 @@ type FunctionMetadata struct {
func (x *FunctionMetadata) Reset() {
*x = FunctionMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[31]
+ mi := &file_v1_database_service_proto_msgTypes[29]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -3279,7 +3183,7 @@ func (x *FunctionMetadata) String() string {
func (*FunctionMetadata) ProtoMessage() {}
func (x *FunctionMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[31]
+ mi := &file_v1_database_service_proto_msgTypes[29]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -3292,7 +3196,7 @@ func (x *FunctionMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use FunctionMetadata.ProtoReflect.Descriptor instead.
func (*FunctionMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{31}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{29}
}
func (x *FunctionMetadata) GetName() string {
@@ -3387,7 +3291,7 @@ type ProcedureMetadata struct {
func (x *ProcedureMetadata) Reset() {
*x = ProcedureMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[32]
+ mi := &file_v1_database_service_proto_msgTypes[30]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -3399,7 +3303,7 @@ func (x *ProcedureMetadata) String() string {
func (*ProcedureMetadata) ProtoMessage() {}
func (x *ProcedureMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[32]
+ mi := &file_v1_database_service_proto_msgTypes[30]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -3412,7 +3316,7 @@ func (x *ProcedureMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use ProcedureMetadata.ProtoReflect.Descriptor instead.
func (*ProcedureMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{32}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{30}
}
func (x *ProcedureMetadata) GetName() string {
@@ -3484,7 +3388,7 @@ type PackageMetadata struct {
func (x *PackageMetadata) Reset() {
*x = PackageMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[33]
+ mi := &file_v1_database_service_proto_msgTypes[31]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -3496,7 +3400,7 @@ func (x *PackageMetadata) String() string {
func (*PackageMetadata) ProtoMessage() {}
func (x *PackageMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[33]
+ mi := &file_v1_database_service_proto_msgTypes[31]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -3509,7 +3413,7 @@ func (x *PackageMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use PackageMetadata.ProtoReflect.Descriptor instead.
func (*PackageMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{33}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{31}
}
func (x *PackageMetadata) GetName() string {
@@ -3555,7 +3459,7 @@ type TaskMetadata struct {
func (x *TaskMetadata) Reset() {
*x = TaskMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[34]
+ mi := &file_v1_database_service_proto_msgTypes[32]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -3567,7 +3471,7 @@ func (x *TaskMetadata) String() string {
func (*TaskMetadata) ProtoMessage() {}
func (x *TaskMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[34]
+ mi := &file_v1_database_service_proto_msgTypes[32]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -3580,7 +3484,7 @@ func (x *TaskMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use TaskMetadata.ProtoReflect.Descriptor instead.
func (*TaskMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{34}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{32}
}
func (x *TaskMetadata) GetName() string {
@@ -3677,7 +3581,7 @@ type StreamMetadata struct {
func (x *StreamMetadata) Reset() {
*x = StreamMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[35]
+ mi := &file_v1_database_service_proto_msgTypes[33]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -3689,7 +3593,7 @@ func (x *StreamMetadata) String() string {
func (*StreamMetadata) ProtoMessage() {}
func (x *StreamMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[35]
+ mi := &file_v1_database_service_proto_msgTypes[33]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -3702,7 +3606,7 @@ func (x *StreamMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use StreamMetadata.ProtoReflect.Descriptor instead.
func (*StreamMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{35}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{33}
}
func (x *StreamMetadata) GetName() string {
@@ -3801,7 +3705,7 @@ type IndexMetadata struct {
func (x *IndexMetadata) Reset() {
*x = IndexMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[36]
+ mi := &file_v1_database_service_proto_msgTypes[34]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -3813,7 +3717,7 @@ func (x *IndexMetadata) String() string {
func (*IndexMetadata) ProtoMessage() {}
func (x *IndexMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[36]
+ mi := &file_v1_database_service_proto_msgTypes[34]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -3826,7 +3730,7 @@ func (x *IndexMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use IndexMetadata.ProtoReflect.Descriptor instead.
func (*IndexMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{36}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{34}
}
func (x *IndexMetadata) GetName() string {
@@ -3945,7 +3849,7 @@ type ExtensionMetadata struct {
func (x *ExtensionMetadata) Reset() {
*x = ExtensionMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[37]
+ mi := &file_v1_database_service_proto_msgTypes[35]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -3957,7 +3861,7 @@ func (x *ExtensionMetadata) String() string {
func (*ExtensionMetadata) ProtoMessage() {}
func (x *ExtensionMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[37]
+ mi := &file_v1_database_service_proto_msgTypes[35]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -3970,7 +3874,7 @@ func (x *ExtensionMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use ExtensionMetadata.ProtoReflect.Descriptor instead.
func (*ExtensionMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{37}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{35}
}
func (x *ExtensionMetadata) GetName() string {
@@ -4029,7 +3933,7 @@ type ForeignKeyMetadata struct {
func (x *ForeignKeyMetadata) Reset() {
*x = ForeignKeyMetadata{}
- mi := &file_v1_database_service_proto_msgTypes[38]
+ mi := &file_v1_database_service_proto_msgTypes[36]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -4041,7 +3945,7 @@ func (x *ForeignKeyMetadata) String() string {
func (*ForeignKeyMetadata) ProtoMessage() {}
func (x *ForeignKeyMetadata) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[38]
+ mi := &file_v1_database_service_proto_msgTypes[36]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -4054,7 +3958,7 @@ func (x *ForeignKeyMetadata) ProtoReflect() protoreflect.Message {
// Deprecated: Use ForeignKeyMetadata.ProtoReflect.Descriptor instead.
func (*ForeignKeyMetadata) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{38}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{36}
}
func (x *ForeignKeyMetadata) GetName() string {
@@ -4124,7 +4028,7 @@ type DatabaseSchema struct {
func (x *DatabaseSchema) Reset() {
*x = DatabaseSchema{}
- mi := &file_v1_database_service_proto_msgTypes[39]
+ mi := &file_v1_database_service_proto_msgTypes[37]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -4136,7 +4040,7 @@ func (x *DatabaseSchema) String() string {
func (*DatabaseSchema) ProtoMessage() {}
func (x *DatabaseSchema) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[39]
+ mi := &file_v1_database_service_proto_msgTypes[37]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -4149,7 +4053,7 @@ func (x *DatabaseSchema) ProtoReflect() protoreflect.Message {
// Deprecated: Use DatabaseSchema.ProtoReflect.Descriptor instead.
func (*DatabaseSchema) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{39}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{37}
}
func (x *DatabaseSchema) GetSchema() string {
@@ -4192,7 +4096,7 @@ type ListSlowQueriesRequest struct {
func (x *ListSlowQueriesRequest) Reset() {
*x = ListSlowQueriesRequest{}
- mi := &file_v1_database_service_proto_msgTypes[40]
+ mi := &file_v1_database_service_proto_msgTypes[38]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -4204,7 +4108,7 @@ func (x *ListSlowQueriesRequest) String() string {
func (*ListSlowQueriesRequest) ProtoMessage() {}
func (x *ListSlowQueriesRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[40]
+ mi := &file_v1_database_service_proto_msgTypes[38]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -4217,7 +4121,7 @@ func (x *ListSlowQueriesRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListSlowQueriesRequest.ProtoReflect.Descriptor instead.
func (*ListSlowQueriesRequest) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{40}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{38}
}
func (x *ListSlowQueriesRequest) GetParent() string {
@@ -4252,7 +4156,7 @@ type ListSlowQueriesResponse struct {
func (x *ListSlowQueriesResponse) Reset() {
*x = ListSlowQueriesResponse{}
- mi := &file_v1_database_service_proto_msgTypes[41]
+ mi := &file_v1_database_service_proto_msgTypes[39]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -4264,7 +4168,7 @@ func (x *ListSlowQueriesResponse) String() string {
func (*ListSlowQueriesResponse) ProtoMessage() {}
func (x *ListSlowQueriesResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[41]
+ mi := &file_v1_database_service_proto_msgTypes[39]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -4277,7 +4181,7 @@ func (x *ListSlowQueriesResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListSlowQueriesResponse.ProtoReflect.Descriptor instead.
func (*ListSlowQueriesResponse) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{41}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{39}
}
func (x *ListSlowQueriesResponse) GetSlowQueryLogs() []*SlowQueryLog {
@@ -4304,7 +4208,7 @@ type SlowQueryLog struct {
func (x *SlowQueryLog) Reset() {
*x = SlowQueryLog{}
- mi := &file_v1_database_service_proto_msgTypes[42]
+ mi := &file_v1_database_service_proto_msgTypes[40]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -4316,7 +4220,7 @@ func (x *SlowQueryLog) String() string {
func (*SlowQueryLog) ProtoMessage() {}
func (x *SlowQueryLog) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[42]
+ mi := &file_v1_database_service_proto_msgTypes[40]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -4329,7 +4233,7 @@ func (x *SlowQueryLog) ProtoReflect() protoreflect.Message {
// Deprecated: Use SlowQueryLog.ProtoReflect.Descriptor instead.
func (*SlowQueryLog) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{42}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{40}
}
func (x *SlowQueryLog) GetResource() string {
@@ -4387,7 +4291,7 @@ type SlowQueryStatistics struct {
func (x *SlowQueryStatistics) Reset() {
*x = SlowQueryStatistics{}
- mi := &file_v1_database_service_proto_msgTypes[43]
+ mi := &file_v1_database_service_proto_msgTypes[41]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -4399,7 +4303,7 @@ func (x *SlowQueryStatistics) String() string {
func (*SlowQueryStatistics) ProtoMessage() {}
func (x *SlowQueryStatistics) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[43]
+ mi := &file_v1_database_service_proto_msgTypes[41]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -4412,7 +4316,7 @@ func (x *SlowQueryStatistics) ProtoReflect() protoreflect.Message {
// Deprecated: Use SlowQueryStatistics.ProtoReflect.Descriptor instead.
func (*SlowQueryStatistics) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{43}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{41}
}
func (x *SlowQueryStatistics) GetSqlFingerprint() string {
@@ -4520,7 +4424,7 @@ type SlowQueryDetails struct {
func (x *SlowQueryDetails) Reset() {
*x = SlowQueryDetails{}
- mi := &file_v1_database_service_proto_msgTypes[44]
+ mi := &file_v1_database_service_proto_msgTypes[42]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -4532,7 +4436,7 @@ func (x *SlowQueryDetails) String() string {
func (*SlowQueryDetails) ProtoMessage() {}
func (x *SlowQueryDetails) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[44]
+ mi := &file_v1_database_service_proto_msgTypes[42]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -4545,7 +4449,7 @@ func (x *SlowQueryDetails) ProtoReflect() protoreflect.Message {
// Deprecated: Use SlowQueryDetails.ProtoReflect.Descriptor instead.
func (*SlowQueryDetails) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{44}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{42}
}
func (x *SlowQueryDetails) GetStartTime() *timestamppb.Timestamp {
@@ -4614,7 +4518,7 @@ type ListSecretsRequest struct {
func (x *ListSecretsRequest) Reset() {
*x = ListSecretsRequest{}
- mi := &file_v1_database_service_proto_msgTypes[45]
+ mi := &file_v1_database_service_proto_msgTypes[43]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -4626,7 +4530,7 @@ func (x *ListSecretsRequest) String() string {
func (*ListSecretsRequest) ProtoMessage() {}
func (x *ListSecretsRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[45]
+ mi := &file_v1_database_service_proto_msgTypes[43]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -4639,7 +4543,7 @@ func (x *ListSecretsRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListSecretsRequest.ProtoReflect.Descriptor instead.
func (*ListSecretsRequest) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{45}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{43}
}
func (x *ListSecretsRequest) GetParent() string {
@@ -4676,7 +4580,7 @@ type ListSecretsResponse struct {
func (x *ListSecretsResponse) Reset() {
*x = ListSecretsResponse{}
- mi := &file_v1_database_service_proto_msgTypes[46]
+ mi := &file_v1_database_service_proto_msgTypes[44]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -4688,7 +4592,7 @@ func (x *ListSecretsResponse) String() string {
func (*ListSecretsResponse) ProtoMessage() {}
func (x *ListSecretsResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[46]
+ mi := &file_v1_database_service_proto_msgTypes[44]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -4701,7 +4605,7 @@ func (x *ListSecretsResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListSecretsResponse.ProtoReflect.Descriptor instead.
func (*ListSecretsResponse) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{46}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{44}
}
func (x *ListSecretsResponse) GetSecrets() []*Secret {
@@ -4732,7 +4636,7 @@ type UpdateSecretRequest struct {
func (x *UpdateSecretRequest) Reset() {
*x = UpdateSecretRequest{}
- mi := &file_v1_database_service_proto_msgTypes[47]
+ mi := &file_v1_database_service_proto_msgTypes[45]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -4744,7 +4648,7 @@ func (x *UpdateSecretRequest) String() string {
func (*UpdateSecretRequest) ProtoMessage() {}
func (x *UpdateSecretRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[47]
+ mi := &file_v1_database_service_proto_msgTypes[45]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -4757,7 +4661,7 @@ func (x *UpdateSecretRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateSecretRequest.ProtoReflect.Descriptor instead.
func (*UpdateSecretRequest) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{47}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{45}
}
func (x *UpdateSecretRequest) GetSecret() *Secret {
@@ -4793,7 +4697,7 @@ type DeleteSecretRequest struct {
func (x *DeleteSecretRequest) Reset() {
*x = DeleteSecretRequest{}
- mi := &file_v1_database_service_proto_msgTypes[48]
+ mi := &file_v1_database_service_proto_msgTypes[46]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -4805,7 +4709,7 @@ func (x *DeleteSecretRequest) String() string {
func (*DeleteSecretRequest) ProtoMessage() {}
func (x *DeleteSecretRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[48]
+ mi := &file_v1_database_service_proto_msgTypes[46]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -4818,7 +4722,7 @@ func (x *DeleteSecretRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteSecretRequest.ProtoReflect.Descriptor instead.
func (*DeleteSecretRequest) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{48}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{46}
}
func (x *DeleteSecretRequest) GetName() string {
@@ -4849,7 +4753,7 @@ type Secret struct {
func (x *Secret) Reset() {
*x = Secret{}
- mi := &file_v1_database_service_proto_msgTypes[49]
+ mi := &file_v1_database_service_proto_msgTypes[47]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -4861,7 +4765,7 @@ func (x *Secret) String() string {
func (*Secret) ProtoMessage() {}
func (x *Secret) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[49]
+ mi := &file_v1_database_service_proto_msgTypes[47]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -4874,7 +4778,7 @@ func (x *Secret) ProtoReflect() protoreflect.Message {
// Deprecated: Use Secret.ProtoReflect.Descriptor instead.
func (*Secret) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{49}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{47}
}
func (x *Secret) GetName() string {
@@ -4925,7 +4829,7 @@ type AdviseIndexRequest struct {
func (x *AdviseIndexRequest) Reset() {
*x = AdviseIndexRequest{}
- mi := &file_v1_database_service_proto_msgTypes[50]
+ mi := &file_v1_database_service_proto_msgTypes[48]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -4937,7 +4841,7 @@ func (x *AdviseIndexRequest) String() string {
func (*AdviseIndexRequest) ProtoMessage() {}
func (x *AdviseIndexRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[50]
+ mi := &file_v1_database_service_proto_msgTypes[48]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -4950,7 +4854,7 @@ func (x *AdviseIndexRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use AdviseIndexRequest.ProtoReflect.Descriptor instead.
func (*AdviseIndexRequest) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{50}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{48}
}
func (x *AdviseIndexRequest) GetParent() string {
@@ -4982,7 +4886,7 @@ type AdviseIndexResponse struct {
func (x *AdviseIndexResponse) Reset() {
*x = AdviseIndexResponse{}
- mi := &file_v1_database_service_proto_msgTypes[51]
+ mi := &file_v1_database_service_proto_msgTypes[49]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -4994,7 +4898,7 @@ func (x *AdviseIndexResponse) String() string {
func (*AdviseIndexResponse) ProtoMessage() {}
func (x *AdviseIndexResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[51]
+ mi := &file_v1_database_service_proto_msgTypes[49]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -5007,7 +4911,7 @@ func (x *AdviseIndexResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use AdviseIndexResponse.ProtoReflect.Descriptor instead.
func (*AdviseIndexResponse) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{51}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{49}
}
func (x *AdviseIndexResponse) GetCurrentIndex() string {
@@ -5040,7 +4944,7 @@ type ChangedResources struct {
func (x *ChangedResources) Reset() {
*x = ChangedResources{}
- mi := &file_v1_database_service_proto_msgTypes[52]
+ mi := &file_v1_database_service_proto_msgTypes[50]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -5052,7 +4956,7 @@ func (x *ChangedResources) String() string {
func (*ChangedResources) ProtoMessage() {}
func (x *ChangedResources) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[52]
+ mi := &file_v1_database_service_proto_msgTypes[50]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -5065,7 +4969,7 @@ func (x *ChangedResources) ProtoReflect() protoreflect.Message {
// Deprecated: Use ChangedResources.ProtoReflect.Descriptor instead.
func (*ChangedResources) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{52}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{50}
}
func (x *ChangedResources) GetDatabases() []*ChangedResourceDatabase {
@@ -5085,7 +4989,7 @@ type ChangedResourceDatabase struct {
func (x *ChangedResourceDatabase) Reset() {
*x = ChangedResourceDatabase{}
- mi := &file_v1_database_service_proto_msgTypes[53]
+ mi := &file_v1_database_service_proto_msgTypes[51]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -5097,7 +5001,7 @@ func (x *ChangedResourceDatabase) String() string {
func (*ChangedResourceDatabase) ProtoMessage() {}
func (x *ChangedResourceDatabase) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[53]
+ mi := &file_v1_database_service_proto_msgTypes[51]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -5110,7 +5014,7 @@ func (x *ChangedResourceDatabase) ProtoReflect() protoreflect.Message {
// Deprecated: Use ChangedResourceDatabase.ProtoReflect.Descriptor instead.
func (*ChangedResourceDatabase) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{53}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{51}
}
func (x *ChangedResourceDatabase) GetName() string {
@@ -5140,7 +5044,7 @@ type ChangedResourceSchema struct {
func (x *ChangedResourceSchema) Reset() {
*x = ChangedResourceSchema{}
- mi := &file_v1_database_service_proto_msgTypes[54]
+ mi := &file_v1_database_service_proto_msgTypes[52]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -5152,7 +5056,7 @@ func (x *ChangedResourceSchema) String() string {
func (*ChangedResourceSchema) ProtoMessage() {}
func (x *ChangedResourceSchema) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[54]
+ mi := &file_v1_database_service_proto_msgTypes[52]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -5165,7 +5069,7 @@ func (x *ChangedResourceSchema) ProtoReflect() protoreflect.Message {
// Deprecated: Use ChangedResourceSchema.ProtoReflect.Descriptor instead.
func (*ChangedResourceSchema) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{54}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{52}
}
func (x *ChangedResourceSchema) GetName() string {
@@ -5214,7 +5118,7 @@ type ChangedResourceTable struct {
func (x *ChangedResourceTable) Reset() {
*x = ChangedResourceTable{}
- mi := &file_v1_database_service_proto_msgTypes[55]
+ mi := &file_v1_database_service_proto_msgTypes[53]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -5226,7 +5130,7 @@ func (x *ChangedResourceTable) String() string {
func (*ChangedResourceTable) ProtoMessage() {}
func (x *ChangedResourceTable) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[55]
+ mi := &file_v1_database_service_proto_msgTypes[53]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -5239,7 +5143,7 @@ func (x *ChangedResourceTable) ProtoReflect() protoreflect.Message {
// Deprecated: Use ChangedResourceTable.ProtoReflect.Descriptor instead.
func (*ChangedResourceTable) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{55}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{53}
}
func (x *ChangedResourceTable) GetName() string {
@@ -5267,7 +5171,7 @@ type ChangedResourceView struct {
func (x *ChangedResourceView) Reset() {
*x = ChangedResourceView{}
- mi := &file_v1_database_service_proto_msgTypes[56]
+ mi := &file_v1_database_service_proto_msgTypes[54]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -5279,7 +5183,7 @@ func (x *ChangedResourceView) String() string {
func (*ChangedResourceView) ProtoMessage() {}
func (x *ChangedResourceView) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[56]
+ mi := &file_v1_database_service_proto_msgTypes[54]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -5292,7 +5196,7 @@ func (x *ChangedResourceView) ProtoReflect() protoreflect.Message {
// Deprecated: Use ChangedResourceView.ProtoReflect.Descriptor instead.
func (*ChangedResourceView) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{56}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{54}
}
func (x *ChangedResourceView) GetName() string {
@@ -5320,7 +5224,7 @@ type ChangedResourceFunction struct {
func (x *ChangedResourceFunction) Reset() {
*x = ChangedResourceFunction{}
- mi := &file_v1_database_service_proto_msgTypes[57]
+ mi := &file_v1_database_service_proto_msgTypes[55]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -5332,7 +5236,7 @@ func (x *ChangedResourceFunction) String() string {
func (*ChangedResourceFunction) ProtoMessage() {}
func (x *ChangedResourceFunction) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[57]
+ mi := &file_v1_database_service_proto_msgTypes[55]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -5345,7 +5249,7 @@ func (x *ChangedResourceFunction) ProtoReflect() protoreflect.Message {
// Deprecated: Use ChangedResourceFunction.ProtoReflect.Descriptor instead.
func (*ChangedResourceFunction) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{57}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{55}
}
func (x *ChangedResourceFunction) GetName() string {
@@ -5373,7 +5277,7 @@ type ChangedResourceProcedure struct {
func (x *ChangedResourceProcedure) Reset() {
*x = ChangedResourceProcedure{}
- mi := &file_v1_database_service_proto_msgTypes[58]
+ mi := &file_v1_database_service_proto_msgTypes[56]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -5385,7 +5289,7 @@ func (x *ChangedResourceProcedure) String() string {
func (*ChangedResourceProcedure) ProtoMessage() {}
func (x *ChangedResourceProcedure) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[58]
+ mi := &file_v1_database_service_proto_msgTypes[56]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -5398,7 +5302,7 @@ func (x *ChangedResourceProcedure) ProtoReflect() protoreflect.Message {
// Deprecated: Use ChangedResourceProcedure.ProtoReflect.Descriptor instead.
func (*ChangedResourceProcedure) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{58}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{56}
}
func (x *ChangedResourceProcedure) GetName() string {
@@ -5437,7 +5341,7 @@ type ListRevisionsRequest struct {
func (x *ListRevisionsRequest) Reset() {
*x = ListRevisionsRequest{}
- mi := &file_v1_database_service_proto_msgTypes[59]
+ mi := &file_v1_database_service_proto_msgTypes[57]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -5449,7 +5353,7 @@ func (x *ListRevisionsRequest) String() string {
func (*ListRevisionsRequest) ProtoMessage() {}
func (x *ListRevisionsRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[59]
+ mi := &file_v1_database_service_proto_msgTypes[57]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -5462,7 +5366,7 @@ func (x *ListRevisionsRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListRevisionsRequest.ProtoReflect.Descriptor instead.
func (*ListRevisionsRequest) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{59}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{57}
}
func (x *ListRevisionsRequest) GetParent() string {
@@ -5505,7 +5409,7 @@ type ListRevisionsResponse struct {
func (x *ListRevisionsResponse) Reset() {
*x = ListRevisionsResponse{}
- mi := &file_v1_database_service_proto_msgTypes[60]
+ mi := &file_v1_database_service_proto_msgTypes[58]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -5517,7 +5421,7 @@ func (x *ListRevisionsResponse) String() string {
func (*ListRevisionsResponse) ProtoMessage() {}
func (x *ListRevisionsResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[60]
+ mi := &file_v1_database_service_proto_msgTypes[58]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -5530,7 +5434,7 @@ func (x *ListRevisionsResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListRevisionsResponse.ProtoReflect.Descriptor instead.
func (*ListRevisionsResponse) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{60}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{58}
}
func (x *ListRevisionsResponse) GetRevisions() []*Revision {
@@ -5559,7 +5463,7 @@ type CreateRevisionRequest struct {
func (x *CreateRevisionRequest) Reset() {
*x = CreateRevisionRequest{}
- mi := &file_v1_database_service_proto_msgTypes[61]
+ mi := &file_v1_database_service_proto_msgTypes[59]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -5571,7 +5475,7 @@ func (x *CreateRevisionRequest) String() string {
func (*CreateRevisionRequest) ProtoMessage() {}
func (x *CreateRevisionRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[61]
+ mi := &file_v1_database_service_proto_msgTypes[59]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -5584,7 +5488,7 @@ func (x *CreateRevisionRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use CreateRevisionRequest.ProtoReflect.Descriptor instead.
func (*CreateRevisionRequest) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{61}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{59}
}
func (x *CreateRevisionRequest) GetParent() string {
@@ -5612,7 +5516,7 @@ type GetRevisionRequest struct {
func (x *GetRevisionRequest) Reset() {
*x = GetRevisionRequest{}
- mi := &file_v1_database_service_proto_msgTypes[62]
+ mi := &file_v1_database_service_proto_msgTypes[60]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -5624,7 +5528,7 @@ func (x *GetRevisionRequest) String() string {
func (*GetRevisionRequest) ProtoMessage() {}
func (x *GetRevisionRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[62]
+ mi := &file_v1_database_service_proto_msgTypes[60]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -5637,7 +5541,7 @@ func (x *GetRevisionRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetRevisionRequest.ProtoReflect.Descriptor instead.
func (*GetRevisionRequest) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{62}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{60}
}
func (x *GetRevisionRequest) GetName() string {
@@ -5658,7 +5562,7 @@ type DeleteRevisionRequest struct {
func (x *DeleteRevisionRequest) Reset() {
*x = DeleteRevisionRequest{}
- mi := &file_v1_database_service_proto_msgTypes[63]
+ mi := &file_v1_database_service_proto_msgTypes[61]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -5670,7 +5574,7 @@ func (x *DeleteRevisionRequest) String() string {
func (*DeleteRevisionRequest) ProtoMessage() {}
func (x *DeleteRevisionRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[63]
+ mi := &file_v1_database_service_proto_msgTypes[61]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -5683,7 +5587,7 @@ func (x *DeleteRevisionRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteRevisionRequest.ProtoReflect.Descriptor instead.
func (*DeleteRevisionRequest) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{63}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{61}
}
func (x *DeleteRevisionRequest) GetName() string {
@@ -5733,7 +5637,7 @@ type Revision struct {
func (x *Revision) Reset() {
*x = Revision{}
- mi := &file_v1_database_service_proto_msgTypes[64]
+ mi := &file_v1_database_service_proto_msgTypes[62]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -5745,7 +5649,7 @@ func (x *Revision) String() string {
func (*Revision) ProtoMessage() {}
func (x *Revision) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[64]
+ mi := &file_v1_database_service_proto_msgTypes[62]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -5758,7 +5662,7 @@ func (x *Revision) ProtoReflect() protoreflect.Message {
// Deprecated: Use Revision.ProtoReflect.Descriptor instead.
func (*Revision) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{64}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{62}
}
func (x *Revision) GetName() string {
@@ -5911,7 +5815,7 @@ type ListChangelogsRequest struct {
func (x *ListChangelogsRequest) Reset() {
*x = ListChangelogsRequest{}
- mi := &file_v1_database_service_proto_msgTypes[65]
+ mi := &file_v1_database_service_proto_msgTypes[63]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -5923,7 +5827,7 @@ func (x *ListChangelogsRequest) String() string {
func (*ListChangelogsRequest) ProtoMessage() {}
func (x *ListChangelogsRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[65]
+ mi := &file_v1_database_service_proto_msgTypes[63]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -5936,7 +5840,7 @@ func (x *ListChangelogsRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListChangelogsRequest.ProtoReflect.Descriptor instead.
func (*ListChangelogsRequest) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{65}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{63}
}
func (x *ListChangelogsRequest) GetParent() string {
@@ -5987,7 +5891,7 @@ type ListChangelogsResponse struct {
func (x *ListChangelogsResponse) Reset() {
*x = ListChangelogsResponse{}
- mi := &file_v1_database_service_proto_msgTypes[66]
+ mi := &file_v1_database_service_proto_msgTypes[64]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -5999,7 +5903,7 @@ func (x *ListChangelogsResponse) String() string {
func (*ListChangelogsResponse) ProtoMessage() {}
func (x *ListChangelogsResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[66]
+ mi := &file_v1_database_service_proto_msgTypes[64]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -6012,7 +5916,7 @@ func (x *ListChangelogsResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ListChangelogsResponse.ProtoReflect.Descriptor instead.
func (*ListChangelogsResponse) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{66}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{64}
}
func (x *ListChangelogsResponse) GetChangelogs() []*Changelog {
@@ -6043,7 +5947,7 @@ type GetChangelogRequest struct {
func (x *GetChangelogRequest) Reset() {
*x = GetChangelogRequest{}
- mi := &file_v1_database_service_proto_msgTypes[67]
+ mi := &file_v1_database_service_proto_msgTypes[65]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -6055,7 +5959,7 @@ func (x *GetChangelogRequest) String() string {
func (*GetChangelogRequest) ProtoMessage() {}
func (x *GetChangelogRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[67]
+ mi := &file_v1_database_service_proto_msgTypes[65]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -6068,7 +5972,7 @@ func (x *GetChangelogRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetChangelogRequest.ProtoReflect.Descriptor instead.
func (*GetChangelogRequest) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{67}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{65}
}
func (x *GetChangelogRequest) GetName() string {
@@ -6125,7 +6029,7 @@ type Changelog struct {
func (x *Changelog) Reset() {
*x = Changelog{}
- mi := &file_v1_database_service_proto_msgTypes[68]
+ mi := &file_v1_database_service_proto_msgTypes[66]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -6137,7 +6041,7 @@ func (x *Changelog) String() string {
func (*Changelog) ProtoMessage() {}
func (x *Changelog) ProtoReflect() protoreflect.Message {
- mi := &file_v1_database_service_proto_msgTypes[68]
+ mi := &file_v1_database_service_proto_msgTypes[66]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -6150,7 +6054,7 @@ func (x *Changelog) ProtoReflect() protoreflect.Message {
// Deprecated: Use Changelog.ProtoReflect.Descriptor instead.
func (*Changelog) Descriptor() ([]byte, []int) {
- return file_v1_database_service_proto_rawDescGZIP(), []int{68}
+ return file_v1_database_service_proto_rawDescGZIP(), []int{66}
}
func (x *Changelog) GetName() string {
@@ -6294,34 +6198,19 @@ var file_v1_database_service_proto_rawDesc = string([]byte{
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, 0x22, 0xaa, 0x01, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x49,
- 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73,
- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e,
- 0x74, 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, 0x49,
- 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12,
- 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a,
- 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x66,
- 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c,
- 0x74, 0x65, 0x72, 0x22, 0x7c, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61,
- 0x6e, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70,
- 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,
- 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x09,
- 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78,
- 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65,
- 0x6e, 0x22, 0x8a, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61,
- 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x06, 0x70, 0x61,
- 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e, 0xe2, 0x41, 0x01, 0x02,
- 0xfa, 0x41, 0x17, 0x12, 0x15, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f,
- 0x6d, 0x2f, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65,
- 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18,
- 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12,
- 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x74,
+ 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xc5, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x44,
+ 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
+ 0x36, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
+ 0x1e, 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x17, 0x12, 0x15, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52,
+ 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f,
+ 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65,
+ 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b,
+ 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f,
+ 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x73,
+ 0x68, 0x6f, 0x77, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28,
+ 0x08, 0x52, 0x0b, 0x73, 0x68, 0x6f, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, 0x74,
0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x62,
0x61, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x79, 0x74,
@@ -7305,7 +7194,7 @@ var file_v1_database_service_proto_rawDesc = string([]byte{
0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x4c, 0x4f, 0x47, 0x5f, 0x56, 0x49, 0x45, 0x57, 0x5f, 0x42,
0x41, 0x53, 0x49, 0x43, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45,
0x4c, 0x4f, 0x47, 0x5f, 0x56, 0x49, 0x45, 0x57, 0x5f, 0x46, 0x55, 0x4c, 0x4c, 0x10, 0x02, 0x32,
- 0x84, 0x1c, 0x0a, 0x0f, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x53, 0x65, 0x72, 0x76,
+ 0xf3, 0x1a, 0x0a, 0x0f, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x53, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x12, 0x90, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62,
0x61, 0x73, 0x65, 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71,
@@ -7315,223 +7204,213 @@ var file_v1_database_service_proto_rawDesc = string([]byte{
0x61, 0x73, 0x65, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93,
0x02, 0x24, 0x12, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e,
0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
- 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xb5, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x49,
- 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73,
- 0x12, 0x29, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c,
- 0x69, 0x73, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62,
- 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e,
- 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52,
- 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x45, 0xda, 0x41, 0x00, 0x8a, 0xea, 0x30, 0x10,
- 0x62, 0x62, 0x2e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2e, 0x67, 0x65, 0x74,
- 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x76, 0x31, 0x2f,
- 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65,
- 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x12, 0xc4,
- 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73,
- 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c,
- 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75,
- 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52,
- 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6c, 0xda, 0x41, 0x00, 0x8a, 0xea, 0x30, 0x11,
- 0x62, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x6c, 0x69, 0x73,
- 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4a, 0x5a, 0x25, 0x12, 0x23, 0x2f,
- 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x77, 0x6f, 0x72, 0x6b, 0x73,
- 0x70, 0x61, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
- 0x65, 0x73, 0x12, 0x21, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d,
- 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61,
- 0x62, 0x61, 0x73, 0x65, 0x73, 0x12, 0xc0, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
- 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74,
- 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62,
- 0x61, 0x73, 0x65, 0x22, 0x73, 0xda, 0x41, 0x14, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,
- 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x8a, 0xea, 0x30, 0x13,
- 0x62, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x75, 0x70, 0x64,
- 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x98, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02,
- 0x37, 0x3a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x32, 0x2b, 0x2f, 0x76, 0x31,
- 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61,
- 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xc5, 0x01, 0x0a, 0x14, 0x42, 0x61, 0x74,
- 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,
- 0x73, 0x12, 0x28, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62,
- 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55,
- 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65,
- 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0x8a, 0xea, 0x30, 0x13, 0x62, 0x62, 0x2e, 0x64,
- 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x90,
- 0xea, 0x30, 0x01, 0x98, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x01, 0x2a,
- 0x22, 0x2e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x6e,
- 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62,
- 0x61, 0x73, 0x65, 0x73, 0x3a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
- 0x12, 0xa0, 0x01, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
- 0x65, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x53, 0x79, 0x6e, 0x63, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75,
- 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65,
- 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4b, 0x8a, 0xea, 0x30, 0x11, 0x62, 0x62, 0x2e, 0x64,
- 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x90, 0xea, 0x30,
- 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x3a, 0x01, 0x2a, 0x22, 0x27, 0x2f, 0x76, 0x31, 0x2f,
- 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f,
- 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x73,
- 0x79, 0x6e, 0x63, 0x12, 0xb0, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62,
- 0x61, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x27, 0x2e, 0x62, 0x79,
+ 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xeb, 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x44,
+ 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62,
+ 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61,
+ 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
+ 0x92, 0x01, 0xda, 0x41, 0x00, 0x8a, 0xea, 0x30, 0x11, 0x62, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61,
+ 0x62, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x90, 0xea, 0x30, 0x02, 0x82, 0xd3,
+ 0xe4, 0x93, 0x02, 0x70, 0x5a, 0x24, 0x12, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72,
+ 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d,
+ 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x5a, 0x25, 0x12, 0x23, 0x2f, 0x76,
+ 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70,
+ 0x61, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,
+ 0x73, 0x12, 0x21, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70,
+ 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62,
+ 0x61, 0x73, 0x65, 0x73, 0x12, 0xc0, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44,
+ 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61,
+ 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61,
+ 0x73, 0x65, 0x22, 0x73, 0xda, 0x41, 0x14, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2c,
+ 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x8a, 0xea, 0x30, 0x13, 0x62,
+ 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61,
+ 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x98, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x37,
+ 0x3a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x32, 0x2b, 0x2f, 0x76, 0x31, 0x2f,
+ 0x7b, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69,
+ 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62,
+ 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xc5, 0x01, 0x0a, 0x14, 0x42, 0x61, 0x74, 0x63,
+ 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73,
+ 0x12, 0x28, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42,
+ 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61,
+ 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70,
+ 0x64, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0x8a, 0xea, 0x30, 0x13, 0x62, 0x62, 0x2e, 0x64, 0x61,
+ 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x90, 0xea,
+ 0x30, 0x01, 0x98, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x01, 0x2a, 0x22,
+ 0x2e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x6e, 0x73,
+ 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
+ 0x73, 0x65, 0x73, 0x3a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12,
+ 0xa0, 0x01, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,
+ 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53,
+ 0x79, 0x6e, 0x63, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
+ 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4b, 0x8a, 0xea, 0x30, 0x11, 0x62, 0x62, 0x2e, 0x64, 0x61,
+ 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x73, 0x79, 0x6e, 0x63, 0x90, 0xea, 0x30, 0x01,
+ 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x3a, 0x01, 0x2a, 0x22, 0x27, 0x2f, 0x76, 0x31, 0x2f, 0x7b,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a,
+ 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x73, 0x79,
+ 0x6e, 0x63, 0x12, 0xb0, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61,
+ 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x27, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61,
+ 0x62, 0x61, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
+ 0x74, 0x61, 0x22, 0x51, 0x8a, 0xea, 0x30, 0x16, 0x62, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62,
+ 0x61, 0x73, 0x65, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x90, 0xea,
+ 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f,
+ 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x6d, 0x65, 0x74, 0x61,
+ 0x64, 0x61, 0x74, 0x61, 0x7d, 0x12, 0xa8, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x44, 0x61, 0x74,
+ 0x61, 0x62, 0x61, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x25, 0x2e, 0x62, 0x79,
0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x61, 0x74,
- 0x61, 0x62, 0x61, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71,
- 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64,
- 0x61, 0x74, 0x61, 0x22, 0x51, 0x8a, 0xea, 0x30, 0x16, 0x62, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61,
- 0x62, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x90,
- 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x12, 0x2b, 0x2f, 0x76, 0x31, 0x2f, 0x7b,
+ 0x61, 0x62, 0x61, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
+ 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22,
+ 0x4f, 0x8a, 0xea, 0x30, 0x16, 0x62, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,
+ 0x73, 0x2e, 0x67, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x90, 0xea, 0x30, 0x01, 0x82,
+ 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74,
+ 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x7d,
+ 0x12, 0xe1, 0x01, 0x0a, 0x0a, 0x44, 0x69, 0x66, 0x66, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12,
+ 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69,
+ 0x66, 0x66, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
+ 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x69,
+ 0x66, 0x66, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+ 0x22, 0x91, 0x01, 0x8a, 0xea, 0x30, 0x10, 0x62, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
+ 0x73, 0x65, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02,
+ 0x73, 0x3a, 0x01, 0x2a, 0x5a, 0x3f, 0x3a, 0x01, 0x2a, 0x22, 0x3a, 0x2f, 0x76, 0x31, 0x2f, 0x7b,
0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a,
- 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x6d, 0x65, 0x74,
- 0x61, 0x64, 0x61, 0x74, 0x61, 0x7d, 0x12, 0xa8, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x44, 0x61,
- 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x25, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x61,
- 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, 0x75,
- 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61,
- 0x22, 0x4f, 0x8a, 0xea, 0x30, 0x16, 0x62, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
- 0x65, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x90, 0xea, 0x30, 0x01,
- 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x12, 0x29, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d,
- 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61,
- 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61,
- 0x7d, 0x12, 0xe1, 0x01, 0x0a, 0x0a, 0x44, 0x69, 0x66, 0x66, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61,
- 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44,
- 0x69, 0x66, 0x66, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
- 0x1a, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44,
- 0x69, 0x66, 0x66, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
- 0x65, 0x22, 0x91, 0x01, 0x8a, 0xea, 0x30, 0x10, 0x62, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62,
- 0x61, 0x73, 0x65, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93,
- 0x02, 0x73, 0x3a, 0x01, 0x2a, 0x5a, 0x3f, 0x3a, 0x01, 0x2a, 0x22, 0x3a, 0x2f, 0x76, 0x31, 0x2f,
- 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f,
- 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x68,
- 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x64, 0x69, 0x66, 0x66,
- 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x2d, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d,
- 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61,
- 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x64, 0x69, 0x66, 0x66, 0x53,
- 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0xad, 0x01, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6c,
- 0x6f, 0x77, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6c, 0x6f, 0x77,
- 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73,
- 0x74, 0x53, 0x6c, 0x6f, 0x77, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70,
- 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4f, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x8a,
- 0xea, 0x30, 0x13, 0x62, 0x62, 0x2e, 0x73, 0x6c, 0x6f, 0x77, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65,
- 0x73, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25,
- 0x12, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72,
- 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x6c, 0x6f, 0x77, 0x51, 0x75,
- 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0xae, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65,
- 0x63, 0x72, 0x65, 0x74, 0x73, 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x68, 0x61,
+ 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x64, 0x69, 0x66, 0x66, 0x53,
+ 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x2d, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74,
+ 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x64, 0x69, 0x66, 0x66, 0x53, 0x63,
+ 0x68, 0x65, 0x6d, 0x61, 0x12, 0xad, 0x01, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6c, 0x6f,
+ 0x77, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6c, 0x6f, 0x77, 0x51,
+ 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74,
+ 0x53, 0x6c, 0x6f, 0x77, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
+ 0x6e, 0x73, 0x65, 0x22, 0x4f, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x8a, 0xea,
+ 0x30, 0x13, 0x62, 0x62, 0x2e, 0x73, 0x6c, 0x6f, 0x77, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12,
+ 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f,
+ 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x6c, 0x6f, 0x77, 0x51, 0x75, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x12, 0xae, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63,
+ 0x72, 0x65, 0x74, 0x73, 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73,
- 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5c, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72,
- 0x65, 0x6e, 0x74, 0x8a, 0xea, 0x30, 0x17, 0x62, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
- 0x73, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x90, 0xea,
- 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70,
- 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f,
- 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73,
- 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x12, 0xaf, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74,
- 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72,
- 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0x68,
- 0x8a, 0xea, 0x30, 0x19, 0x62, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x53,
- 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30,
- 0x01, 0x98, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3d, 0x3a, 0x06, 0x73, 0x65, 0x63,
- 0x72, 0x65, 0x74, 0x32, 0x33, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74,
- 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f,
- 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x65,
- 0x63, 0x72, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xa3, 0x01, 0x0a, 0x0c, 0x44, 0x65, 0x6c,
- 0x65, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65,
- 0x63, 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d,
- 0x70, 0x74, 0x79, 0x22, 0x59, 0x8a, 0xea, 0x30, 0x19, 0x62, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61,
- 0x62, 0x61, 0x73, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x6c, 0x65,
- 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x98, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e,
- 0x2a, 0x2c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74,
- 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,
- 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xb3,
- 0x01, 0x0a, 0x0b, 0x41, 0x64, 0x76, 0x69, 0x73, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1f,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x76,
- 0x69, 0x73, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
- 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64,
- 0x76, 0x69, 0x73, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
- 0x65, 0x22, 0x61, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x8a, 0xea, 0x30, 0x18,
- 0x62, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x61, 0x64, 0x76,
- 0x69, 0x73, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93,
- 0x02, 0x32, 0x22, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d,
- 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61,
- 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x61, 0x64, 0x76, 0x69, 0x73, 0x65, 0x49,
- 0x6e, 0x64, 0x65, 0x78, 0x12, 0xb0, 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x76,
- 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f,
- 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x76, 0x69,
- 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0xda,
- 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x8a, 0xea, 0x30, 0x11, 0x62, 0x62, 0x2e, 0x72,
- 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x90, 0xea, 0x30,
- 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61,
+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5c, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65,
+ 0x6e, 0x74, 0x8a, 0xea, 0x30, 0x17, 0x62, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
+ 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x90, 0xea, 0x30,
+ 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61,
0x72, 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a,
- 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65,
- 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x9c, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52,
- 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f,
- 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22,
- 0x55, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xea, 0x30, 0x10, 0x62, 0x62, 0x2e, 0x72,
- 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x90, 0xea, 0x30, 0x01,
- 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d,
- 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61,
- 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69,
- 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xa8, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74,
- 0x65, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65,
- 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x69,
- 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5b, 0x8a, 0xea, 0x30, 0x13, 0x62, 0x62, 0x2e, 0x72, 0x65, 0x76,
- 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30,
- 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x3a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f,
- 0x6e, 0x22, 0x2e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x69,
- 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62,
- 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e,
- 0x73, 0x12, 0xa6, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69,
- 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f,
- 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
- 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
- 0x22, 0x58, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xea, 0x30, 0x13, 0x62, 0x62, 0x2e,
- 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65,
- 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x2a, 0x2e, 0x2f, 0x76, 0x31, 0x2f,
- 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f,
- 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65,
- 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xb5, 0x01, 0x0a, 0x0e, 0x4c,
- 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x22, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74,
- 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
- 0x74, 0x1a, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x4c, 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x73, 0x52, 0x65,
- 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5a, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e,
- 0x74, 0x8a, 0xea, 0x30, 0x12, 0x62, 0x62, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f,
- 0x67, 0x73, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02,
- 0x31, 0x12, 0x2f, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x69,
+ 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x65,
+ 0x63, 0x72, 0x65, 0x74, 0x73, 0x12, 0xaf, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
+ 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65,
+ 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0x68, 0x8a,
+ 0xea, 0x30, 0x19, 0x62, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x53, 0x65,
+ 0x63, 0x72, 0x65, 0x74, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01,
+ 0x98, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3d, 0x3a, 0x06, 0x73, 0x65, 0x63, 0x72,
+ 0x65, 0x74, 0x32, 0x33, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x2e,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a,
+ 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x65, 0x63,
+ 0x72, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xa3, 0x01, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65,
+ 0x74, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x63,
+ 0x72, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70,
+ 0x74, 0x79, 0x22, 0x59, 0x8a, 0xea, 0x30, 0x19, 0x62, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62,
+ 0x61, 0x73, 0x65, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x2e, 0x64, 0x65, 0x6c, 0x65, 0x74,
+ 0x65, 0x90, 0xea, 0x30, 0x01, 0x98, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x2a,
+ 0x2c, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61,
+ 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73,
+ 0x2f, 0x2a, 0x2f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xb3, 0x01,
+ 0x0a, 0x0b, 0x41, 0x64, 0x76, 0x69, 0x73, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1f, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x76, 0x69,
+ 0x73, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x76,
+ 0x69, 0x73, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+ 0x22, 0x61, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x8a, 0xea, 0x30, 0x18, 0x62,
+ 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x61, 0x64, 0x76, 0x69,
+ 0x73, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02,
+ 0x32, 0x22, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x69,
0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62,
- 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f,
- 0x67, 0x73, 0x12, 0xa1, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65,
- 0x6c, 0x6f, 0x67, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x22, 0x57, 0xda,
- 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xea, 0x30, 0x11, 0x62, 0x62, 0x2e, 0x63, 0x68, 0x61,
- 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82,
- 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65,
+ 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x61, 0x64, 0x76, 0x69, 0x73, 0x65, 0x49, 0x6e,
+ 0x64, 0x65, 0x78, 0x12, 0xb0, 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x76, 0x69,
+ 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e,
+ 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x76, 0x69, 0x73,
+ 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0xda, 0x41,
+ 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x8a, 0xea, 0x30, 0x11, 0x62, 0x62, 0x2e, 0x72, 0x65,
+ 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x90, 0xea, 0x30, 0x01,
+ 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72,
+ 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f,
+ 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x76,
+ 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x9c, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65,
+ 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x55,
+ 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xea, 0x30, 0x10, 0x62, 0x62, 0x2e, 0x72, 0x65,
+ 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82,
+ 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x12, 0x2e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65,
0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74,
- 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c,
- 0x6f, 0x67, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
- 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x33,
+ 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f,
+ 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xa8, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
+ 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x76,
+ 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x62,
+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x76, 0x69, 0x73,
+ 0x69, 0x6f, 0x6e, 0x22, 0x5b, 0x8a, 0xea, 0x30, 0x13, 0x62, 0x62, 0x2e, 0x72, 0x65, 0x76, 0x69,
+ 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01,
+ 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x3a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e,
+ 0x22, 0x2e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x6e,
+ 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
+ 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73,
+ 0x12, 0xa6, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x73,
+ 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22,
+ 0x58, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xea, 0x30, 0x13, 0x62, 0x62, 0x2e, 0x72,
+ 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x90,
+ 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x30, 0x2a, 0x2e, 0x2f, 0x76, 0x31, 0x2f, 0x7b,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a,
+ 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x76,
+ 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xb5, 0x01, 0x0a, 0x0e, 0x4c, 0x69,
+ 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x22, 0x2e, 0x62,
+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43,
+ 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x1a, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c,
+ 0x69, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5a, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
+ 0x8a, 0xea, 0x30, 0x12, 0x62, 0x62, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67,
+ 0x73, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31,
+ 0x12, 0x2f, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x6e,
+ 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
+ 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67,
+ 0x73, 0x12, 0xa1, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c,
+ 0x6f, 0x67, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
+ 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x22, 0x57, 0xda, 0x41,
+ 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xea, 0x30, 0x11, 0x62, 0x62, 0x2e, 0x63, 0x68, 0x61, 0x6e,
+ 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3,
+ 0xe4, 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
+ 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61,
+ 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f,
+ 0x67, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
})
var (
@@ -7547,7 +7426,7 @@ func file_v1_database_service_proto_rawDescGZIP() []byte {
}
var file_v1_database_service_proto_enumTypes = make([]protoimpl.EnumInfo, 10)
-var file_v1_database_service_proto_msgTypes = make([]protoimpl.MessageInfo, 70)
+var file_v1_database_service_proto_msgTypes = make([]protoimpl.MessageInfo, 68)
var file_v1_database_service_proto_goTypes = []any{
(DatabaseMetadataView)(0), // 0: bytebase.v1.DatabaseMetadataView
(ChangelogView)(0), // 1: bytebase.v1.ChangelogView
@@ -7560,212 +7439,207 @@ var file_v1_database_service_proto_goTypes = []any{
(Changelog_Status)(0), // 8: bytebase.v1.Changelog.Status
(Changelog_Type)(0), // 9: bytebase.v1.Changelog.Type
(*GetDatabaseRequest)(nil), // 10: bytebase.v1.GetDatabaseRequest
- (*ListInstanceDatabasesRequest)(nil), // 11: bytebase.v1.ListInstanceDatabasesRequest
- (*ListInstanceDatabasesResponse)(nil), // 12: bytebase.v1.ListInstanceDatabasesResponse
- (*ListDatabasesRequest)(nil), // 13: bytebase.v1.ListDatabasesRequest
- (*ListDatabasesResponse)(nil), // 14: bytebase.v1.ListDatabasesResponse
- (*UpdateDatabaseRequest)(nil), // 15: bytebase.v1.UpdateDatabaseRequest
- (*BatchUpdateDatabasesRequest)(nil), // 16: bytebase.v1.BatchUpdateDatabasesRequest
- (*BatchUpdateDatabasesResponse)(nil), // 17: bytebase.v1.BatchUpdateDatabasesResponse
- (*SyncDatabaseRequest)(nil), // 18: bytebase.v1.SyncDatabaseRequest
- (*SyncDatabaseResponse)(nil), // 19: bytebase.v1.SyncDatabaseResponse
- (*GetDatabaseMetadataRequest)(nil), // 20: bytebase.v1.GetDatabaseMetadataRequest
- (*GetDatabaseSchemaRequest)(nil), // 21: bytebase.v1.GetDatabaseSchemaRequest
- (*DiffSchemaRequest)(nil), // 22: bytebase.v1.DiffSchemaRequest
- (*DiffSchemaResponse)(nil), // 23: bytebase.v1.DiffSchemaResponse
- (*Database)(nil), // 24: bytebase.v1.Database
- (*DatabaseMetadata)(nil), // 25: bytebase.v1.DatabaseMetadata
- (*SchemaMetadata)(nil), // 26: bytebase.v1.SchemaMetadata
- (*EnumTypeMetadata)(nil), // 27: bytebase.v1.EnumTypeMetadata
- (*EventMetadata)(nil), // 28: bytebase.v1.EventMetadata
- (*SequenceMetadata)(nil), // 29: bytebase.v1.SequenceMetadata
- (*TriggerMetadata)(nil), // 30: bytebase.v1.TriggerMetadata
- (*ExternalTableMetadata)(nil), // 31: bytebase.v1.ExternalTableMetadata
- (*TableMetadata)(nil), // 32: bytebase.v1.TableMetadata
- (*CheckConstraintMetadata)(nil), // 33: bytebase.v1.CheckConstraintMetadata
- (*TablePartitionMetadata)(nil), // 34: bytebase.v1.TablePartitionMetadata
- (*ColumnMetadata)(nil), // 35: bytebase.v1.ColumnMetadata
- (*GenerationMetadata)(nil), // 36: bytebase.v1.GenerationMetadata
- (*ViewMetadata)(nil), // 37: bytebase.v1.ViewMetadata
- (*DependencyColumn)(nil), // 38: bytebase.v1.DependencyColumn
- (*MaterializedViewMetadata)(nil), // 39: bytebase.v1.MaterializedViewMetadata
- (*DependencyTable)(nil), // 40: bytebase.v1.DependencyTable
- (*FunctionMetadata)(nil), // 41: bytebase.v1.FunctionMetadata
- (*ProcedureMetadata)(nil), // 42: bytebase.v1.ProcedureMetadata
- (*PackageMetadata)(nil), // 43: bytebase.v1.PackageMetadata
- (*TaskMetadata)(nil), // 44: bytebase.v1.TaskMetadata
- (*StreamMetadata)(nil), // 45: bytebase.v1.StreamMetadata
- (*IndexMetadata)(nil), // 46: bytebase.v1.IndexMetadata
- (*ExtensionMetadata)(nil), // 47: bytebase.v1.ExtensionMetadata
- (*ForeignKeyMetadata)(nil), // 48: bytebase.v1.ForeignKeyMetadata
- (*DatabaseSchema)(nil), // 49: bytebase.v1.DatabaseSchema
- (*ListSlowQueriesRequest)(nil), // 50: bytebase.v1.ListSlowQueriesRequest
- (*ListSlowQueriesResponse)(nil), // 51: bytebase.v1.ListSlowQueriesResponse
- (*SlowQueryLog)(nil), // 52: bytebase.v1.SlowQueryLog
- (*SlowQueryStatistics)(nil), // 53: bytebase.v1.SlowQueryStatistics
- (*SlowQueryDetails)(nil), // 54: bytebase.v1.SlowQueryDetails
- (*ListSecretsRequest)(nil), // 55: bytebase.v1.ListSecretsRequest
- (*ListSecretsResponse)(nil), // 56: bytebase.v1.ListSecretsResponse
- (*UpdateSecretRequest)(nil), // 57: bytebase.v1.UpdateSecretRequest
- (*DeleteSecretRequest)(nil), // 58: bytebase.v1.DeleteSecretRequest
- (*Secret)(nil), // 59: bytebase.v1.Secret
- (*AdviseIndexRequest)(nil), // 60: bytebase.v1.AdviseIndexRequest
- (*AdviseIndexResponse)(nil), // 61: bytebase.v1.AdviseIndexResponse
- (*ChangedResources)(nil), // 62: bytebase.v1.ChangedResources
- (*ChangedResourceDatabase)(nil), // 63: bytebase.v1.ChangedResourceDatabase
- (*ChangedResourceSchema)(nil), // 64: bytebase.v1.ChangedResourceSchema
- (*ChangedResourceTable)(nil), // 65: bytebase.v1.ChangedResourceTable
- (*ChangedResourceView)(nil), // 66: bytebase.v1.ChangedResourceView
- (*ChangedResourceFunction)(nil), // 67: bytebase.v1.ChangedResourceFunction
- (*ChangedResourceProcedure)(nil), // 68: bytebase.v1.ChangedResourceProcedure
- (*ListRevisionsRequest)(nil), // 69: bytebase.v1.ListRevisionsRequest
- (*ListRevisionsResponse)(nil), // 70: bytebase.v1.ListRevisionsResponse
- (*CreateRevisionRequest)(nil), // 71: bytebase.v1.CreateRevisionRequest
- (*GetRevisionRequest)(nil), // 72: bytebase.v1.GetRevisionRequest
- (*DeleteRevisionRequest)(nil), // 73: bytebase.v1.DeleteRevisionRequest
- (*Revision)(nil), // 74: bytebase.v1.Revision
- (*ListChangelogsRequest)(nil), // 75: bytebase.v1.ListChangelogsRequest
- (*ListChangelogsResponse)(nil), // 76: bytebase.v1.ListChangelogsResponse
- (*GetChangelogRequest)(nil), // 77: bytebase.v1.GetChangelogRequest
- (*Changelog)(nil), // 78: bytebase.v1.Changelog
- nil, // 79: bytebase.v1.Database.LabelsEntry
- (*fieldmaskpb.FieldMask)(nil), // 80: google.protobuf.FieldMask
- (State)(0), // 81: bytebase.v1.State
- (*timestamppb.Timestamp)(nil), // 82: google.protobuf.Timestamp
- (*InstanceResource)(nil), // 83: bytebase.v1.InstanceResource
- (*durationpb.Duration)(nil), // 84: google.protobuf.Duration
- (*Range)(nil), // 85: bytebase.v1.Range
- (*emptypb.Empty)(nil), // 86: google.protobuf.Empty
+ (*ListDatabasesRequest)(nil), // 11: bytebase.v1.ListDatabasesRequest
+ (*ListDatabasesResponse)(nil), // 12: bytebase.v1.ListDatabasesResponse
+ (*UpdateDatabaseRequest)(nil), // 13: bytebase.v1.UpdateDatabaseRequest
+ (*BatchUpdateDatabasesRequest)(nil), // 14: bytebase.v1.BatchUpdateDatabasesRequest
+ (*BatchUpdateDatabasesResponse)(nil), // 15: bytebase.v1.BatchUpdateDatabasesResponse
+ (*SyncDatabaseRequest)(nil), // 16: bytebase.v1.SyncDatabaseRequest
+ (*SyncDatabaseResponse)(nil), // 17: bytebase.v1.SyncDatabaseResponse
+ (*GetDatabaseMetadataRequest)(nil), // 18: bytebase.v1.GetDatabaseMetadataRequest
+ (*GetDatabaseSchemaRequest)(nil), // 19: bytebase.v1.GetDatabaseSchemaRequest
+ (*DiffSchemaRequest)(nil), // 20: bytebase.v1.DiffSchemaRequest
+ (*DiffSchemaResponse)(nil), // 21: bytebase.v1.DiffSchemaResponse
+ (*Database)(nil), // 22: bytebase.v1.Database
+ (*DatabaseMetadata)(nil), // 23: bytebase.v1.DatabaseMetadata
+ (*SchemaMetadata)(nil), // 24: bytebase.v1.SchemaMetadata
+ (*EnumTypeMetadata)(nil), // 25: bytebase.v1.EnumTypeMetadata
+ (*EventMetadata)(nil), // 26: bytebase.v1.EventMetadata
+ (*SequenceMetadata)(nil), // 27: bytebase.v1.SequenceMetadata
+ (*TriggerMetadata)(nil), // 28: bytebase.v1.TriggerMetadata
+ (*ExternalTableMetadata)(nil), // 29: bytebase.v1.ExternalTableMetadata
+ (*TableMetadata)(nil), // 30: bytebase.v1.TableMetadata
+ (*CheckConstraintMetadata)(nil), // 31: bytebase.v1.CheckConstraintMetadata
+ (*TablePartitionMetadata)(nil), // 32: bytebase.v1.TablePartitionMetadata
+ (*ColumnMetadata)(nil), // 33: bytebase.v1.ColumnMetadata
+ (*GenerationMetadata)(nil), // 34: bytebase.v1.GenerationMetadata
+ (*ViewMetadata)(nil), // 35: bytebase.v1.ViewMetadata
+ (*DependencyColumn)(nil), // 36: bytebase.v1.DependencyColumn
+ (*MaterializedViewMetadata)(nil), // 37: bytebase.v1.MaterializedViewMetadata
+ (*DependencyTable)(nil), // 38: bytebase.v1.DependencyTable
+ (*FunctionMetadata)(nil), // 39: bytebase.v1.FunctionMetadata
+ (*ProcedureMetadata)(nil), // 40: bytebase.v1.ProcedureMetadata
+ (*PackageMetadata)(nil), // 41: bytebase.v1.PackageMetadata
+ (*TaskMetadata)(nil), // 42: bytebase.v1.TaskMetadata
+ (*StreamMetadata)(nil), // 43: bytebase.v1.StreamMetadata
+ (*IndexMetadata)(nil), // 44: bytebase.v1.IndexMetadata
+ (*ExtensionMetadata)(nil), // 45: bytebase.v1.ExtensionMetadata
+ (*ForeignKeyMetadata)(nil), // 46: bytebase.v1.ForeignKeyMetadata
+ (*DatabaseSchema)(nil), // 47: bytebase.v1.DatabaseSchema
+ (*ListSlowQueriesRequest)(nil), // 48: bytebase.v1.ListSlowQueriesRequest
+ (*ListSlowQueriesResponse)(nil), // 49: bytebase.v1.ListSlowQueriesResponse
+ (*SlowQueryLog)(nil), // 50: bytebase.v1.SlowQueryLog
+ (*SlowQueryStatistics)(nil), // 51: bytebase.v1.SlowQueryStatistics
+ (*SlowQueryDetails)(nil), // 52: bytebase.v1.SlowQueryDetails
+ (*ListSecretsRequest)(nil), // 53: bytebase.v1.ListSecretsRequest
+ (*ListSecretsResponse)(nil), // 54: bytebase.v1.ListSecretsResponse
+ (*UpdateSecretRequest)(nil), // 55: bytebase.v1.UpdateSecretRequest
+ (*DeleteSecretRequest)(nil), // 56: bytebase.v1.DeleteSecretRequest
+ (*Secret)(nil), // 57: bytebase.v1.Secret
+ (*AdviseIndexRequest)(nil), // 58: bytebase.v1.AdviseIndexRequest
+ (*AdviseIndexResponse)(nil), // 59: bytebase.v1.AdviseIndexResponse
+ (*ChangedResources)(nil), // 60: bytebase.v1.ChangedResources
+ (*ChangedResourceDatabase)(nil), // 61: bytebase.v1.ChangedResourceDatabase
+ (*ChangedResourceSchema)(nil), // 62: bytebase.v1.ChangedResourceSchema
+ (*ChangedResourceTable)(nil), // 63: bytebase.v1.ChangedResourceTable
+ (*ChangedResourceView)(nil), // 64: bytebase.v1.ChangedResourceView
+ (*ChangedResourceFunction)(nil), // 65: bytebase.v1.ChangedResourceFunction
+ (*ChangedResourceProcedure)(nil), // 66: bytebase.v1.ChangedResourceProcedure
+ (*ListRevisionsRequest)(nil), // 67: bytebase.v1.ListRevisionsRequest
+ (*ListRevisionsResponse)(nil), // 68: bytebase.v1.ListRevisionsResponse
+ (*CreateRevisionRequest)(nil), // 69: bytebase.v1.CreateRevisionRequest
+ (*GetRevisionRequest)(nil), // 70: bytebase.v1.GetRevisionRequest
+ (*DeleteRevisionRequest)(nil), // 71: bytebase.v1.DeleteRevisionRequest
+ (*Revision)(nil), // 72: bytebase.v1.Revision
+ (*ListChangelogsRequest)(nil), // 73: bytebase.v1.ListChangelogsRequest
+ (*ListChangelogsResponse)(nil), // 74: bytebase.v1.ListChangelogsResponse
+ (*GetChangelogRequest)(nil), // 75: bytebase.v1.GetChangelogRequest
+ (*Changelog)(nil), // 76: bytebase.v1.Changelog
+ nil, // 77: bytebase.v1.Database.LabelsEntry
+ (*fieldmaskpb.FieldMask)(nil), // 78: google.protobuf.FieldMask
+ (State)(0), // 79: bytebase.v1.State
+ (*timestamppb.Timestamp)(nil), // 80: google.protobuf.Timestamp
+ (*InstanceResource)(nil), // 81: bytebase.v1.InstanceResource
+ (*durationpb.Duration)(nil), // 82: google.protobuf.Duration
+ (*Range)(nil), // 83: bytebase.v1.Range
+ (*emptypb.Empty)(nil), // 84: google.protobuf.Empty
}
var file_v1_database_service_proto_depIdxs = []int32{
- 24, // 0: bytebase.v1.ListInstanceDatabasesResponse.databases:type_name -> bytebase.v1.Database
- 24, // 1: bytebase.v1.ListDatabasesResponse.databases:type_name -> bytebase.v1.Database
- 24, // 2: bytebase.v1.UpdateDatabaseRequest.database:type_name -> bytebase.v1.Database
- 80, // 3: bytebase.v1.UpdateDatabaseRequest.update_mask:type_name -> google.protobuf.FieldMask
- 15, // 4: bytebase.v1.BatchUpdateDatabasesRequest.requests:type_name -> bytebase.v1.UpdateDatabaseRequest
- 24, // 5: bytebase.v1.BatchUpdateDatabasesResponse.databases:type_name -> bytebase.v1.Database
- 0, // 6: bytebase.v1.GetDatabaseMetadataRequest.view:type_name -> bytebase.v1.DatabaseMetadataView
- 81, // 7: bytebase.v1.Database.state:type_name -> bytebase.v1.State
- 82, // 8: bytebase.v1.Database.successful_sync_time:type_name -> google.protobuf.Timestamp
- 79, // 9: bytebase.v1.Database.labels:type_name -> bytebase.v1.Database.LabelsEntry
- 83, // 10: bytebase.v1.Database.instance_resource:type_name -> bytebase.v1.InstanceResource
- 26, // 11: bytebase.v1.DatabaseMetadata.schemas:type_name -> bytebase.v1.SchemaMetadata
- 47, // 12: bytebase.v1.DatabaseMetadata.extensions:type_name -> bytebase.v1.ExtensionMetadata
- 32, // 13: bytebase.v1.SchemaMetadata.tables:type_name -> bytebase.v1.TableMetadata
- 31, // 14: bytebase.v1.SchemaMetadata.external_tables:type_name -> bytebase.v1.ExternalTableMetadata
- 37, // 15: bytebase.v1.SchemaMetadata.views:type_name -> bytebase.v1.ViewMetadata
- 41, // 16: bytebase.v1.SchemaMetadata.functions:type_name -> bytebase.v1.FunctionMetadata
- 42, // 17: bytebase.v1.SchemaMetadata.procedures:type_name -> bytebase.v1.ProcedureMetadata
- 45, // 18: bytebase.v1.SchemaMetadata.streams:type_name -> bytebase.v1.StreamMetadata
- 44, // 19: bytebase.v1.SchemaMetadata.tasks:type_name -> bytebase.v1.TaskMetadata
- 39, // 20: bytebase.v1.SchemaMetadata.materialized_views:type_name -> bytebase.v1.MaterializedViewMetadata
- 43, // 21: bytebase.v1.SchemaMetadata.packages:type_name -> bytebase.v1.PackageMetadata
- 29, // 22: bytebase.v1.SchemaMetadata.sequences:type_name -> bytebase.v1.SequenceMetadata
- 28, // 23: bytebase.v1.SchemaMetadata.events:type_name -> bytebase.v1.EventMetadata
- 27, // 24: bytebase.v1.SchemaMetadata.enum_types:type_name -> bytebase.v1.EnumTypeMetadata
- 35, // 25: bytebase.v1.ExternalTableMetadata.columns:type_name -> bytebase.v1.ColumnMetadata
- 35, // 26: bytebase.v1.TableMetadata.columns:type_name -> bytebase.v1.ColumnMetadata
- 46, // 27: bytebase.v1.TableMetadata.indexes:type_name -> bytebase.v1.IndexMetadata
- 48, // 28: bytebase.v1.TableMetadata.foreign_keys:type_name -> bytebase.v1.ForeignKeyMetadata
- 34, // 29: bytebase.v1.TableMetadata.partitions:type_name -> bytebase.v1.TablePartitionMetadata
- 33, // 30: bytebase.v1.TableMetadata.check_constraints:type_name -> bytebase.v1.CheckConstraintMetadata
- 30, // 31: bytebase.v1.TableMetadata.triggers:type_name -> bytebase.v1.TriggerMetadata
- 2, // 32: bytebase.v1.TablePartitionMetadata.type:type_name -> bytebase.v1.TablePartitionMetadata.Type
- 34, // 33: bytebase.v1.TablePartitionMetadata.subpartitions:type_name -> bytebase.v1.TablePartitionMetadata
- 46, // 34: bytebase.v1.TablePartitionMetadata.indexes:type_name -> bytebase.v1.IndexMetadata
- 36, // 35: bytebase.v1.ColumnMetadata.generation:type_name -> bytebase.v1.GenerationMetadata
- 3, // 36: bytebase.v1.ColumnMetadata.identity_generation:type_name -> bytebase.v1.ColumnMetadata.IdentityGeneration
- 4, // 37: bytebase.v1.GenerationMetadata.type:type_name -> bytebase.v1.GenerationMetadata.Type
- 38, // 38: bytebase.v1.ViewMetadata.dependency_columns:type_name -> bytebase.v1.DependencyColumn
- 35, // 39: bytebase.v1.ViewMetadata.columns:type_name -> bytebase.v1.ColumnMetadata
- 30, // 40: bytebase.v1.ViewMetadata.triggers:type_name -> bytebase.v1.TriggerMetadata
- 38, // 41: bytebase.v1.MaterializedViewMetadata.dependency_columns:type_name -> bytebase.v1.DependencyColumn
- 30, // 42: bytebase.v1.MaterializedViewMetadata.triggers:type_name -> bytebase.v1.TriggerMetadata
- 46, // 43: bytebase.v1.MaterializedViewMetadata.indexes:type_name -> bytebase.v1.IndexMetadata
- 40, // 44: bytebase.v1.FunctionMetadata.dependency_tables:type_name -> bytebase.v1.DependencyTable
- 5, // 45: bytebase.v1.TaskMetadata.state:type_name -> bytebase.v1.TaskMetadata.State
- 6, // 46: bytebase.v1.StreamMetadata.type:type_name -> bytebase.v1.StreamMetadata.Type
- 7, // 47: bytebase.v1.StreamMetadata.mode:type_name -> bytebase.v1.StreamMetadata.Mode
- 52, // 48: bytebase.v1.ListSlowQueriesResponse.slow_query_logs:type_name -> bytebase.v1.SlowQueryLog
- 53, // 49: bytebase.v1.SlowQueryLog.statistics:type_name -> bytebase.v1.SlowQueryStatistics
- 82, // 50: bytebase.v1.SlowQueryStatistics.latest_log_time:type_name -> google.protobuf.Timestamp
- 84, // 51: bytebase.v1.SlowQueryStatistics.average_query_time:type_name -> google.protobuf.Duration
- 84, // 52: bytebase.v1.SlowQueryStatistics.maximum_query_time:type_name -> google.protobuf.Duration
- 54, // 53: bytebase.v1.SlowQueryStatistics.samples:type_name -> bytebase.v1.SlowQueryDetails
- 82, // 54: bytebase.v1.SlowQueryDetails.start_time:type_name -> google.protobuf.Timestamp
- 84, // 55: bytebase.v1.SlowQueryDetails.query_time:type_name -> google.protobuf.Duration
- 84, // 56: bytebase.v1.SlowQueryDetails.lock_time:type_name -> google.protobuf.Duration
- 59, // 57: bytebase.v1.ListSecretsResponse.secrets:type_name -> bytebase.v1.Secret
- 59, // 58: bytebase.v1.UpdateSecretRequest.secret:type_name -> bytebase.v1.Secret
- 80, // 59: bytebase.v1.UpdateSecretRequest.update_mask:type_name -> google.protobuf.FieldMask
- 82, // 60: bytebase.v1.Secret.created_time:type_name -> google.protobuf.Timestamp
- 82, // 61: bytebase.v1.Secret.updated_time:type_name -> google.protobuf.Timestamp
- 63, // 62: bytebase.v1.ChangedResources.databases:type_name -> bytebase.v1.ChangedResourceDatabase
- 64, // 63: bytebase.v1.ChangedResourceDatabase.schemas:type_name -> bytebase.v1.ChangedResourceSchema
- 65, // 64: bytebase.v1.ChangedResourceSchema.tables:type_name -> bytebase.v1.ChangedResourceTable
- 66, // 65: bytebase.v1.ChangedResourceSchema.views:type_name -> bytebase.v1.ChangedResourceView
- 67, // 66: bytebase.v1.ChangedResourceSchema.functions:type_name -> bytebase.v1.ChangedResourceFunction
- 68, // 67: bytebase.v1.ChangedResourceSchema.procedures:type_name -> bytebase.v1.ChangedResourceProcedure
- 85, // 68: bytebase.v1.ChangedResourceTable.ranges:type_name -> bytebase.v1.Range
- 85, // 69: bytebase.v1.ChangedResourceView.ranges:type_name -> bytebase.v1.Range
- 85, // 70: bytebase.v1.ChangedResourceFunction.ranges:type_name -> bytebase.v1.Range
- 85, // 71: bytebase.v1.ChangedResourceProcedure.ranges:type_name -> bytebase.v1.Range
- 74, // 72: bytebase.v1.ListRevisionsResponse.revisions:type_name -> bytebase.v1.Revision
- 74, // 73: bytebase.v1.CreateRevisionRequest.revision:type_name -> bytebase.v1.Revision
- 82, // 74: bytebase.v1.Revision.create_time:type_name -> google.protobuf.Timestamp
- 82, // 75: bytebase.v1.Revision.delete_time:type_name -> google.protobuf.Timestamp
- 1, // 76: bytebase.v1.ListChangelogsRequest.view:type_name -> bytebase.v1.ChangelogView
- 78, // 77: bytebase.v1.ListChangelogsResponse.changelogs:type_name -> bytebase.v1.Changelog
- 1, // 78: bytebase.v1.GetChangelogRequest.view:type_name -> bytebase.v1.ChangelogView
- 82, // 79: bytebase.v1.Changelog.create_time:type_name -> google.protobuf.Timestamp
- 8, // 80: bytebase.v1.Changelog.status:type_name -> bytebase.v1.Changelog.Status
- 62, // 81: bytebase.v1.Changelog.changed_resources:type_name -> bytebase.v1.ChangedResources
- 9, // 82: bytebase.v1.Changelog.type:type_name -> bytebase.v1.Changelog.Type
- 10, // 83: bytebase.v1.DatabaseService.GetDatabase:input_type -> bytebase.v1.GetDatabaseRequest
- 11, // 84: bytebase.v1.DatabaseService.ListInstanceDatabases:input_type -> bytebase.v1.ListInstanceDatabasesRequest
- 13, // 85: bytebase.v1.DatabaseService.ListDatabases:input_type -> bytebase.v1.ListDatabasesRequest
- 15, // 86: bytebase.v1.DatabaseService.UpdateDatabase:input_type -> bytebase.v1.UpdateDatabaseRequest
- 16, // 87: bytebase.v1.DatabaseService.BatchUpdateDatabases:input_type -> bytebase.v1.BatchUpdateDatabasesRequest
- 18, // 88: bytebase.v1.DatabaseService.SyncDatabase:input_type -> bytebase.v1.SyncDatabaseRequest
- 20, // 89: bytebase.v1.DatabaseService.GetDatabaseMetadata:input_type -> bytebase.v1.GetDatabaseMetadataRequest
- 21, // 90: bytebase.v1.DatabaseService.GetDatabaseSchema:input_type -> bytebase.v1.GetDatabaseSchemaRequest
- 22, // 91: bytebase.v1.DatabaseService.DiffSchema:input_type -> bytebase.v1.DiffSchemaRequest
- 50, // 92: bytebase.v1.DatabaseService.ListSlowQueries:input_type -> bytebase.v1.ListSlowQueriesRequest
- 55, // 93: bytebase.v1.DatabaseService.ListSecrets:input_type -> bytebase.v1.ListSecretsRequest
- 57, // 94: bytebase.v1.DatabaseService.UpdateSecret:input_type -> bytebase.v1.UpdateSecretRequest
- 58, // 95: bytebase.v1.DatabaseService.DeleteSecret:input_type -> bytebase.v1.DeleteSecretRequest
- 60, // 96: bytebase.v1.DatabaseService.AdviseIndex:input_type -> bytebase.v1.AdviseIndexRequest
- 69, // 97: bytebase.v1.DatabaseService.ListRevisions:input_type -> bytebase.v1.ListRevisionsRequest
- 72, // 98: bytebase.v1.DatabaseService.GetRevision:input_type -> bytebase.v1.GetRevisionRequest
- 71, // 99: bytebase.v1.DatabaseService.CreateRevision:input_type -> bytebase.v1.CreateRevisionRequest
- 73, // 100: bytebase.v1.DatabaseService.DeleteRevision:input_type -> bytebase.v1.DeleteRevisionRequest
- 75, // 101: bytebase.v1.DatabaseService.ListChangelogs:input_type -> bytebase.v1.ListChangelogsRequest
- 77, // 102: bytebase.v1.DatabaseService.GetChangelog:input_type -> bytebase.v1.GetChangelogRequest
- 24, // 103: bytebase.v1.DatabaseService.GetDatabase:output_type -> bytebase.v1.Database
- 12, // 104: bytebase.v1.DatabaseService.ListInstanceDatabases:output_type -> bytebase.v1.ListInstanceDatabasesResponse
- 14, // 105: bytebase.v1.DatabaseService.ListDatabases:output_type -> bytebase.v1.ListDatabasesResponse
- 24, // 106: bytebase.v1.DatabaseService.UpdateDatabase:output_type -> bytebase.v1.Database
- 17, // 107: bytebase.v1.DatabaseService.BatchUpdateDatabases:output_type -> bytebase.v1.BatchUpdateDatabasesResponse
- 19, // 108: bytebase.v1.DatabaseService.SyncDatabase:output_type -> bytebase.v1.SyncDatabaseResponse
- 25, // 109: bytebase.v1.DatabaseService.GetDatabaseMetadata:output_type -> bytebase.v1.DatabaseMetadata
- 49, // 110: bytebase.v1.DatabaseService.GetDatabaseSchema:output_type -> bytebase.v1.DatabaseSchema
- 23, // 111: bytebase.v1.DatabaseService.DiffSchema:output_type -> bytebase.v1.DiffSchemaResponse
- 51, // 112: bytebase.v1.DatabaseService.ListSlowQueries:output_type -> bytebase.v1.ListSlowQueriesResponse
- 56, // 113: bytebase.v1.DatabaseService.ListSecrets:output_type -> bytebase.v1.ListSecretsResponse
- 59, // 114: bytebase.v1.DatabaseService.UpdateSecret:output_type -> bytebase.v1.Secret
- 86, // 115: bytebase.v1.DatabaseService.DeleteSecret:output_type -> google.protobuf.Empty
- 61, // 116: bytebase.v1.DatabaseService.AdviseIndex:output_type -> bytebase.v1.AdviseIndexResponse
- 70, // 117: bytebase.v1.DatabaseService.ListRevisions:output_type -> bytebase.v1.ListRevisionsResponse
- 74, // 118: bytebase.v1.DatabaseService.GetRevision:output_type -> bytebase.v1.Revision
- 74, // 119: bytebase.v1.DatabaseService.CreateRevision:output_type -> bytebase.v1.Revision
- 86, // 120: bytebase.v1.DatabaseService.DeleteRevision:output_type -> google.protobuf.Empty
- 76, // 121: bytebase.v1.DatabaseService.ListChangelogs:output_type -> bytebase.v1.ListChangelogsResponse
- 78, // 122: bytebase.v1.DatabaseService.GetChangelog:output_type -> bytebase.v1.Changelog
- 103, // [103:123] is the sub-list for method output_type
- 83, // [83:103] is the sub-list for method input_type
- 83, // [83:83] is the sub-list for extension type_name
- 83, // [83:83] is the sub-list for extension extendee
- 0, // [0:83] is the sub-list for field type_name
+ 22, // 0: bytebase.v1.ListDatabasesResponse.databases:type_name -> bytebase.v1.Database
+ 22, // 1: bytebase.v1.UpdateDatabaseRequest.database:type_name -> bytebase.v1.Database
+ 78, // 2: bytebase.v1.UpdateDatabaseRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 13, // 3: bytebase.v1.BatchUpdateDatabasesRequest.requests:type_name -> bytebase.v1.UpdateDatabaseRequest
+ 22, // 4: bytebase.v1.BatchUpdateDatabasesResponse.databases:type_name -> bytebase.v1.Database
+ 0, // 5: bytebase.v1.GetDatabaseMetadataRequest.view:type_name -> bytebase.v1.DatabaseMetadataView
+ 79, // 6: bytebase.v1.Database.state:type_name -> bytebase.v1.State
+ 80, // 7: bytebase.v1.Database.successful_sync_time:type_name -> google.protobuf.Timestamp
+ 77, // 8: bytebase.v1.Database.labels:type_name -> bytebase.v1.Database.LabelsEntry
+ 81, // 9: bytebase.v1.Database.instance_resource:type_name -> bytebase.v1.InstanceResource
+ 24, // 10: bytebase.v1.DatabaseMetadata.schemas:type_name -> bytebase.v1.SchemaMetadata
+ 45, // 11: bytebase.v1.DatabaseMetadata.extensions:type_name -> bytebase.v1.ExtensionMetadata
+ 30, // 12: bytebase.v1.SchemaMetadata.tables:type_name -> bytebase.v1.TableMetadata
+ 29, // 13: bytebase.v1.SchemaMetadata.external_tables:type_name -> bytebase.v1.ExternalTableMetadata
+ 35, // 14: bytebase.v1.SchemaMetadata.views:type_name -> bytebase.v1.ViewMetadata
+ 39, // 15: bytebase.v1.SchemaMetadata.functions:type_name -> bytebase.v1.FunctionMetadata
+ 40, // 16: bytebase.v1.SchemaMetadata.procedures:type_name -> bytebase.v1.ProcedureMetadata
+ 43, // 17: bytebase.v1.SchemaMetadata.streams:type_name -> bytebase.v1.StreamMetadata
+ 42, // 18: bytebase.v1.SchemaMetadata.tasks:type_name -> bytebase.v1.TaskMetadata
+ 37, // 19: bytebase.v1.SchemaMetadata.materialized_views:type_name -> bytebase.v1.MaterializedViewMetadata
+ 41, // 20: bytebase.v1.SchemaMetadata.packages:type_name -> bytebase.v1.PackageMetadata
+ 27, // 21: bytebase.v1.SchemaMetadata.sequences:type_name -> bytebase.v1.SequenceMetadata
+ 26, // 22: bytebase.v1.SchemaMetadata.events:type_name -> bytebase.v1.EventMetadata
+ 25, // 23: bytebase.v1.SchemaMetadata.enum_types:type_name -> bytebase.v1.EnumTypeMetadata
+ 33, // 24: bytebase.v1.ExternalTableMetadata.columns:type_name -> bytebase.v1.ColumnMetadata
+ 33, // 25: bytebase.v1.TableMetadata.columns:type_name -> bytebase.v1.ColumnMetadata
+ 44, // 26: bytebase.v1.TableMetadata.indexes:type_name -> bytebase.v1.IndexMetadata
+ 46, // 27: bytebase.v1.TableMetadata.foreign_keys:type_name -> bytebase.v1.ForeignKeyMetadata
+ 32, // 28: bytebase.v1.TableMetadata.partitions:type_name -> bytebase.v1.TablePartitionMetadata
+ 31, // 29: bytebase.v1.TableMetadata.check_constraints:type_name -> bytebase.v1.CheckConstraintMetadata
+ 28, // 30: bytebase.v1.TableMetadata.triggers:type_name -> bytebase.v1.TriggerMetadata
+ 2, // 31: bytebase.v1.TablePartitionMetadata.type:type_name -> bytebase.v1.TablePartitionMetadata.Type
+ 32, // 32: bytebase.v1.TablePartitionMetadata.subpartitions:type_name -> bytebase.v1.TablePartitionMetadata
+ 44, // 33: bytebase.v1.TablePartitionMetadata.indexes:type_name -> bytebase.v1.IndexMetadata
+ 34, // 34: bytebase.v1.ColumnMetadata.generation:type_name -> bytebase.v1.GenerationMetadata
+ 3, // 35: bytebase.v1.ColumnMetadata.identity_generation:type_name -> bytebase.v1.ColumnMetadata.IdentityGeneration
+ 4, // 36: bytebase.v1.GenerationMetadata.type:type_name -> bytebase.v1.GenerationMetadata.Type
+ 36, // 37: bytebase.v1.ViewMetadata.dependency_columns:type_name -> bytebase.v1.DependencyColumn
+ 33, // 38: bytebase.v1.ViewMetadata.columns:type_name -> bytebase.v1.ColumnMetadata
+ 28, // 39: bytebase.v1.ViewMetadata.triggers:type_name -> bytebase.v1.TriggerMetadata
+ 36, // 40: bytebase.v1.MaterializedViewMetadata.dependency_columns:type_name -> bytebase.v1.DependencyColumn
+ 28, // 41: bytebase.v1.MaterializedViewMetadata.triggers:type_name -> bytebase.v1.TriggerMetadata
+ 44, // 42: bytebase.v1.MaterializedViewMetadata.indexes:type_name -> bytebase.v1.IndexMetadata
+ 38, // 43: bytebase.v1.FunctionMetadata.dependency_tables:type_name -> bytebase.v1.DependencyTable
+ 5, // 44: bytebase.v1.TaskMetadata.state:type_name -> bytebase.v1.TaskMetadata.State
+ 6, // 45: bytebase.v1.StreamMetadata.type:type_name -> bytebase.v1.StreamMetadata.Type
+ 7, // 46: bytebase.v1.StreamMetadata.mode:type_name -> bytebase.v1.StreamMetadata.Mode
+ 50, // 47: bytebase.v1.ListSlowQueriesResponse.slow_query_logs:type_name -> bytebase.v1.SlowQueryLog
+ 51, // 48: bytebase.v1.SlowQueryLog.statistics:type_name -> bytebase.v1.SlowQueryStatistics
+ 80, // 49: bytebase.v1.SlowQueryStatistics.latest_log_time:type_name -> google.protobuf.Timestamp
+ 82, // 50: bytebase.v1.SlowQueryStatistics.average_query_time:type_name -> google.protobuf.Duration
+ 82, // 51: bytebase.v1.SlowQueryStatistics.maximum_query_time:type_name -> google.protobuf.Duration
+ 52, // 52: bytebase.v1.SlowQueryStatistics.samples:type_name -> bytebase.v1.SlowQueryDetails
+ 80, // 53: bytebase.v1.SlowQueryDetails.start_time:type_name -> google.protobuf.Timestamp
+ 82, // 54: bytebase.v1.SlowQueryDetails.query_time:type_name -> google.protobuf.Duration
+ 82, // 55: bytebase.v1.SlowQueryDetails.lock_time:type_name -> google.protobuf.Duration
+ 57, // 56: bytebase.v1.ListSecretsResponse.secrets:type_name -> bytebase.v1.Secret
+ 57, // 57: bytebase.v1.UpdateSecretRequest.secret:type_name -> bytebase.v1.Secret
+ 78, // 58: bytebase.v1.UpdateSecretRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 80, // 59: bytebase.v1.Secret.created_time:type_name -> google.protobuf.Timestamp
+ 80, // 60: bytebase.v1.Secret.updated_time:type_name -> google.protobuf.Timestamp
+ 61, // 61: bytebase.v1.ChangedResources.databases:type_name -> bytebase.v1.ChangedResourceDatabase
+ 62, // 62: bytebase.v1.ChangedResourceDatabase.schemas:type_name -> bytebase.v1.ChangedResourceSchema
+ 63, // 63: bytebase.v1.ChangedResourceSchema.tables:type_name -> bytebase.v1.ChangedResourceTable
+ 64, // 64: bytebase.v1.ChangedResourceSchema.views:type_name -> bytebase.v1.ChangedResourceView
+ 65, // 65: bytebase.v1.ChangedResourceSchema.functions:type_name -> bytebase.v1.ChangedResourceFunction
+ 66, // 66: bytebase.v1.ChangedResourceSchema.procedures:type_name -> bytebase.v1.ChangedResourceProcedure
+ 83, // 67: bytebase.v1.ChangedResourceTable.ranges:type_name -> bytebase.v1.Range
+ 83, // 68: bytebase.v1.ChangedResourceView.ranges:type_name -> bytebase.v1.Range
+ 83, // 69: bytebase.v1.ChangedResourceFunction.ranges:type_name -> bytebase.v1.Range
+ 83, // 70: bytebase.v1.ChangedResourceProcedure.ranges:type_name -> bytebase.v1.Range
+ 72, // 71: bytebase.v1.ListRevisionsResponse.revisions:type_name -> bytebase.v1.Revision
+ 72, // 72: bytebase.v1.CreateRevisionRequest.revision:type_name -> bytebase.v1.Revision
+ 80, // 73: bytebase.v1.Revision.create_time:type_name -> google.protobuf.Timestamp
+ 80, // 74: bytebase.v1.Revision.delete_time:type_name -> google.protobuf.Timestamp
+ 1, // 75: bytebase.v1.ListChangelogsRequest.view:type_name -> bytebase.v1.ChangelogView
+ 76, // 76: bytebase.v1.ListChangelogsResponse.changelogs:type_name -> bytebase.v1.Changelog
+ 1, // 77: bytebase.v1.GetChangelogRequest.view:type_name -> bytebase.v1.ChangelogView
+ 80, // 78: bytebase.v1.Changelog.create_time:type_name -> google.protobuf.Timestamp
+ 8, // 79: bytebase.v1.Changelog.status:type_name -> bytebase.v1.Changelog.Status
+ 60, // 80: bytebase.v1.Changelog.changed_resources:type_name -> bytebase.v1.ChangedResources
+ 9, // 81: bytebase.v1.Changelog.type:type_name -> bytebase.v1.Changelog.Type
+ 10, // 82: bytebase.v1.DatabaseService.GetDatabase:input_type -> bytebase.v1.GetDatabaseRequest
+ 11, // 83: bytebase.v1.DatabaseService.ListDatabases:input_type -> bytebase.v1.ListDatabasesRequest
+ 13, // 84: bytebase.v1.DatabaseService.UpdateDatabase:input_type -> bytebase.v1.UpdateDatabaseRequest
+ 14, // 85: bytebase.v1.DatabaseService.BatchUpdateDatabases:input_type -> bytebase.v1.BatchUpdateDatabasesRequest
+ 16, // 86: bytebase.v1.DatabaseService.SyncDatabase:input_type -> bytebase.v1.SyncDatabaseRequest
+ 18, // 87: bytebase.v1.DatabaseService.GetDatabaseMetadata:input_type -> bytebase.v1.GetDatabaseMetadataRequest
+ 19, // 88: bytebase.v1.DatabaseService.GetDatabaseSchema:input_type -> bytebase.v1.GetDatabaseSchemaRequest
+ 20, // 89: bytebase.v1.DatabaseService.DiffSchema:input_type -> bytebase.v1.DiffSchemaRequest
+ 48, // 90: bytebase.v1.DatabaseService.ListSlowQueries:input_type -> bytebase.v1.ListSlowQueriesRequest
+ 53, // 91: bytebase.v1.DatabaseService.ListSecrets:input_type -> bytebase.v1.ListSecretsRequest
+ 55, // 92: bytebase.v1.DatabaseService.UpdateSecret:input_type -> bytebase.v1.UpdateSecretRequest
+ 56, // 93: bytebase.v1.DatabaseService.DeleteSecret:input_type -> bytebase.v1.DeleteSecretRequest
+ 58, // 94: bytebase.v1.DatabaseService.AdviseIndex:input_type -> bytebase.v1.AdviseIndexRequest
+ 67, // 95: bytebase.v1.DatabaseService.ListRevisions:input_type -> bytebase.v1.ListRevisionsRequest
+ 70, // 96: bytebase.v1.DatabaseService.GetRevision:input_type -> bytebase.v1.GetRevisionRequest
+ 69, // 97: bytebase.v1.DatabaseService.CreateRevision:input_type -> bytebase.v1.CreateRevisionRequest
+ 71, // 98: bytebase.v1.DatabaseService.DeleteRevision:input_type -> bytebase.v1.DeleteRevisionRequest
+ 73, // 99: bytebase.v1.DatabaseService.ListChangelogs:input_type -> bytebase.v1.ListChangelogsRequest
+ 75, // 100: bytebase.v1.DatabaseService.GetChangelog:input_type -> bytebase.v1.GetChangelogRequest
+ 22, // 101: bytebase.v1.DatabaseService.GetDatabase:output_type -> bytebase.v1.Database
+ 12, // 102: bytebase.v1.DatabaseService.ListDatabases:output_type -> bytebase.v1.ListDatabasesResponse
+ 22, // 103: bytebase.v1.DatabaseService.UpdateDatabase:output_type -> bytebase.v1.Database
+ 15, // 104: bytebase.v1.DatabaseService.BatchUpdateDatabases:output_type -> bytebase.v1.BatchUpdateDatabasesResponse
+ 17, // 105: bytebase.v1.DatabaseService.SyncDatabase:output_type -> bytebase.v1.SyncDatabaseResponse
+ 23, // 106: bytebase.v1.DatabaseService.GetDatabaseMetadata:output_type -> bytebase.v1.DatabaseMetadata
+ 47, // 107: bytebase.v1.DatabaseService.GetDatabaseSchema:output_type -> bytebase.v1.DatabaseSchema
+ 21, // 108: bytebase.v1.DatabaseService.DiffSchema:output_type -> bytebase.v1.DiffSchemaResponse
+ 49, // 109: bytebase.v1.DatabaseService.ListSlowQueries:output_type -> bytebase.v1.ListSlowQueriesResponse
+ 54, // 110: bytebase.v1.DatabaseService.ListSecrets:output_type -> bytebase.v1.ListSecretsResponse
+ 57, // 111: bytebase.v1.DatabaseService.UpdateSecret:output_type -> bytebase.v1.Secret
+ 84, // 112: bytebase.v1.DatabaseService.DeleteSecret:output_type -> google.protobuf.Empty
+ 59, // 113: bytebase.v1.DatabaseService.AdviseIndex:output_type -> bytebase.v1.AdviseIndexResponse
+ 68, // 114: bytebase.v1.DatabaseService.ListRevisions:output_type -> bytebase.v1.ListRevisionsResponse
+ 72, // 115: bytebase.v1.DatabaseService.GetRevision:output_type -> bytebase.v1.Revision
+ 72, // 116: bytebase.v1.DatabaseService.CreateRevision:output_type -> bytebase.v1.Revision
+ 84, // 117: bytebase.v1.DatabaseService.DeleteRevision:output_type -> google.protobuf.Empty
+ 74, // 118: bytebase.v1.DatabaseService.ListChangelogs:output_type -> bytebase.v1.ListChangelogsResponse
+ 76, // 119: bytebase.v1.DatabaseService.GetChangelog:output_type -> bytebase.v1.Changelog
+ 101, // [101:120] is the sub-list for method output_type
+ 82, // [82:101] is the sub-list for method input_type
+ 82, // [82:82] is the sub-list for extension type_name
+ 82, // [82:82] is the sub-list for extension extendee
+ 0, // [0:82] is the sub-list for field type_name
}
func init() { file_v1_database_service_proto_init() }
@@ -7776,11 +7650,11 @@ func file_v1_database_service_proto_init() {
file_v1_annotation_proto_init()
file_v1_common_proto_init()
file_v1_instance_service_proto_init()
- file_v1_database_service_proto_msgTypes[12].OneofWrappers = []any{
+ file_v1_database_service_proto_msgTypes[10].OneofWrappers = []any{
(*DiffSchemaRequest_Schema)(nil),
(*DiffSchemaRequest_Changelog)(nil),
}
- file_v1_database_service_proto_msgTypes[25].OneofWrappers = []any{
+ file_v1_database_service_proto_msgTypes[23].OneofWrappers = []any{
(*ColumnMetadata_DefaultNull)(nil),
(*ColumnMetadata_DefaultString)(nil),
(*ColumnMetadata_DefaultExpression)(nil),
@@ -7791,7 +7665,7 @@ func file_v1_database_service_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_database_service_proto_rawDesc), len(file_v1_database_service_proto_rawDesc)),
NumEnums: 10,
- NumMessages: 70,
+ NumMessages: 68,
NumExtensions: 0,
NumServices: 1,
},
diff --git a/proto/generated-go/v1/database_service.pb.gw.go b/proto/generated-go/v1/database_service.pb.gw.go
index 0caf810fa1..9be87bd0d5 100644
--- a/proto/generated-go/v1/database_service.pb.gw.go
+++ b/proto/generated-go/v1/database_service.pb.gw.go
@@ -72,11 +72,11 @@ func local_request_DatabaseService_GetDatabase_0(ctx context.Context, marshaler
return msg, metadata, err
}
-var filter_DatabaseService_ListInstanceDatabases_0 = &utilities.DoubleArray{Encoding: map[string]int{"parent": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
+var filter_DatabaseService_ListDatabases_0 = &utilities.DoubleArray{Encoding: map[string]int{"parent": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
-func request_DatabaseService_ListInstanceDatabases_0(ctx context.Context, marshaler runtime.Marshaler, client DatabaseServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+func request_DatabaseService_ListDatabases_0(ctx context.Context, marshaler runtime.Marshaler, client DatabaseServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
- protoReq ListInstanceDatabasesRequest
+ protoReq ListDatabasesRequest
metadata runtime.ServerMetadata
err error
)
@@ -92,16 +92,16 @@ func request_DatabaseService_ListInstanceDatabases_0(ctx context.Context, marsha
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DatabaseService_ListInstanceDatabases_0); err != nil {
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DatabaseService_ListDatabases_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
- msg, err := client.ListInstanceDatabases(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ msg, err := client.ListDatabases(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
-func local_request_DatabaseService_ListInstanceDatabases_0(ctx context.Context, marshaler runtime.Marshaler, server DatabaseServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+func local_request_DatabaseService_ListDatabases_0(ctx context.Context, marshaler runtime.Marshaler, server DatabaseServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
- protoReq ListInstanceDatabasesRequest
+ protoReq ListDatabasesRequest
metadata runtime.ServerMetadata
err error
)
@@ -116,16 +116,16 @@ func local_request_DatabaseService_ListInstanceDatabases_0(ctx context.Context,
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DatabaseService_ListInstanceDatabases_0); err != nil {
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DatabaseService_ListDatabases_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
- msg, err := server.ListInstanceDatabases(ctx, &protoReq)
+ msg, err := server.ListDatabases(ctx, &protoReq)
return msg, metadata, err
}
-var filter_DatabaseService_ListDatabases_0 = &utilities.DoubleArray{Encoding: map[string]int{"parent": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
+var filter_DatabaseService_ListDatabases_1 = &utilities.DoubleArray{Encoding: map[string]int{"parent": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
-func request_DatabaseService_ListDatabases_0(ctx context.Context, marshaler runtime.Marshaler, client DatabaseServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+func request_DatabaseService_ListDatabases_1(ctx context.Context, marshaler runtime.Marshaler, client DatabaseServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq ListDatabasesRequest
metadata runtime.ServerMetadata
@@ -143,14 +143,14 @@ func request_DatabaseService_ListDatabases_0(ctx context.Context, marshaler runt
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DatabaseService_ListDatabases_0); err != nil {
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DatabaseService_ListDatabases_1); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListDatabases(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
-func local_request_DatabaseService_ListDatabases_0(ctx context.Context, marshaler runtime.Marshaler, server DatabaseServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+func local_request_DatabaseService_ListDatabases_1(ctx context.Context, marshaler runtime.Marshaler, server DatabaseServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq ListDatabasesRequest
metadata runtime.ServerMetadata
@@ -167,16 +167,16 @@ func local_request_DatabaseService_ListDatabases_0(ctx context.Context, marshale
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DatabaseService_ListDatabases_0); err != nil {
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DatabaseService_ListDatabases_1); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ListDatabases(ctx, &protoReq)
return msg, metadata, err
}
-var filter_DatabaseService_ListDatabases_1 = &utilities.DoubleArray{Encoding: map[string]int{"parent": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
+var filter_DatabaseService_ListDatabases_2 = &utilities.DoubleArray{Encoding: map[string]int{"parent": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
-func request_DatabaseService_ListDatabases_1(ctx context.Context, marshaler runtime.Marshaler, client DatabaseServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+func request_DatabaseService_ListDatabases_2(ctx context.Context, marshaler runtime.Marshaler, client DatabaseServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq ListDatabasesRequest
metadata runtime.ServerMetadata
@@ -194,14 +194,14 @@ func request_DatabaseService_ListDatabases_1(ctx context.Context, marshaler runt
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DatabaseService_ListDatabases_1); err != nil {
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DatabaseService_ListDatabases_2); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListDatabases(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
-func local_request_DatabaseService_ListDatabases_1(ctx context.Context, marshaler runtime.Marshaler, server DatabaseServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+func local_request_DatabaseService_ListDatabases_2(ctx context.Context, marshaler runtime.Marshaler, server DatabaseServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq ListDatabasesRequest
metadata runtime.ServerMetadata
@@ -218,7 +218,7 @@ func local_request_DatabaseService_ListDatabases_1(ctx context.Context, marshale
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
- if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DatabaseService_ListDatabases_1); err != nil {
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DatabaseService_ListDatabases_2); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ListDatabases(ctx, &protoReq)
@@ -1136,47 +1136,47 @@ func RegisterDatabaseServiceHandlerServer(ctx context.Context, mux *runtime.Serv
}
forward_DatabaseService_GetDatabase_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle(http.MethodGet, pattern_DatabaseService_ListInstanceDatabases_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle(http.MethodGet, pattern_DatabaseService_ListDatabases_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
- annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.DatabaseService/ListInstanceDatabases", runtime.WithHTTPPathPattern("/v1/{parent=instances/*}/databases"))
+ annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.DatabaseService/ListDatabases", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/databases"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := local_request_DatabaseService_ListInstanceDatabases_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ resp, md, err := local_request_DatabaseService_ListDatabases_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
- forward_DatabaseService_ListInstanceDatabases_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_DatabaseService_ListDatabases_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle(http.MethodGet, pattern_DatabaseService_ListDatabases_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle(http.MethodGet, pattern_DatabaseService_ListDatabases_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
- annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.DatabaseService/ListDatabases", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/databases"))
+ annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.DatabaseService/ListDatabases", runtime.WithHTTPPathPattern("/v1/{parent=instances/*}/databases"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := local_request_DatabaseService_ListDatabases_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ resp, md, err := local_request_DatabaseService_ListDatabases_1(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
- forward_DatabaseService_ListDatabases_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_DatabaseService_ListDatabases_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle(http.MethodGet, pattern_DatabaseService_ListDatabases_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle(http.MethodGet, pattern_DatabaseService_ListDatabases_2, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
@@ -1187,14 +1187,14 @@ func RegisterDatabaseServiceHandlerServer(ctx context.Context, mux *runtime.Serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := local_request_DatabaseService_ListDatabases_1(annotatedContext, inboundMarshaler, server, req, pathParams)
+ resp, md, err := local_request_DatabaseService_ListDatabases_2(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
- forward_DatabaseService_ListDatabases_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_DatabaseService_ListDatabases_2(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPatch, pattern_DatabaseService_UpdateDatabase_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
@@ -1613,41 +1613,41 @@ func RegisterDatabaseServiceHandlerClient(ctx context.Context, mux *runtime.Serv
}
forward_DatabaseService_GetDatabase_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle(http.MethodGet, pattern_DatabaseService_ListInstanceDatabases_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle(http.MethodGet, pattern_DatabaseService_ListDatabases_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
- annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.DatabaseService/ListInstanceDatabases", runtime.WithHTTPPathPattern("/v1/{parent=instances/*}/databases"))
+ annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.DatabaseService/ListDatabases", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/databases"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := request_DatabaseService_ListInstanceDatabases_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ resp, md, err := request_DatabaseService_ListDatabases_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
- forward_DatabaseService_ListInstanceDatabases_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_DatabaseService_ListDatabases_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle(http.MethodGet, pattern_DatabaseService_ListDatabases_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle(http.MethodGet, pattern_DatabaseService_ListDatabases_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
- annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.DatabaseService/ListDatabases", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/databases"))
+ annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.DatabaseService/ListDatabases", runtime.WithHTTPPathPattern("/v1/{parent=instances/*}/databases"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := request_DatabaseService_ListDatabases_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ resp, md, err := request_DatabaseService_ListDatabases_1(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
- forward_DatabaseService_ListDatabases_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_DatabaseService_ListDatabases_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
- mux.Handle(http.MethodGet, pattern_DatabaseService_ListDatabases_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ mux.Handle(http.MethodGet, pattern_DatabaseService_ListDatabases_2, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1656,13 +1656,13 @@ func RegisterDatabaseServiceHandlerClient(ctx context.Context, mux *runtime.Serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := request_DatabaseService_ListDatabases_1(annotatedContext, inboundMarshaler, client, req, pathParams)
+ resp, md, err := request_DatabaseService_ListDatabases_2(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
- forward_DatabaseService_ListDatabases_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ forward_DatabaseService_ListDatabases_2(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPatch, pattern_DatabaseService_UpdateDatabase_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
@@ -1974,51 +1974,51 @@ func RegisterDatabaseServiceHandlerClient(ctx context.Context, mux *runtime.Serv
}
var (
- pattern_DatabaseService_GetDatabase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "instances", "databases", "name"}, ""))
- pattern_DatabaseService_ListInstanceDatabases_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "instances", "parent", "databases"}, ""))
- pattern_DatabaseService_ListDatabases_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "databases"}, ""))
- pattern_DatabaseService_ListDatabases_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "workspaces", "parent", "databases"}, ""))
- pattern_DatabaseService_UpdateDatabase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "instances", "databases", "database.name"}, ""))
- pattern_DatabaseService_BatchUpdateDatabases_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "instances", "parent", "databases"}, "batchUpdate"))
- pattern_DatabaseService_SyncDatabase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "instances", "databases", "name"}, "sync"))
- pattern_DatabaseService_GetDatabaseMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 4, 5, 5, 4}, []string{"v1", "instances", "databases", "metadata", "name"}, ""))
- pattern_DatabaseService_GetDatabaseSchema_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 4, 5, 5, 4}, []string{"v1", "instances", "databases", "schema", "name"}, ""))
- pattern_DatabaseService_DiffSchema_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "instances", "databases", "name"}, "diffSchema"))
- pattern_DatabaseService_DiffSchema_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 1, 0, 4, 6, 5, 4}, []string{"v1", "instances", "databases", "changelogs", "name"}, "diffSchema"))
- pattern_DatabaseService_ListSlowQueries_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "slowQueries"}, ""))
- pattern_DatabaseService_ListSecrets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3, 2, 4}, []string{"v1", "instances", "databases", "parent", "secrets"}, ""))
- pattern_DatabaseService_UpdateSecret_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 1, 0, 4, 6, 5, 4}, []string{"v1", "instances", "databases", "secrets", "secret.name"}, ""))
- pattern_DatabaseService_DeleteSecret_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 1, 0, 4, 6, 5, 4}, []string{"v1", "instances", "databases", "secrets", "name"}, ""))
- pattern_DatabaseService_AdviseIndex_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "instances", "databases", "parent"}, "adviseIndex"))
- pattern_DatabaseService_ListRevisions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3, 2, 4}, []string{"v1", "instances", "databases", "parent", "revisions"}, ""))
- pattern_DatabaseService_GetRevision_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 1, 0, 4, 6, 5, 4}, []string{"v1", "instances", "databases", "revisions", "name"}, ""))
- pattern_DatabaseService_CreateRevision_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3, 2, 4}, []string{"v1", "instances", "databases", "parent", "revisions"}, ""))
- pattern_DatabaseService_DeleteRevision_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 1, 0, 4, 6, 5, 4}, []string{"v1", "instances", "databases", "revisions", "name"}, ""))
- pattern_DatabaseService_ListChangelogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3, 2, 4}, []string{"v1", "instances", "databases", "parent", "changelogs"}, ""))
- pattern_DatabaseService_GetChangelog_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 1, 0, 4, 6, 5, 4}, []string{"v1", "instances", "databases", "changelogs", "name"}, ""))
+ pattern_DatabaseService_GetDatabase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "instances", "databases", "name"}, ""))
+ pattern_DatabaseService_ListDatabases_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "databases"}, ""))
+ pattern_DatabaseService_ListDatabases_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "instances", "parent", "databases"}, ""))
+ pattern_DatabaseService_ListDatabases_2 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "workspaces", "parent", "databases"}, ""))
+ pattern_DatabaseService_UpdateDatabase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "instances", "databases", "database.name"}, ""))
+ pattern_DatabaseService_BatchUpdateDatabases_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "instances", "parent", "databases"}, "batchUpdate"))
+ pattern_DatabaseService_SyncDatabase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "instances", "databases", "name"}, "sync"))
+ pattern_DatabaseService_GetDatabaseMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 4, 5, 5, 4}, []string{"v1", "instances", "databases", "metadata", "name"}, ""))
+ pattern_DatabaseService_GetDatabaseSchema_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 4, 5, 5, 4}, []string{"v1", "instances", "databases", "schema", "name"}, ""))
+ pattern_DatabaseService_DiffSchema_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "instances", "databases", "name"}, "diffSchema"))
+ pattern_DatabaseService_DiffSchema_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 1, 0, 4, 6, 5, 4}, []string{"v1", "instances", "databases", "changelogs", "name"}, "diffSchema"))
+ pattern_DatabaseService_ListSlowQueries_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "slowQueries"}, ""))
+ pattern_DatabaseService_ListSecrets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3, 2, 4}, []string{"v1", "instances", "databases", "parent", "secrets"}, ""))
+ pattern_DatabaseService_UpdateSecret_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 1, 0, 4, 6, 5, 4}, []string{"v1", "instances", "databases", "secrets", "secret.name"}, ""))
+ pattern_DatabaseService_DeleteSecret_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 1, 0, 4, 6, 5, 4}, []string{"v1", "instances", "databases", "secrets", "name"}, ""))
+ pattern_DatabaseService_AdviseIndex_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "instances", "databases", "parent"}, "adviseIndex"))
+ pattern_DatabaseService_ListRevisions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3, 2, 4}, []string{"v1", "instances", "databases", "parent", "revisions"}, ""))
+ pattern_DatabaseService_GetRevision_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 1, 0, 4, 6, 5, 4}, []string{"v1", "instances", "databases", "revisions", "name"}, ""))
+ pattern_DatabaseService_CreateRevision_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3, 2, 4}, []string{"v1", "instances", "databases", "parent", "revisions"}, ""))
+ pattern_DatabaseService_DeleteRevision_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 1, 0, 4, 6, 5, 4}, []string{"v1", "instances", "databases", "revisions", "name"}, ""))
+ pattern_DatabaseService_ListChangelogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3, 2, 4}, []string{"v1", "instances", "databases", "parent", "changelogs"}, ""))
+ pattern_DatabaseService_GetChangelog_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 1, 0, 4, 6, 5, 4}, []string{"v1", "instances", "databases", "changelogs", "name"}, ""))
)
var (
- forward_DatabaseService_GetDatabase_0 = runtime.ForwardResponseMessage
- forward_DatabaseService_ListInstanceDatabases_0 = runtime.ForwardResponseMessage
- forward_DatabaseService_ListDatabases_0 = runtime.ForwardResponseMessage
- forward_DatabaseService_ListDatabases_1 = runtime.ForwardResponseMessage
- forward_DatabaseService_UpdateDatabase_0 = runtime.ForwardResponseMessage
- forward_DatabaseService_BatchUpdateDatabases_0 = runtime.ForwardResponseMessage
- forward_DatabaseService_SyncDatabase_0 = runtime.ForwardResponseMessage
- forward_DatabaseService_GetDatabaseMetadata_0 = runtime.ForwardResponseMessage
- forward_DatabaseService_GetDatabaseSchema_0 = runtime.ForwardResponseMessage
- forward_DatabaseService_DiffSchema_0 = runtime.ForwardResponseMessage
- forward_DatabaseService_DiffSchema_1 = runtime.ForwardResponseMessage
- forward_DatabaseService_ListSlowQueries_0 = runtime.ForwardResponseMessage
- forward_DatabaseService_ListSecrets_0 = runtime.ForwardResponseMessage
- forward_DatabaseService_UpdateSecret_0 = runtime.ForwardResponseMessage
- forward_DatabaseService_DeleteSecret_0 = runtime.ForwardResponseMessage
- forward_DatabaseService_AdviseIndex_0 = runtime.ForwardResponseMessage
- forward_DatabaseService_ListRevisions_0 = runtime.ForwardResponseMessage
- forward_DatabaseService_GetRevision_0 = runtime.ForwardResponseMessage
- forward_DatabaseService_CreateRevision_0 = runtime.ForwardResponseMessage
- forward_DatabaseService_DeleteRevision_0 = runtime.ForwardResponseMessage
- forward_DatabaseService_ListChangelogs_0 = runtime.ForwardResponseMessage
- forward_DatabaseService_GetChangelog_0 = runtime.ForwardResponseMessage
+ forward_DatabaseService_GetDatabase_0 = runtime.ForwardResponseMessage
+ forward_DatabaseService_ListDatabases_0 = runtime.ForwardResponseMessage
+ forward_DatabaseService_ListDatabases_1 = runtime.ForwardResponseMessage
+ forward_DatabaseService_ListDatabases_2 = runtime.ForwardResponseMessage
+ forward_DatabaseService_UpdateDatabase_0 = runtime.ForwardResponseMessage
+ forward_DatabaseService_BatchUpdateDatabases_0 = runtime.ForwardResponseMessage
+ forward_DatabaseService_SyncDatabase_0 = runtime.ForwardResponseMessage
+ forward_DatabaseService_GetDatabaseMetadata_0 = runtime.ForwardResponseMessage
+ forward_DatabaseService_GetDatabaseSchema_0 = runtime.ForwardResponseMessage
+ forward_DatabaseService_DiffSchema_0 = runtime.ForwardResponseMessage
+ forward_DatabaseService_DiffSchema_1 = runtime.ForwardResponseMessage
+ forward_DatabaseService_ListSlowQueries_0 = runtime.ForwardResponseMessage
+ forward_DatabaseService_ListSecrets_0 = runtime.ForwardResponseMessage
+ forward_DatabaseService_UpdateSecret_0 = runtime.ForwardResponseMessage
+ forward_DatabaseService_DeleteSecret_0 = runtime.ForwardResponseMessage
+ forward_DatabaseService_AdviseIndex_0 = runtime.ForwardResponseMessage
+ forward_DatabaseService_ListRevisions_0 = runtime.ForwardResponseMessage
+ forward_DatabaseService_GetRevision_0 = runtime.ForwardResponseMessage
+ forward_DatabaseService_CreateRevision_0 = runtime.ForwardResponseMessage
+ forward_DatabaseService_DeleteRevision_0 = runtime.ForwardResponseMessage
+ forward_DatabaseService_ListChangelogs_0 = runtime.ForwardResponseMessage
+ forward_DatabaseService_GetChangelog_0 = runtime.ForwardResponseMessage
)
diff --git a/proto/generated-go/v1/database_service_grpc.pb.go b/proto/generated-go/v1/database_service_grpc.pb.go
index e2f6a6ac44..6ce47f7b62 100644
--- a/proto/generated-go/v1/database_service_grpc.pb.go
+++ b/proto/generated-go/v1/database_service_grpc.pb.go
@@ -20,26 +20,25 @@ import (
const _ = grpc.SupportPackageIsVersion9
const (
- DatabaseService_GetDatabase_FullMethodName = "/bytebase.v1.DatabaseService/GetDatabase"
- DatabaseService_ListInstanceDatabases_FullMethodName = "/bytebase.v1.DatabaseService/ListInstanceDatabases"
- DatabaseService_ListDatabases_FullMethodName = "/bytebase.v1.DatabaseService/ListDatabases"
- DatabaseService_UpdateDatabase_FullMethodName = "/bytebase.v1.DatabaseService/UpdateDatabase"
- DatabaseService_BatchUpdateDatabases_FullMethodName = "/bytebase.v1.DatabaseService/BatchUpdateDatabases"
- DatabaseService_SyncDatabase_FullMethodName = "/bytebase.v1.DatabaseService/SyncDatabase"
- DatabaseService_GetDatabaseMetadata_FullMethodName = "/bytebase.v1.DatabaseService/GetDatabaseMetadata"
- DatabaseService_GetDatabaseSchema_FullMethodName = "/bytebase.v1.DatabaseService/GetDatabaseSchema"
- DatabaseService_DiffSchema_FullMethodName = "/bytebase.v1.DatabaseService/DiffSchema"
- DatabaseService_ListSlowQueries_FullMethodName = "/bytebase.v1.DatabaseService/ListSlowQueries"
- DatabaseService_ListSecrets_FullMethodName = "/bytebase.v1.DatabaseService/ListSecrets"
- DatabaseService_UpdateSecret_FullMethodName = "/bytebase.v1.DatabaseService/UpdateSecret"
- DatabaseService_DeleteSecret_FullMethodName = "/bytebase.v1.DatabaseService/DeleteSecret"
- DatabaseService_AdviseIndex_FullMethodName = "/bytebase.v1.DatabaseService/AdviseIndex"
- DatabaseService_ListRevisions_FullMethodName = "/bytebase.v1.DatabaseService/ListRevisions"
- DatabaseService_GetRevision_FullMethodName = "/bytebase.v1.DatabaseService/GetRevision"
- DatabaseService_CreateRevision_FullMethodName = "/bytebase.v1.DatabaseService/CreateRevision"
- DatabaseService_DeleteRevision_FullMethodName = "/bytebase.v1.DatabaseService/DeleteRevision"
- DatabaseService_ListChangelogs_FullMethodName = "/bytebase.v1.DatabaseService/ListChangelogs"
- DatabaseService_GetChangelog_FullMethodName = "/bytebase.v1.DatabaseService/GetChangelog"
+ DatabaseService_GetDatabase_FullMethodName = "/bytebase.v1.DatabaseService/GetDatabase"
+ DatabaseService_ListDatabases_FullMethodName = "/bytebase.v1.DatabaseService/ListDatabases"
+ DatabaseService_UpdateDatabase_FullMethodName = "/bytebase.v1.DatabaseService/UpdateDatabase"
+ DatabaseService_BatchUpdateDatabases_FullMethodName = "/bytebase.v1.DatabaseService/BatchUpdateDatabases"
+ DatabaseService_SyncDatabase_FullMethodName = "/bytebase.v1.DatabaseService/SyncDatabase"
+ DatabaseService_GetDatabaseMetadata_FullMethodName = "/bytebase.v1.DatabaseService/GetDatabaseMetadata"
+ DatabaseService_GetDatabaseSchema_FullMethodName = "/bytebase.v1.DatabaseService/GetDatabaseSchema"
+ DatabaseService_DiffSchema_FullMethodName = "/bytebase.v1.DatabaseService/DiffSchema"
+ DatabaseService_ListSlowQueries_FullMethodName = "/bytebase.v1.DatabaseService/ListSlowQueries"
+ DatabaseService_ListSecrets_FullMethodName = "/bytebase.v1.DatabaseService/ListSecrets"
+ DatabaseService_UpdateSecret_FullMethodName = "/bytebase.v1.DatabaseService/UpdateSecret"
+ DatabaseService_DeleteSecret_FullMethodName = "/bytebase.v1.DatabaseService/DeleteSecret"
+ DatabaseService_AdviseIndex_FullMethodName = "/bytebase.v1.DatabaseService/AdviseIndex"
+ DatabaseService_ListRevisions_FullMethodName = "/bytebase.v1.DatabaseService/ListRevisions"
+ DatabaseService_GetRevision_FullMethodName = "/bytebase.v1.DatabaseService/GetRevision"
+ DatabaseService_CreateRevision_FullMethodName = "/bytebase.v1.DatabaseService/CreateRevision"
+ DatabaseService_DeleteRevision_FullMethodName = "/bytebase.v1.DatabaseService/DeleteRevision"
+ DatabaseService_ListChangelogs_FullMethodName = "/bytebase.v1.DatabaseService/ListChangelogs"
+ DatabaseService_GetChangelog_FullMethodName = "/bytebase.v1.DatabaseService/GetChangelog"
)
// DatabaseServiceClient is the client API for DatabaseService service.
@@ -47,7 +46,6 @@ const (
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type DatabaseServiceClient interface {
GetDatabase(ctx context.Context, in *GetDatabaseRequest, opts ...grpc.CallOption) (*Database, error)
- ListInstanceDatabases(ctx context.Context, in *ListInstanceDatabasesRequest, opts ...grpc.CallOption) (*ListInstanceDatabasesResponse, error)
ListDatabases(ctx context.Context, in *ListDatabasesRequest, opts ...grpc.CallOption) (*ListDatabasesResponse, error)
UpdateDatabase(ctx context.Context, in *UpdateDatabaseRequest, opts ...grpc.CallOption) (*Database, error)
BatchUpdateDatabases(ctx context.Context, in *BatchUpdateDatabasesRequest, opts ...grpc.CallOption) (*BatchUpdateDatabasesResponse, error)
@@ -86,16 +84,6 @@ func (c *databaseServiceClient) GetDatabase(ctx context.Context, in *GetDatabase
return out, nil
}
-func (c *databaseServiceClient) ListInstanceDatabases(ctx context.Context, in *ListInstanceDatabasesRequest, opts ...grpc.CallOption) (*ListInstanceDatabasesResponse, error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(ListInstanceDatabasesResponse)
- err := c.cc.Invoke(ctx, DatabaseService_ListInstanceDatabases_FullMethodName, in, out, cOpts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
func (c *databaseServiceClient) ListDatabases(ctx context.Context, in *ListDatabasesRequest, opts ...grpc.CallOption) (*ListDatabasesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListDatabasesResponse)
@@ -281,7 +269,6 @@ func (c *databaseServiceClient) GetChangelog(ctx context.Context, in *GetChangel
// for forward compatibility.
type DatabaseServiceServer interface {
GetDatabase(context.Context, *GetDatabaseRequest) (*Database, error)
- ListInstanceDatabases(context.Context, *ListInstanceDatabasesRequest) (*ListInstanceDatabasesResponse, error)
ListDatabases(context.Context, *ListDatabasesRequest) (*ListDatabasesResponse, error)
UpdateDatabase(context.Context, *UpdateDatabaseRequest) (*Database, error)
BatchUpdateDatabases(context.Context, *BatchUpdateDatabasesRequest) (*BatchUpdateDatabasesResponse, error)
@@ -313,9 +300,6 @@ type UnimplementedDatabaseServiceServer struct{}
func (UnimplementedDatabaseServiceServer) GetDatabase(context.Context, *GetDatabaseRequest) (*Database, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetDatabase not implemented")
}
-func (UnimplementedDatabaseServiceServer) ListInstanceDatabases(context.Context, *ListInstanceDatabasesRequest) (*ListInstanceDatabasesResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method ListInstanceDatabases not implemented")
-}
func (UnimplementedDatabaseServiceServer) ListDatabases(context.Context, *ListDatabasesRequest) (*ListDatabasesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListDatabases not implemented")
}
@@ -409,24 +393,6 @@ func _DatabaseService_GetDatabase_Handler(srv interface{}, ctx context.Context,
return interceptor(ctx, in, info, handler)
}
-func _DatabaseService_ListInstanceDatabases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ListInstanceDatabasesRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(DatabaseServiceServer).ListInstanceDatabases(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: DatabaseService_ListInstanceDatabases_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(DatabaseServiceServer).ListInstanceDatabases(ctx, req.(*ListInstanceDatabasesRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
func _DatabaseService_ListDatabases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListDatabasesRequest)
if err := dec(in); err != nil {
@@ -762,10 +728,6 @@ var DatabaseService_ServiceDesc = grpc.ServiceDesc{
MethodName: "GetDatabase",
Handler: _DatabaseService_GetDatabase_Handler,
},
- {
- MethodName: "ListInstanceDatabases",
- Handler: _DatabaseService_ListInstanceDatabases_Handler,
- },
{
MethodName: "ListDatabases",
Handler: _DatabaseService_ListDatabases_Handler,
diff --git a/proto/generated-go/v1/sql_service.pb.go b/proto/generated-go/v1/sql_service.pb.go
index 91081278c1..7d90f930a1 100644
--- a/proto/generated-go/v1/sql_service.pb.go
+++ b/proto/generated-go/v1/sql_service.pb.go
@@ -1874,7 +1874,7 @@ type SearchQueryHistoriesRequest struct {
// - database, for example:
// database = "instances/{instance}/databases/{database}"
// - instance, for example:
- // instance = "instance/{instance}"
+ // instance = "instances/{instance}"
// - type, for example:
// type = "QUERY"
Filter string `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"`
diff --git a/proto/v1/database_service.proto b/proto/v1/database_service.proto
index 476df54f69..7c361e290b 100644
--- a/proto/v1/database_service.proto
+++ b/proto/v1/database_service.proto
@@ -24,23 +24,17 @@ service DatabaseService {
option (bytebase.v1.auth_method) = IAM;
}
- rpc ListInstanceDatabases(ListInstanceDatabasesRequest) returns (ListInstanceDatabasesResponse) {
- option (google.api.http) = {get: "/v1/{parent=instances/*}/databases"};
- option (google.api.method_signature) = "";
- option (bytebase.v1.permission) = "bb.instances.get";
- option (bytebase.v1.auth_method) = IAM;
- }
-
rpc ListDatabases(ListDatabasesRequest) returns (ListDatabasesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*}/databases"
+ additional_bindings: {get: "/v1/{parent=instances/*}/databases"}
additional_bindings: {get: "/v1/{parent=workspaces/*}/databases"}
};
option (google.api.method_signature) = "";
option (bytebase.v1.permission) = "bb.databases.list";
- option (bytebase.v1.auth_method) = IAM;
+ option (bytebase.v1.auth_method) = CUSTOM;
}
rpc UpdateDatabase(UpdateDatabaseRequest) returns (Database) {
@@ -189,53 +183,19 @@ message GetDatabaseRequest {
];
}
-message ListInstanceDatabasesRequest {
- // The parent, which owns this collection of databases.
- // - instances/{instance}: list all databases for an instance. Use
- // "instances/-" to list all databases.
- string parent = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {type: "bytebase.com/Instance"}
- ];
-
- // The maximum number of databases to return. The service may return fewer
- // than this value. If unspecified, at most 10 databases will be returned.
- int32 page_size = 2;
-
- // A page token, received from a previous `ListInstanceDatabases` call.
- // Provide this to retrieve the subsequent page.
- //
- // When paginating, all other parameters provided to `ListInstanceDatabases`
- // must match the call that provided the page token.
- string page_token = 3;
-
- // Deprecated.
- // Filter is used to filter databases returned in the list.
- // For example, `project == "projects/{project}"` can be used to list
- // databases in a project. Note: the project filter will be moved to parent.
- string filter = 4;
-}
-
-message ListInstanceDatabasesResponse {
- // The databases from the specified request.
- repeated Database databases = 1;
-
- // A token, which can be sent as `page_token` to retrieve the next page.
- // If this field is omitted, there are no subsequent pages.
- string next_page_token = 2;
-}
-
message ListDatabasesRequest {
- // The parent, which owns this collection of databases.
- // - projects/{project}: list all databases in a project.
- // - workspaces/{workspace}: list all databases in a workspace.
+ // - projects/{project}: list databases in a project, require "bb.projects.get" permission.
+ // - workspaces/-: list databases in the workspace, require "bb.databases.list" permission.
+ // - instances/{instances}: list databases in a instance, require "bb.instances.get" permission
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {child_type: "bytebase.com/Database"}
];
// The maximum number of databases to return. The service may return fewer
- // than this value. If unspecified, at most 10 databases will be returned.
+ // than this value.
+ // If unspecified, at most 10 databases will be returned.
+ // The maximum value is 1000; values above 1000 will be coerced to 1000.
int32 page_size = 2;
// A page token, received from a previous `ListDatabases` call.
@@ -244,6 +204,33 @@ message ListDatabasesRequest {
// When paginating, all other parameters provided to `ListDatabases` must
// match the call that provided the page token.
string page_token = 3;
+
+ // Filter is used to filter databases returned in the list.
+ // Supported filter:
+ // - environment
+ // - name
+ // - project
+ // - instance
+ // - engine
+ // - label
+ // - exclude_unassigned: Not show unassigned databases if specified
+ //
+ // For example:
+ // environment == "environments/{environment resource id}"
+ // project == "projects/{project resource id}"
+ // instance == "instances/{instance resource id}"
+ // name.matches("database name")
+ // engine == "MYSQL"
+ // engine in ["MYSQL", "POSTGRES"]
+ // !(engine in ["MYSQL", "POSTGRES"])
+ // label == "region:asia"
+ // label == "tenant:asia,europe"
+ // label == "region:asia" && label == "tenant:bytebase"
+ // exclude_unassigned == true
+ string filter = 4;
+
+ // Show deleted database if specified.
+ bool show_deleted = 5;
}
message ListDatabasesResponse {
diff --git a/proto/v1/sql_service.proto b/proto/v1/sql_service.proto
index 9ec32837fa..2f0ad462ad 100644
--- a/proto/v1/sql_service.proto
+++ b/proto/v1/sql_service.proto
@@ -485,7 +485,7 @@ message SearchQueryHistoriesRequest {
// - database, for example:
// database = "instances/{instance}/databases/{database}"
// - instance, for example:
- // instance = "instance/{instance}"
+ // instance = "instances/{instance}"
// - type, for example:
// type = "QUERY"
string filter = 3;