Skip to content

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

docs: implement docs for filter (#15982)

ecmadaofa4680affb2e
diff --git a/backend/api/v1/issue_service.go b/backend/api/v1/issue_service.go
index 0ac074e9e0..eb95e8bcd9 100644
--- a/backend/api/v1/issue_service.go
+++ b/backend/api/v1/issue_service.go
@@ -7,6 +7,8 @@ import (
"time"
"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"
"go.uber.org/multierr"
"google.golang.org/grpc/codes"
@@ -83,141 +85,178 @@ func (s *IssueService) getIssueFind(ctx context.Context, filter string, query st
if query != "" {
issueFind.Query = &query
}
- filters, err := ParseFilter(filter)
- if err != nil {
- return nil, status.Error(codes.InvalidArgument, err.Error())
- }
- for _, spec := range filters {
- switch spec.Key {
- case "creator":
- if spec.Operator != ComparatorTypeEqual {
- return nil, status.Errorf(codes.InvalidArgument, `only support "=" operation for "creator" filter`)
- }
- user, err := s.getUserByIdentifier(ctx, spec.Value)
- if err != nil {
- return nil, err
- }
- issueFind.CreatorID = &user.ID
- case "subscriber":
- if spec.Operator != ComparatorTypeEqual {
- return nil, status.Errorf(codes.InvalidArgument, `only support "=" operation for "subscriber" filter`)
- }
- user, err := s.getUserByIdentifier(ctx, spec.Value)
- if err != nil {
- return nil, err
- }
- issueFind.SubscriberID = &user.ID
- case "status":
- if spec.Operator != ComparatorTypeEqual {
- return nil, status.Errorf(codes.InvalidArgument, `only support "=" operation for "status" filter`)
- }
- for _, raw := range strings.Split(spec.Value, " | ") {
- newStatus, err := convertToAPIIssueStatus(v1pb.IssueStatus(v1pb.IssueStatus_value[raw]))
+ if filter == "" {
+ return issueFind, nil
+ }
+
+ e, err := cel.NewEnv()
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, "failed to create cel env")
+ }
+ ast, iss := e.Parse(filter)
+ if iss != nil {
+ return nil, status.Errorf(codes.InvalidArgument, "failed to parse filter %v, error: %v", filter, iss.String())
+ }
+
+ var parseFilter func(expr celast.Expr) (string, error)
+ parseFilter = func(expr celast.Expr) (string, error) {
+ switch expr.Kind() {
+ case celast.CallKind:
+ functionName := expr.AsCall().FunctionName()
+ switch functionName {
+ case celoperators.LogicalAnd:
+ return getSubConditionFromExpr(expr, parseFilter, "AND")
+ case celoperators.Equals:
+ variable, value := getVariableAndValueFromExpr(expr)
+ switch variable {
+ case "creator", "subscriber":
+ user, err := s.getUserByIdentifier(ctx, value.(string))
+ if err != nil {
+ return "", status.Errorf(codes.Internal, "failed to get user %v with error %v", value, err.Error())
+ }
+ if variable == "creator" {
+ issueFind.CreatorID = &user.ID
+ } else {
+ issueFind.SubscriberID = &user.ID
+ }
+ case "instance":
+ instanceResourceID, err := common.GetInstanceID(value.(string))
+ if err != nil {
+ return "", status.Errorf(codes.InvalidArgument, `invalid instance resource id "%s": %v`, value, err.Error())
+ }
+ issueFind.InstanceResourceID = &instanceResourceID
+ case "database":
+ instanceID, databaseName, err := common.GetInstanceDatabaseID(value.(string))
+ if err != nil {
+ return "", status.Error(codes.InvalidArgument, err.Error())
+ }
+ database, err := s.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{
+ InstanceID: &instanceID,
+ DatabaseName: &databaseName,
+ })
+ if err != nil {
+ return "", status.Error(codes.Internal, err.Error())
+ }
+ if database == nil {
+ return "", status.Errorf(codes.InvalidArgument, `database "%q" not found`, value)
+ }
+ issueFind.InstanceID = &database.InstanceID
+ issueFind.DatabaseName = &database.DatabaseName
+ case "has_pipeline":
+ hasPipeline, ok := value.(bool)
+ if !ok {
+ return "", status.Errorf(codes.InvalidArgument, `"has_pipeline" should be bool`)
+ }
+ if !hasPipeline {
+ issueFind.NoPipeline = true
+ }
+ case "status":
+ issueStatus, err := convertToAPIIssueStatus(v1pb.IssueStatus(v1pb.IssueStatus_value[value.(string)]))
+ if err != nil {
+ return "", status.Errorf(codes.InvalidArgument, "failed to convert to issue status, err: %v", err)
+ }
+ issueFind.StatusList = append(issueFind.StatusList, issueStatus)
+ case "type":
+ issueType, err := convertToAPIIssueType(v1pb.Issue_Type(v1pb.Issue_Type_value[value.(string)]))
+ if err != nil {
+ return "", status.Errorf(codes.InvalidArgument, "failed to convert to issue type, err: %v", err)
+ }
+ issueFind.Types = &[]base.IssueType{issueType}
+ case "task_type":
+ taskType, ok := value.(string)
+ if !ok {
+ return "", status.Errorf(codes.InvalidArgument, `"task_type" should be string`)
+ }
+ switch taskType {
+ case "DDL":
+ issueFind.TaskTypes = &[]base.TaskType{
+ base.TaskDatabaseSchemaUpdate,
+ base.TaskDatabaseSchemaUpdateGhost,
+ }
+ case "DML":
+ issueFind.TaskTypes = &[]base.TaskType{
+ base.TaskDatabaseDataUpdate,
+ }
+ case "DATA_EXPORT":
+ issueFind.TaskTypes = &[]base.TaskType{
+ base.TaskDatabaseDataExport,
+ }
+ default:
+ return "", status.Errorf(codes.InvalidArgument, `unknown value %q`, value)
+ }
+ case "labels":
+ issueFind.LabelList = append(issueFind.LabelList, value.(string))
+ default:
+ return "", status.Errorf(codes.InvalidArgument, "unsupport variable %q with %v operator", variable, celoperators.Equals)
+ }
+ case celoperators.GreaterEquals, celoperators.LessEquals:
+ variable, rawValue := getVariableAndValueFromExpr(expr)
+ value, ok := rawValue.(string)
+ if !ok {
+ return "", errors.Errorf("expect string, got %T, hint: filter literals should be string", rawValue)
+ }
+ if variable != "create_time" {
+ return "", errors.Errorf(`">=" and "<=" are only supported for "create_time"`)
+ }
+ t, err := time.Parse(time.RFC3339, value)
if err != nil {
- return nil, status.Errorf(codes.InvalidArgument, "failed to convert to issue status, err: %v", err)
+ return "", errors.Errorf("failed to parse time %v, error: %v", value, err)
}
- issueFind.StatusList = append(issueFind.StatusList, newStatus)
- }
- case "create_time":
- if spec.Operator != ComparatorTypeGreaterEqual && spec.Operator != ComparatorTypeLessEqual {
- return nil, status.Errorf(codes.InvalidArgument, `only support "<=" or ">=" operation for "create_time" filter`)
- }
- t, err := time.Parse(time.RFC3339, spec.Value)
- if err != nil {
- return nil, status.Errorf(codes.InvalidArgument, "failed to parse create_time %s, err: %v", spec.Value, err)
- }
- if spec.Operator == ComparatorTypeGreaterEqual {
- issueFind.CreatedAtAfter = &t
- } else {
- issueFind.CreatedAtBefore = &t
- }
- case "create_time_after":
- t, err := time.Parse(time.RFC3339, spec.Value)
- if err != nil {
- return nil, status.Errorf(codes.InvalidArgument, "failed to parse create_time_after %s, err: %v", spec.Value, err)
- }
- issueFind.CreatedAtAfter = &t
- case "type":
- if spec.Operator != ComparatorTypeEqual {
- return nil, status.Errorf(codes.InvalidArgument, `only support "=" operation for "type" filter`)
- }
- issueType, err := convertToAPIIssueType(v1pb.Issue_Type(v1pb.Issue_Type_value[spec.Value]))
- if err != nil {
- return nil, status.Errorf(codes.InvalidArgument, "failed to convert to issue type, err: %v", err)
- }
- issueFind.Types = &[]base.IssueType{issueType}
- case "task_type":
- if spec.Operator != ComparatorTypeEqual {
- return nil, status.Errorf(codes.InvalidArgument, `only support "=" operation for "task_type" filter`)
- }
- switch spec.Value {
- case "DDL":
- issueFind.TaskTypes = &[]base.TaskType{
- base.TaskDatabaseSchemaUpdate,
- base.TaskDatabaseSchemaUpdateGhost,
+ if functionName == celoperators.GreaterEquals {
+ issueFind.CreatedAtAfter = &t
+ } else {
+ issueFind.CreatedAtBefore = &t
}
- case "DML":
- issueFind.TaskTypes = &[]base.TaskType{
- base.TaskDatabaseDataUpdate,
+ case celoperators.In:
+ variable, value := getVariableAndValueFromExpr(expr)
+ rawList, ok := value.([]any)
+ if !ok {
+ return "", status.Errorf(codes.InvalidArgument, "invalid list value %q for %v", value, variable)
}
- case "DATA_EXPORT":
- issueFind.TaskTypes = &[]base.TaskType{
- base.TaskDatabaseDataExport,
+ if len(rawList) == 0 {
+ return "", status.Errorf(codes.InvalidArgument, "empty list value for filter %v", variable)
+ }
+
+ switch variable {
+ case "status":
+ for _, raw := range rawList {
+ newStatus, err := convertToAPIIssueStatus(v1pb.IssueStatus(v1pb.IssueStatus_value[raw.(string)]))
+ if err != nil {
+ return "", status.Errorf(codes.InvalidArgument, "failed to convert to issue status, err: %v", err)
+ }
+ issueFind.StatusList = append(issueFind.StatusList, newStatus)
+ }
+ case "type":
+ types := []base.IssueType{}
+ for _, raw := range rawList {
+ issueType, err := convertToAPIIssueType(v1pb.Issue_Type(v1pb.Issue_Type_value[raw.(string)]))
+ if err != nil {
+ return "", status.Errorf(codes.InvalidArgument, "failed to convert to issue type, err: %v", err)
+ }
+ types = append(types, issueType)
+ }
+ issueFind.Types = &types
+ case "labels":
+ for _, label := range rawList {
+ issueLabel, ok := label.(string)
+ if !ok {
+ return "", status.Errorf(codes.InvalidArgument, `label should be string`)
+ }
+ issueFind.LabelList = append(issueFind.LabelList, issueLabel)
+ }
+ default:
+ return "", status.Errorf(codes.InvalidArgument, "unsupport variable %q with %v operator", variable, celoperators.In)
}
- default:
- return nil, status.Errorf(codes.InvalidArgument, `unknown value %q`, spec.Value)
- }
- case "instance":
- if spec.Operator != ComparatorTypeEqual {
- return nil, status.Errorf(codes.InvalidArgument, `only support "=" operation for "instance" filter`)
- }
- instanceResourceID, err := common.GetInstanceID(spec.Value)
- if err != nil {
- return nil, status.Errorf(codes.InvalidArgument, `invalid instance resource id "%s": %v`, spec.Value, err.Error())
- }
- issueFind.InstanceResourceID = &instanceResourceID
- case "database":
- if spec.Operator != ComparatorTypeEqual {
- return nil, status.Errorf(codes.InvalidArgument, `only support "=" operation for "database" filter`)
- }
- instanceID, databaseName, err := common.GetInstanceDatabaseID(spec.Value)
- if err != nil {
- return nil, status.Error(codes.InvalidArgument, err.Error())
- }
- database, err := s.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{
- InstanceID: &instanceID,
- DatabaseName: &databaseName,
- })
- if err != nil {
- return nil, status.Error(codes.Internal, err.Error())
- }
- if database == nil {
- return nil, status.Errorf(codes.InvalidArgument, `database "%q" not found`, spec.Value)
- }
- issueFind.InstanceID = &database.InstanceID
- issueFind.DatabaseName = &database.DatabaseName
- case "labels":
- if spec.Operator != ComparatorTypeEqual {
- return nil, status.Errorf(codes.InvalidArgument, `only support "=" operation for "%s" filter`, spec.Key)
- }
- for _, label := range strings.Split(spec.Value, " & ") {
- issueLabel := label
- issueFind.LabelList = append(issueFind.LabelList, issueLabel)
- }
- case "has_pipeline":
- if spec.Operator != ComparatorTypeEqual {
- return nil, status.Errorf(codes.InvalidArgument, `only support "=" operation for "%s" filter`, spec.Key)
- }
- switch spec.Value {
- case "false":
- issueFind.NoPipeline = true
- case "true":
- default:
- return nil, status.Errorf(codes.InvalidArgument, "invalid value %q for has_pipeline", spec.Value)
}
+ default:
+ return "", errors.Errorf("unexpected expr kind %v", expr.Kind())
}
+ return "", nil
}
+ if _, err := parseFilter(ast.NativeRep().Expr()); err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, "failed to parse filter, error: %v", err)
+ }
return issueFind, nil
}
diff --git a/backend/api/v1/plan_service.go b/backend/api/v1/plan_service.go
index f8f298dc91..a671d885d6 100644
--- a/backend/api/v1/plan_service.go
+++ b/backend/api/v1/plan_service.go
@@ -8,6 +8,9 @@ import (
"strings"
"time"
+ "github.com/google/cel-go/cel"
+ celast "github.com/google/cel-go/common/ast"
+ celoperators "github.com/google/cel-go/common/operators"
"github.com/google/go-cmp/cmp"
"github.com/google/uuid"
"github.com/pkg/errors"
@@ -914,58 +917,84 @@ func (s *PlanService) BatchCancelPlanCheckRuns(ctx context.Context, request *v1p
}
func (s *PlanService) buildPlanFindWithFilter(ctx context.Context, planFind *store.FindPlanMessage, filter string) error {
- filters, err := ParseFilter(filter)
- if err != nil {
- return errors.Wrap(err, "failed to parse filter")
+ if filter == "" {
+ return nil
}
- for _, spec := range filters {
- switch spec.Key {
- case "creator":
- if spec.Operator != ComparatorTypeEqual {
- return errors.New(`only support "=" operation for "creator" filter`)
- }
- user, err := s.getUserByIdentifier(ctx, spec.Value)
- if err != nil {
- return errors.Wrap(err, "failed to get user by identifier")
- }
- planFind.CreatorID = &user.ID
- case "create_time":
- if spec.Operator != ComparatorTypeGreaterEqual && spec.Operator != ComparatorTypeLessEqual {
- return errors.New(`only support ">=" and "<=" operation for "create_time" filter`)
- }
- t, err := time.Parse(time.RFC3339, spec.Value)
- if err != nil {
- return errors.Wrap(err, "failed to parse create_time value")
- }
- if spec.Operator == ComparatorTypeGreaterEqual {
- planFind.CreatedAtAfter = &t
- } else {
- planFind.CreatedAtBefore = &t
- }
- case "has_pipeline":
- if spec.Operator != ComparatorTypeEqual {
- return errors.New(`only support "=" operation for "has_pipeline" filter`)
- }
- switch spec.Value {
- case "false":
- planFind.NoPipeline = true
- case "true":
- default:
- return errors.Errorf("invalid value %q for has_pipeline", spec.Value)
- }
- case "has_issue":
- if spec.Operator != ComparatorTypeEqual {
- return errors.New(`only support "=" operation for "has_issue" filter`)
- }
- switch spec.Value {
- case "false":
- planFind.NoIssue = true
- case "true":
- default:
- return errors.Errorf("invalid value %q for has_issue", spec.Value)
+
+ e, err := cel.NewEnv()
+ if err != nil {
+ return status.Errorf(codes.Internal, "failed to create cel env")
+ }
+ ast, iss := e.Parse(filter)
+ if iss != nil {
+ return status.Errorf(codes.InvalidArgument, "failed to parse filter %v, error: %v", filter, iss.String())
+ }
+
+ var parseFilter func(expr celast.Expr) (string, error)
+ parseFilter = func(expr celast.Expr) (string, error) {
+ switch expr.Kind() {
+ case celast.CallKind:
+ functionName := expr.AsCall().FunctionName()
+ switch functionName {
+ case celoperators.LogicalAnd:
+ return getSubConditionFromExpr(expr, parseFilter, "AND")
+ case celoperators.Equals:
+ variable, value := getVariableAndValueFromExpr(expr)
+ switch variable {
+ case "creator":
+ user, err := s.getUserByIdentifier(ctx, value.(string))
+ if err != nil {
+ return "", status.Errorf(codes.Internal, "failed to get user %v with error %v", value, err.Error())
+ }
+ planFind.CreatorID = &user.ID
+ case "has_pipeline":
+ hasPipeline, ok := value.(bool)
+ if !ok {
+ return "", status.Errorf(codes.InvalidArgument, `"has_pipeline" should be bool`)
+ }
+ if !hasPipeline {
+ planFind.NoPipeline = true
+ }
+ case "has_issue":
+ hasIssue, ok := value.(bool)
+ if !ok {
+ return "", status.Errorf(codes.InvalidArgument, `"has_issue" should be bool`)
+ }
+ if !hasIssue {
+ planFind.NoIssue = true
+ }
+ default:
+ return "", status.Errorf(codes.InvalidArgument, "unsupport variable %q with %v operator", variable, celoperators.Equals)
+ }
+ case celoperators.GreaterEquals, celoperators.LessEquals:
+ variable, rawValue := getVariableAndValueFromExpr(expr)
+ value, ok := rawValue.(string)
+ if !ok {
+ return "", errors.Errorf("expect string, got %T, hint: filter literals should be string", rawValue)
+ }
+ if variable != "create_time" {
+ return "", errors.Errorf(`">=" and "<=" are only supported for "create_time"`)
+ }
+ t, err := time.Parse(time.RFC3339, value)
+ if err != nil {
+ return "", errors.Errorf("failed to parse time %v, error: %v", value, err)
+ }
+ if functionName == celoperators.GreaterEquals {
+ planFind.CreatedAtAfter = &t
+ } else {
+ planFind.CreatedAtBefore = &t
+ }
}
+ default:
+ return "", errors.Errorf("unexpected expr kind %v", expr.Kind())
}
+ return "", nil
+ }
+
+ if _, err := parseFilter(ast.NativeRep().Expr()); err != nil {
+ return status.Errorf(codes.InvalidArgument, "failed to parse filter, error: %v", err)
}
+
return nil
}
diff --git a/frontend/src/store/modules/v1/issue.ts b/frontend/src/store/modules/v1/issue.ts
index 1d27d16026..a1bc265434 100644
--- a/frontend/src/store/modules/v1/issue.ts
+++ b/frontend/src/store/modules/v1/issue.ts
@@ -24,20 +24,15 @@ export type ListIssueParams = {
export const buildIssueFilter = (find: IssueFilter): string => {
const filter: string[] = [];
- if (find.principal) {
- filter.push(`principal = "${find.principal}"`);
- }
if (find.creator) {
- filter.push(`creator = "${find.creator}"`);
+ filter.push(`creator == "${find.creator}"`);
}
if (find.subscriber) {
- filter.push(`subscriber = "${find.subscriber}"`);
+ filter.push(`subscriber == "${find.subscriber}"`);
}
- if (find.statusList) {
+ if (find.statusList && find.statusList.length > 0) {
filter.push(
- `status = "${find.statusList
- .map((s) => issueStatusToJSON(s))
- .join(" | ")}"`
+ `status in [${find.statusList.map((s) => `"${issueStatusToJSON(s)}"`).join(",")}]`
);
}
if (find.createdTsAfter) {
@@ -51,22 +46,22 @@ export const buildIssueFilter = (find: IssueFilter): string => {
);
}
if (find.type) {
- filter.push(`type = "${find.type}"`);
+ filter.push(`type == "${find.type}"`);
}
if (find.taskType) {
- filter.push(`task_type = "${find.taskType}"`);
+ filter.push(`task_type == "${find.taskType}"`);
}
if (find.instance) {
- filter.push(`instance = "${find.instance}"`);
+ filter.push(`instance == "${find.instance}"`);
}
if (find.database) {
- filter.push(`database = "${find.database}"`);
+ filter.push(`database == "${find.database}"`);
}
if (find.labels && find.labels.length > 0) {
- filter.push(`labels = "${find.labels.join(" & ")}"`);
+ filter.push(`labels in [${find.labels.map((l) => `"${l}"`).join(",")}]`);
}
if (find.hasPipeline !== undefined) {
- filter.push(`has_pipeline = "${find.hasPipeline}"`);
+ filter.push(`has_pipeline == "${find.hasPipeline}"`);
}
return filter.join(" && ");
};
diff --git a/frontend/src/store/modules/v1/plan.ts b/frontend/src/store/modules/v1/plan.ts
index aa12a8c060..2f99a71f8c 100644
--- a/frontend/src/store/modules/v1/plan.ts
+++ b/frontend/src/store/modules/v1/plan.ts
@@ -33,7 +33,7 @@ export interface PlanFind {
export const buildPlanFilter = (find: PlanFind): string => {
const filter: string[] = [];
if (find.creator) {
- filter.push(`creator = "${find.creator}"`);
+ filter.push(`creator == "${find.creator}"`);
}
if (find.createdTsAfter) {
filter.push(
@@ -46,10 +46,10 @@ export const buildPlanFilter = (find: PlanFind): string => {
);
}
if (find.hasIssue !== undefined) {
- filter.push(`has_issue = "${find.hasIssue}"`);
+ filter.push(`has_issue == "${find.hasIssue}"`);
}
if (find.hasPipeline !== undefined) {
- filter.push(`has_pipeline = "${find.hasPipeline}"`);
+ filter.push(`has_pipeline == "${find.hasPipeline}"`);
}
return filter.join(" && ");
};
diff --git a/frontend/src/types/proto/v1/audit_log_service.ts b/frontend/src/types/proto/v1/audit_log_service.ts
index 06b906bbdf..e4693a7ede 100644
--- a/frontend/src/types/proto/v1/audit_log_service.ts
+++ b/frontend/src/types/proto/v1/audit_log_service.ts
@@ -19,11 +19,13 @@ export interface SearchAuditLogsRequest {
parent: string;
/**
* The filter of the log. It should be a valid CEL expression.
+ * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ *
* Supported filter:
- * - method
- * - severity
- * - user
- * - create_time
+ * - method: the API name, can be found in the docs, should start with "/bytebase.v1." prefix. For example "/bytebase.v1.UserService/CreateUser". Support "==" operator.
+ * - severity: support "==" operator, check Severity enum in AuditLog message for values.
+ * - user: the actor, should in "users/{email}" format, support "==" operator.
+ * - create_time: support ">=" and "<=" operator.
*
* For example:
* - filter = "method == '/bytebase.v1.SQLService/Query'"
@@ -68,11 +70,7 @@ export interface ExportAuditLogsRequest {
parent: string;
/**
* The filter of the log. It should be a valid CEL expression.
- * For example:
- * - filter = "method == '/bytebase.v1.SQLService/Query'"
- * - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR'"
- * - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && user == 'users/[email protected]'"
- * - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && create_time <= '2021-01-01T00:00:00Z' && create_time >= '2020-01-01T00:00:00Z'"
+ * Check the filter field in the SearchAuditLogsRequest message.
*/
filter: string;
/**
diff --git a/frontend/src/types/proto/v1/database_service.ts b/frontend/src/types/proto/v1/database_service.ts
index ea141a5cdf..92758ab5aa 100644
--- a/frontend/src/types/proto/v1/database_service.ts
+++ b/frontend/src/types/proto/v1/database_service.ts
@@ -121,15 +121,17 @@ export interface ListDatabasesRequest {
pageToken: string;
/**
* Filter is used to filter databases returned in the list.
+ * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ *
* Supported filter:
- * - environment
- * - name
- * - project
- * - instance
- * - engine
- * - label
- * - exclude_unassigned: Not show unassigned databases if specified
- * - drifted
+ * - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ * - name: the database name, support ".matches()" operator.
+ * - project: the project full name in "projects/{id}" format, support "==" operator.
+ * - instance: the instance full name in "instances/{id}" format, support "==" operator.
+ * - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ * - label: the database label in "{key}:{value1},{value2}" format. Support "==" operator.
+ * - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
+ * - drifted: should be "true" or "false", show drifted databases if it's true, support "==" operator.
*
* For example:
* environment == "environments/{environment resource id}"
@@ -229,9 +231,11 @@ export interface GetDatabaseMetadataRequest {
name: string;
/**
* Filter is used to filter databases returned in the list.
+ * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ *
* Supported filter:
- * - schema
- * - table
+ * - schema: the schema name, support "==" operator.
+ * - table: the table name, support "==" operator.
*
* For example:
* schema == "schema-a"
diff --git a/frontend/src/types/proto/v1/iam_policy.ts b/frontend/src/types/proto/v1/iam_policy.ts
index fa844820fa..ef8ddc8002 100644
--- a/frontend/src/types/proto/v1/iam_policy.ts
+++ b/frontend/src/types/proto/v1/iam_policy.ts
@@ -68,9 +68,9 @@ export interface Binding {
* The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
*
* Support variables:
- * resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" and "roles/projectExporter" role.
- * resource.schema: the schema name, used by the "roles/sqlEditorUser" and "roles/projectExporter" role.
- * resource.table: the table name, used by the "roles/sqlEditorUser" and "roles/projectExporter" role.
+ * resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" and "roles/projectExporter" role, support "==" operator.
+ * resource.schema: the schema name, used by the "roles/sqlEditorUser" and "roles/projectExporter" role, support "==" operator.
+ * resource.table: the table name, used by the "roles/sqlEditorUser" and "roles/projectExporter" role, support "==" operator.
* request.time: the expiration. Only support "<" operation in `request.time < timestamp("{ISO datetime string format}")`.
* request.row_limit: the maximum export rows, used by the "roles/projectExporter" role. Only support "<=" operation.
*
diff --git a/frontend/src/types/proto/v1/instance_service.ts b/frontend/src/types/proto/v1/instance_service.ts
index 4fc406f47f..89cc0860ff 100644
--- a/frontend/src/types/proto/v1/instance_service.ts
+++ b/frontend/src/types/proto/v1/instance_service.ts
@@ -105,15 +105,17 @@ export interface ListInstancesRequest {
showDeleted: boolean;
/**
* Filter the instance.
+ * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ *
* Supported filters:
- * - name
- * - resource_id
- * - environment
- * - state
- * - engine
- * - host
- * - port
- * - project
+ * - name: the instance name, support "==" and ".matches()" operator.
+ * - resource_id: the instance id, support "==" and ".matches()" operator.
+ * - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ * - state: the instance state, check State enum for values, support "==" operator.
+ * - engine: the instance engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ * - host: the instance host, support "==" operator.
+ * - port: the instance port, support "==" operator.
+ * - project: the project full name in "projects/{id}" format, support "==" operator.
*
* For example:
* name == "sample instance"
diff --git a/frontend/src/types/proto/v1/issue_service.ts b/frontend/src/types/proto/v1/issue_service.ts
index 60a5406027..7e93749dca 100644
--- a/frontend/src/types/proto/v1/issue_service.ts
+++ b/frontend/src/types/proto/v1/issue_service.ts
@@ -115,7 +115,28 @@ export interface ListIssuesRequest {
* the call that provided the page token.
*/
pageToken: string;
- /** Filter is used to filter issues returned in the list. */
+ /**
+ * Filter is used to filter issues returned in the list.
+ * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ *
+ * Supported filters:
+ * - creator: issue creator full name in "users/{email or id}" format, support "==" operator.
+ * - subscriber: issue subscriber full name in "users/{email or id}" format, support "==" operator.
+ * - status: the issue status, support "==" and "in" operator, check the IssueStatus enum for the values.
+ * - create_time: issue create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
+ * - type: the issue type, support "==" and "in" operator, check the Type enum in the Issue message for the values.
+ * - task_type: support "==" operator, the value can be "DDL", "DML" or "DATA_EXPORT"
+ * - instance: the instance full name in the "instances/{id}" format, support "==" operator.
+ * - database: the database full name in the "instances/{id}/databases/{name}" format, support "==" operator.
+ * - labels: the issue labels, support "==" and "in" operator.
+ * - has_pipeline: the issue has pipeline or not, support "==" operator, the value should be "true" or "false".
+ *
+ * For example:
+ * creator == "users/[email protected]" && status in ["OPEN", "DONE"]
+ * status == "CANCELED" && type == "DATABASE_CHANGE"
+ * instance == "instances/sample" && labels in ["label1", "label2"]
+ * has_pipeline == true && create_time >= "2025-01-02T15:04:05Z07:00"
+ */
filter: string;
/** Query is the query statement. */
query: string;
@@ -153,7 +174,10 @@ export interface SearchIssuesRequest {
* the call that provided the page token.
*/
pageToken: string;
- /** Filter is used to filter issues returned in the list. */
+ /**
+ * Filter is used to filter issues returned in the list.
+ * Check the filter field in the ListIssuesRequest message.
+ */
filter: string;
/** Query is the query statement. */
query: string;
diff --git a/frontend/src/types/proto/v1/plan_service.ts b/frontend/src/types/proto/v1/plan_service.ts
index 1f8930e472..9b56f1ba69 100644
--- a/frontend/src/types/proto/v1/plan_service.ts
+++ b/frontend/src/types/proto/v1/plan_service.ts
@@ -78,7 +78,20 @@ export interface SearchPlansRequest {
* the call that provided the page token.
*/
pageToken: string;
- /** Filter is used to filter plans returned in the list. */
+ /**
+ * Filter is used to filter plans returned in the list.
+ * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ *
+ * Supported filters:
+ * - creator: the plan creator full name in "users/{email or id}" format, support "==" operator.
+ * - create_time: issue create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
+ * - has_pipeline: the plan has pipeline or not, support "==" operator, the value should be "true" or "false".
+ * - has_issue: the plan has issue or not, support "==" operator, the value should be "true" or "false".
+ *
+ * For example:
+ * creator == "users/[email protected]" && create_time >= "2025-01-02T15:04:05Z07:00"
+ * has_pipeline == false && has_issue == true
+ */
filter: string;
}
diff --git a/frontend/src/types/proto/v1/project_service.ts b/frontend/src/types/proto/v1/project_service.ts
index a2896caaf7..0d8c178397 100644
--- a/frontend/src/types/proto/v1/project_service.ts
+++ b/frontend/src/types/proto/v1/project_service.ts
@@ -62,11 +62,13 @@ export interface SearchProjectsRequest {
showDeleted: boolean;
/**
* Filter the project.
+ * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ *
* Supported filters:
- * - name
- * - resource_id
- * - exclude_default: if not include the default project.
- * - state
+ * - name: the project name, support "==" and ".matches()" operator.
+ * - resource_id: the project id, support "==" and ".matches()" operator.
+ * - exclude_default: if not include the default project, should be "true" or "false", support "==" operator.
+ * - state: check the State enum for the values, support "==" operator.
*
* For example:
* name = "project name"
diff --git a/frontend/src/types/proto/v1/setting_service.ts b/frontend/src/types/proto/v1/setting_service.ts
index 380a95b039..c9229bfbc4 100644
--- a/frontend/src/types/proto/v1/setting_service.ts
+++ b/frontend/src/types/proto/v1/setting_service.ts
@@ -493,8 +493,8 @@ export interface WorkspaceApprovalSetting_Rule {
* The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
*
* Support variables:
- * source: the risk source, check the Source enum in the Risk message for the values.
- * level: the risk level, support 100 (low), 200 (moderate) and 300 (high).
+ * source: the risk source, check the Source enum in the Risk message for the values, support "==" operator.
+ * level: the risk level, support 100 (low), 200 (moderate) and 300 (high), support "==" operator.
*
* For examples:
* (source == "DML" && level == 200) || (source == "DDL" && level == 300)
diff --git a/frontend/src/types/proto/v1/sql_service.ts b/frontend/src/types/proto/v1/sql_service.ts
index 01a425a55d..2b297f2317 100644
--- a/frontend/src/types/proto/v1/sql_service.ts
+++ b/frontend/src/types/proto/v1/sql_service.ts
@@ -634,12 +634,14 @@ export interface SearchQueryHistoriesRequest {
pageToken: string;
/**
* Filter is the filter to apply on the search query history
+ * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ *
* Supported filter:
- * - project
- * - database
- * - instance
- * - type
- * - statement
+ * - project: the project full name in "projects/{id}" format, support "==" operator.
+ * - database: the database full name in "instances/{id}/databases/{name}" format, support "==" operator.
+ * - instance: the instance full name in "instances/{id}" format, support "==" operator.
+ * - type: the type, should be "QUERY" or "EXPORT", support "==" operator.
+ * - statement: the SQL statemnt, support ".matches()" operator.
*
* For example:
* project == "projects/{project}"
diff --git a/frontend/src/types/proto/v1/user_service.ts b/frontend/src/types/proto/v1/user_service.ts
index e3c55438be..afbe394f9b 100644
--- a/frontend/src/types/proto/v1/user_service.ts
+++ b/frontend/src/types/proto/v1/user_service.ts
@@ -103,12 +103,14 @@ export interface ListUsersRequest {
showDeleted: boolean;
/**
* Filter is used to filter users returned in the list.
+ * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ *
* Supported filter:
- * - name
- * - email
- * - user_type
- * - state
- * - project
+ * - name: the user name, support "==" and ".matches()" operator.
+ * - email: the user email, support "==" and ".matches()" operator.
+ * - user_type: the type, check UserType enum for values, support "==", "in [xx]", "!(in [xx])" operator.
+ * - state: check State enum for values, support "==" operator.
+ * - project: the project full name in "projects/{id}" format, support "==" operator.
*
* For example:
* name == "ed"
diff --git a/frontend/src/types/proto/v1/worksheet_service.ts b/frontend/src/types/proto/v1/worksheet_service.ts
index 1474b31954..131335e509 100644
--- a/frontend/src/types/proto/v1/worksheet_service.ts
+++ b/frontend/src/types/proto/v1/worksheet_service.ts
@@ -89,10 +89,12 @@ export interface DeleteWorksheetRequest {
export interface SearchWorksheetsRequest {
/**
* To filter the search result.
+ * The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ *
* Supported filter:
- * - creator
- * - starred
- * - visibility
+ * - creator: the worksheet creator in "users/{email}" format, support "==" and "!=" operator.
+ * - starred: should be "true" or "false", filter starred/unstarred sheets, support "==" operator.
+ * - visibility: check Visibility enum in the Worksheet message for values, support "==" and "in [xx]" operator.
*
* For example:
* creator == "users/{email}"
diff --git a/frontend/src/types/v1/issue/issue.ts b/frontend/src/types/v1/issue/issue.ts
index f67b93b056..a1d3ba382d 100644
--- a/frontend/src/types/v1/issue/issue.ts
+++ b/frontend/src/types/v1/issue/issue.ts
@@ -10,9 +10,9 @@ import {
UNKNOWN_ROLLOUT_NAME,
} from "@/types";
import type { Rollout } from "@/types//proto/v1/rollout_service";
-import { type User } from "@/types/proto/v1/user_service";
import { Issue, IssueStatus, Issue_Type } from "@/types/proto/v1/issue_service";
import type { Plan, PlanCheckRun } from "@/types/proto/v1/plan_service";
+import { type User } from "@/types/proto/v1/user_service";
import { EMPTY_ID, UNKNOWN_ID } from "../../const";
// For grant request issue, it has no plan and rollout.
@@ -74,7 +74,6 @@ export interface IssueFilter {
instance?: string;
database?: string;
query: string;
- principal?: string;
creator?: string;
subscriber?: string;
statusList?: IssueStatus[];
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 6878f222f1..1b5678936c 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -884,15 +884,17 @@ paths:
in: query
description: |-
Filter the instance.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
Supported filters:
- - name
- - resource_id
- - environment
- - state
- - engine
- - host
- - port
- - project
+ - name: the instance name, support "==" and ".matches()" operator.
+ - resource_id: the instance id, support "==" and ".matches()" operator.
+ - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ - state: the instance state, check State enum for values, support "==" operator.
+ - engine: the instance engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ - host: the instance host, support "==" operator.
+ - port: the instance port, support "==" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
For example:
name == "sample instance"
@@ -1087,15 +1089,17 @@ paths:
in: query
description: |-
Filter is used to filter databases returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
Supported filter:
- - environment
- - name
- - project
- - instance
- - engine
- - label
- - exclude_unassigned: Not show unassigned databases if specified
- - drifted
+ - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ - name: the database name, support ".matches()" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+ - instance: the instance full name in "instances/{id}" format, support "==" operator.
+ - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ - label: the database label in "{key}:{value1},{value2}" format. Support "==" operator.
+ - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
+ - drifted: should be "true" or "false", show drifted databases if it's true, support "==" operator.
For example:
environment == "environments/{environment resource id}"
@@ -1482,9 +1486,11 @@ paths:
in: query
description: |-
Filter is used to filter databases returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
Supported filter:
- - schema
- - table
+ - schema: the schema name, support "==" operator.
+ - table: the table name, support "==" operator.
For example:
schema == "schema-a"
@@ -3858,15 +3864,17 @@ paths:
in: query
description: |-
Filter is used to filter databases returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
Supported filter:
- - environment
- - name
- - project
- - instance
- - engine
- - label
- - exclude_unassigned: Not show unassigned databases if specified
- - drifted
+ - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ - name: the database name, support ".matches()" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+ - instance: the instance full name in "instances/{id}" format, support "==" operator.
+ - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ - label: the database label in "{key}:{value1},{value2}" format. Support "==" operator.
+ - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
+ - drifted: should be "true" or "false", show drifted databases if it's true, support "==" operator.
For example:
environment == "environments/{environment resource id}"
@@ -3969,7 +3977,27 @@ paths:
type: string
- name: filter
in: query
- description: Filter is used to filter issues returned in the list.
+ description: |-
+ Filter is used to filter issues returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filters:
+ - creator: issue creator full name in "users/{email or id}" format, support "==" operator.
+ - subscriber: issue subscriber full name in "users/{email or id}" format, support "==" operator.
+ - status: the issue status, support "==" and "in" operator, check the IssueStatus enum for the values.
+ - create_time: issue create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
+ - type: the issue type, support "==" and "in" operator, check the Type enum in the Issue message for the values.
+ - task_type: support "==" operator, the value can be "DDL", "DML" or "DATA_EXPORT"
+ - instance: the instance full name in the "instances/{id}" format, support "==" operator.
+ - database: the database full name in the "instances/{id}/databases/{name}" format, support "==" operator.
+ - labels: the issue labels, support "==" and "in" operator.
+ - has_pipeline: the issue has pipeline or not, support "==" operator, the value should be "true" or "false".
+
+ For example:
+ creator == "users/[email protected]" && status in ["OPEN", "DONE"]
+ status == "CANCELED" && type == "DATABASE_CHANGE"
+ instance == "instances/sample" && labels in ["label1", "label2"]
+ has_pipeline == true && create_time >= "2025-01-02T15:04:05Z07:00"
schema:
type: string
- name: query
@@ -6987,12 +7015,14 @@ paths:
in: query
description: |-
Filter is used to filter users returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
Supported filter:
- - name
- - email
- - user_type
- - state
- - project
+ - name: the user name, support "==" and ".matches()" operator.
+ - email: the user email, support "==" and ".matches()" operator.
+ - user_type: the type, check UserType enum for values, support "==", "in [xx]", "!(in [xx])" operator.
+ - state: check State enum for values, support "==" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
For example:
name == "ed"
@@ -7444,15 +7474,17 @@ paths:
in: query
description: |-
Filter is used to filter databases returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
Supported filter:
- - environment
- - name
- - project
- - instance
- - engine
- - label
- - exclude_unassigned: Not show unassigned databases if specified
- - drifted
+ - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ - name: the database name, support ".matches()" operator.
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+ - instance: the instance full name in "instances/{id}" format, support "==" operator.
+ - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ - label: the database label in "{key}:{value1},{value2}" format. Support "==" operator.
+ - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
+ - drifted: should be "true" or "false", show drifted databases if it's true, support "==" operator.
For example:
environment == "environments/{environment resource id}"
@@ -8354,9 +8386,9 @@ components:
The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
Support variables:
- resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" and "roles/projectExporter" role.
- resource.schema: the schema name, used by the "roles/sqlEditorUser" and "roles/projectExporter" role.
- resource.table: the table name, used by the "roles/sqlEditorUser" and "roles/projectExporter" role.
+ resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" and "roles/projectExporter" role, support "==" operator.
+ resource.schema: the schema name, used by the "roles/sqlEditorUser" and "roles/projectExporter" role, support "==" operator.
+ resource.table: the table name, used by the "roles/sqlEditorUser" and "roles/projectExporter" role, support "==" operator.
request.time: the expiration. Only support "<" operation in `request.time < timestamp("{ISO datetime string format}")`.
request.row_limit: the maximum export rows, used by the "roles/projectExporter" role. Only support "<=" operation.
@@ -9339,11 +9371,7 @@ components:
type: string
description: |-
The filter of the log. It should be a valid CEL expression.
- For example:
- - filter = "method == '/bytebase.v1.SQLService/Query'"
- - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR'"
- - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && user == 'users/[email protected]'"
- - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && create_time <= '2021-01-01T00:00:00Z' && create_time >= '2020-01-01T00:00:00Z'"
+ Check the filter field in the SearchAuditLogsRequest message.
orderBy:
type: string
description: |-
@@ -12499,11 +12527,13 @@ components:
type: string
description: |-
The filter of the log. It should be a valid CEL expression.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
Supported filter:
- - method
- - severity
- - user
- - create_time
+ - method: the API name, can be found in the docs, should start with "/bytebase.v1." prefix. For example "/bytebase.v1.UserService/CreateUser". Support "==" operator.
+ - severity: support "==" operator, check Severity enum in AuditLog message for values.
+ - user: the actor, should in "users/{email}" format, support "==" operator.
+ - create_time: support ">=" and "<=" operator.
For example:
- filter = "method == '/bytebase.v1.SQLService/Query'"
@@ -12573,7 +12603,9 @@ components:
the call that provided the page token.
filter:
type: string
- description: Filter is used to filter issues returned in the list.
+ description: |-
+ Filter is used to filter issues returned in the list.
+ Check the filter field in the ListIssuesRequest message.
query:
type: string
description: Query is the query statement.
@@ -12619,7 +12651,19 @@ components:
the call that provided the page token.
filter:
type: string
- description: Filter is used to filter plans returned in the list.
+ description: |-
+ Filter is used to filter plans returned in the list.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filters:
+ - creator: the plan creator full name in "users/{email or id}" format, support "==" operator.
+ - create_time: issue create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
+ - has_pipeline: the plan has pipeline or not, support "==" operator, the value should be "true" or "false".
+ - has_issue: the plan has issue or not, support "==" operator, the value should be "true" or "false".
+
+ For example:
+ creator == "users/[email protected]" && create_time >= "2025-01-02T15:04:05Z07:00"
+ has_pipeline == false && has_issue == true
SearchPlansResponse:
type: object
properties:
@@ -12643,11 +12687,13 @@ components:
type: string
description: |-
Filter the project.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
Supported filters:
- - name
- - resource_id
- - exclude_default: if not include the default project.
- - state
+ - name: the project name, support "==" and ".matches()" operator.
+ - resource_id: the project id, support "==" and ".matches()" operator.
+ - exclude_default: if not include the default project, should be "true" or "false", support "==" operator.
+ - state: check the State enum for the values, support "==" operator.
For example:
name = "project name"
@@ -12708,12 +12754,14 @@ components:
type: string
description: |-
Filter is the filter to apply on the search query history
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
Supported filter:
- - project
- - database
- - instance
- - type
- - statement
+ - project: the project full name in "projects/{id}" format, support "==" operator.
+ - database: the database full name in "instances/{id}/databases/{name}" format, support "==" operator.
+ - instance: the instance full name in "instances/{id}" format, support "==" operator.
+ - type: the type, should be "QUERY" or "EXPORT", support "==" operator.
+ - statement: the SQL statemnt, support ".matches()" operator.
For example:
project == "projects/{project}"
@@ -12745,10 +12793,12 @@ components:
type: string
description: |-
To filter the search result.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
Supported filter:
- - creator
- - starred
- - visibility
+ - creator: the worksheet creator in "users/{email}" format, support "==" and "!=" operator.
+ - starred: should be "true" or "false", filter starred/unstarred sheets, support "==" operator.
+ - visibility: check Visibility enum in the Worksheet message for values, support "==" and "in [xx]" operator.
For example:
creator == "users/{email}"
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 4b8d8426c2..8fe021539d 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -1560,7 +1560,9 @@ This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. |
When paginating, all other parameters provided to `ListInstances` must match the call that provided the page token. |
| show_deleted | [bool](#bool) | | Show deleted instances if specified. |
-| filter | [string](#string) | | Filter the instance. Supported filters: - name - resource_id - environment - state - engine - host - port - project
+| filter | [string](#string) | | Filter the instance. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+Supported filters: - name: the instance name, support &#34;==&#34; and &#34;.matches()&#34; operator. - resource_id: the instance id, support &#34;==&#34; and &#34;.matches()&#34; operator. - environment: the environment full name in &#34;environments/{id}&#34; format, support &#34;==&#34; operator. - state: the instance state, check State enum for values, support &#34;==&#34; operator. - engine: the instance engine, check Engine enum for values. Support &#34;==&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34; operator. - host: the instance host, support &#34;==&#34; operator. - port: the instance port, support &#34;==&#34; operator. - project: the project full name in &#34;projects/{id}&#34; format, support &#34;==&#34; operator.
For example: name == &#34;sample instance&#34; name.matches(&#34;sample&#34;) resource_id = &#34;sample-instance&#34; resource_id.matches(&#34;sample&#34;) state == &#34;DELETED&#34; environment == &#34;environments/test&#34; engine == &#34;MYSQL&#34; engine in [&#34;MYSQL&#34;, &#34;POSTGRES&#34;] !(engine in [&#34;MYSQL&#34;, &#34;POSTGRES&#34;]) host == &#34;127.0.0.1&#34; port == &#34;54321&#34; project == &#34;projects/sample-project&#34; You can combine filter conditions like: name.matches(&#34;sample&#34;) &amp;&amp; environment == &#34;environments/test&#34; host == &#34;127.0.0.1&#34; &amp;&amp; port == &#34;54321&#34; |
@@ -2450,7 +2452,9 @@ FunctionMetadata is the metadata for functions.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| name | [string](#string) | | The name of the database to retrieve metadata. Format: instances/{instance}/databases/{database}/metadata |
-| filter | [string](#string) | | Filter is used to filter databases returned in the list. Supported filter: - schema - table
+| filter | [string](#string) | | Filter is used to filter databases returned in the list. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+Supported filter: - schema: the schema name, support &#34;==&#34; operator. - table: the table name, support &#34;==&#34; operator.
For example: schema == &#34;schema-a&#34; table == &#34;table-a&#34; schema == &#34;schema-a&#34; &amp;&amp; table == &#34;table-a&#34; The filter used for a specific schema object such as &#34;schemas/schema-a/tables/table-a&#34;. The column masking level will only be returned when a table filter is used. |
@@ -2623,7 +2627,9 @@ Combine multiple functions with &#34;&amp;&amp;&#34; and &#34;||&#34;, we MUST u
| 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 - drifted
+| filter | [string](#string) | | Filter is used to filter databases returned in the list. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+Supported filter: - environment: the environment full name in &#34;environments/{id}&#34; format, support &#34;==&#34; operator. - name: the database name, support &#34;.matches()&#34; operator. - project: the project full name in &#34;projects/{id}&#34; format, support &#34;==&#34; operator. - instance: the instance full name in &#34;instances/{id}&#34; format, support &#34;==&#34; operator. - engine: the database engine, check Engine enum for values. Support &#34;==&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34; operator. - label: the database label in &#34;{key}:{value1},{value2}&#34; format. Support &#34;==&#34; operator. - exclude_unassigned: should be &#34;true&#34; or &#34;false&#34;, will not show unassigned databases if it&#39;s true, support &#34;==&#34; operator. - drifted: should be &#34;true&#34; or &#34;false&#34;, show drifted databases if it&#39;s true, support &#34;==&#34; operator.
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 drifted == true You can combine filter conditions like: environment == &#34;environments/prod&#34; &amp;&amp; name.matches(&#34;employee&#34;) |
| show_deleted | [bool](#bool) | | Show deleted database if specified. |
@@ -3707,7 +3713,11 @@ When paginating, all other parameters provided to `ListIssueComments` must match
| page_token | [string](#string) | | A page token, received from a previous `ListIssues` call. Provide this to retrieve the subsequent page.
When paginating, all other parameters provided to `ListIssues` must match the call that provided the page token. |
-| filter | [string](#string) | | Filter is used to filter issues returned in the list. |
+| filter | [string](#string) | | Filter is used to filter issues returned in the list. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+Supported filters: - creator: issue creator full name in &#34;users/{email or id}&#34; format, support &#34;==&#34; operator. - subscriber: issue subscriber full name in &#34;users/{email or id}&#34; format, support &#34;==&#34; operator. - status: the issue status, support &#34;==&#34; and &#34;in&#34; operator, check the IssueStatus enum for the values. - create_time: issue create time in &#34;2006-01-02T15:04:05Z07:00&#34; format, support &#34;&gt;=&#34; or &#34;&lt;=&#34; operator. - type: the issue type, support &#34;==&#34; and &#34;in&#34; operator, check the Type enum in the Issue message for the values. - task_type: support &#34;==&#34; operator, the value can be &#34;DDL&#34;, &#34;DML&#34; or &#34;DATA_EXPORT&#34; - instance: the instance full name in the &#34;instances/{id}&#34; format, support &#34;==&#34; operator. - database: the database full name in the &#34;instances/{id}/databases/{name}&#34; format, support &#34;==&#34; operator. - labels: the issue labels, support &#34;==&#34; and &#34;in&#34; operator. - has_pipeline: the issue has pipeline or not, support &#34;==&#34; operator, the value should be &#34;true&#34; or &#34;false&#34;.
+
+For example: creator == &#34;users/[email protected]&#34; &amp;&amp; status in [&#34;OPEN&#34;, &#34;DONE&#34;] status == &#34;CANCELED&#34; &amp;&amp; type == &#34;DATABASE_CHANGE&#34; instance == &#34;instances/sample&#34; &amp;&amp; labels in [&#34;label1&#34;, &#34;label2&#34;] has_pipeline == true &amp;&amp; create_time &gt;= &#34;2025-01-02T15:04:05Z07:00&#34; |
| query | [string](#string) | | Query is the query statement. |
@@ -3776,7 +3786,7 @@ When paginating, all other parameters provided to `ListIssues` must match the ca
| page_token | [string](#string) | | A page token, received from a previous `SearchIssues` call. Provide this to retrieve the subsequent page.
When paginating, all other parameters provided to `SearchIssues` must match the call that provided the page token. |
-| filter | [string](#string) | | Filter is used to filter issues returned in the list. |
+| filter | [string](#string) | | Filter is used to filter issues returned in the list. Check the filter field in the ListIssuesRequest message. |
| query | [string](#string) | | Query is the query statement. |
@@ -4877,7 +4887,7 @@ The data in setting value.
| template | [ApprovalTemplate](#bytebase-v1-ApprovalTemplate) | | |
| condition | [google.type.Expr](#google-type-Expr) | | The condition that is associated with the rule. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
-Support variables: source: the risk source, check the Source enum in the Risk message for the values. level: the risk level, support 100 (low), 200 (moderate) and 300 (high).
+Support variables: source: the risk source, check the Source enum in the Risk message for the values, support &#34;==&#34; operator. level: the risk level, support 100 (low), 200 (moderate) and 300 (high), support &#34;==&#34; operator.
For examples: (source == &#34;DML&#34; &amp;&amp; level == 200) || (source == &#34;DDL&#34; &amp;&amp; level == 300) |
@@ -5101,7 +5111,9 @@ We support three types of SMTP encryption: NONE, STARTTLS, and SSL/TLS.
When paginating, all other parameters provided to `ListUsers` must match the call that provided the page token. |
| show_deleted | [bool](#bool) | | Show deleted users if specified. |
-| filter | [string](#string) | | Filter is used to filter users returned in the list. Supported filter: - name - email - user_type - state - project
+| filter | [string](#string) | | Filter is used to filter users returned in the list. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+Supported filter: - name: the user name, support &#34;==&#34; and &#34;.matches()&#34; operator. - email: the user email, support &#34;==&#34; and &#34;.matches()&#34; operator. - user_type: the type, check UserType enum for values, support &#34;==&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34; operator. - state: check State enum for values, support &#34;==&#34; operator. - project: the project full name in &#34;projects/{id}&#34; format, support &#34;==&#34; operator.
For example: name == &#34;ed&#34; name.matches(&#34;ed&#34;) email == &#34;[email protected]&#34; email.matches(&#34;ed&#34;) user_type == &#34;SERVICE_ACCOUNT&#34; user_type in [&#34;SERVICE_ACCOUNT&#34;, &#34;USER&#34;] !(user_type in [&#34;SERVICE_ACCOUNT&#34;, &#34;USER&#34;]) state == &#34;DELETED&#34; project == &#34;projects/sample-project&#34; You can combine filter conditions like: name.matches(&#34;ed&#34;) &amp;&amp; project == &#34;projects/sample-project&#34; (name == &#34;ed&#34; || email == &#34;[email protected]&#34;) &amp;&amp; project == &#34;projects/sample-project&#34; |
@@ -5406,7 +5418,7 @@ The theme resources.
| members | [string](#string) | repeated | Specifies the principals requesting access for a Bytebase resource. For users, the member should be: user:{email} For groups, the member should be: group:{email} |
| condition | [google.type.Expr](#google-type-Expr) | | The condition that is associated with this binding, only used in the project IAM policy. If the condition evaluates to true, then this binding applies to the current request. If the condition evaluates to false, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
-Support variables: resource.database: the database full name in &#34;instances/{instance}/databases/{database}&#34; format, used by the &#34;roles/sqlEditorUser&#34; and &#34;roles/projectExporter&#34; role. resource.schema: the schema name, used by the &#34;roles/sqlEditorUser&#34; and &#34;roles/projectExporter&#34; role. resource.table: the table name, used by the &#34;roles/sqlEditorUser&#34; and &#34;roles/projectExporter&#34; role. request.time: the expiration. Only support &#34;&lt;&#34; operation in `request.time &lt; timestamp(&#34;{ISO datetime string format}&#34;)`. request.row_limit: the maximum export rows, used by the &#34;roles/projectExporter&#34; role. Only support &#34;&lt;=&#34; operation.
+Support variables: resource.database: the database full name in &#34;instances/{instance}/databases/{database}&#34; format, used by the &#34;roles/sqlEditorUser&#34; and &#34;roles/projectExporter&#34; role, support &#34;==&#34; operator. resource.schema: the schema name, used by the &#34;roles/sqlEditorUser&#34; and &#34;roles/projectExporter&#34; role, support &#34;==&#34; operator. resource.table: the table name, used by the &#34;roles/sqlEditorUser&#34; and &#34;roles/projectExporter&#34; role, support &#34;==&#34; operator. request.time: the expiration. Only support &#34;&lt;&#34; operation in `request.time &lt; timestamp(&#34;{ISO datetime string format}&#34;)`. request.row_limit: the maximum export rows, used by the &#34;roles/projectExporter&#34; role. Only support &#34;&lt;=&#34; operation.
For example: resource.database == &#34;instances/local-pg/databases/postgres&#34; &amp;&amp; resource.schema in [&#34;public&#34;,&#34;another_schema&#34;] resource.database == &#34;instances/local-pg/databases/bytebase&#34; &amp;&amp; resource.schema == &#34;public&#34; &amp;&amp; resource.table in [&#34;audit_log&#34;] request.time &lt; timestamp(&#34;2025-04-26T11:24:48.655Z&#34;) &amp;&amp; request.row_limit &lt;= 1000 |
| parsed_expr | [google.api.expr.v1alpha1.Expr](#google-api-expr-v1alpha1-Expr) | | The parsed expression of the condition. |
@@ -5576,7 +5588,7 @@ The type of action performed on a Binding in a policy.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| parent | [string](#string) | | |
-| filter | [string](#string) | | The filter of the log. It should be a valid CEL expression. For example: - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39;&#34; - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39; &amp;&amp; severity == &#39;ERROR&#39;&#34; - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39; &amp;&amp; severity == &#39;ERROR&#39; &amp;&amp; user == &#39;users/[email protected]&#39;&#34; - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39; &amp;&amp; severity == &#39;ERROR&#39; &amp;&amp; create_time &lt;= &#39;2021-01-01T00:00:00Z&#39; &amp;&amp; create_time &gt;= &#39;2020-01-01T00:00:00Z&#39;&#34; |
+| filter | [string](#string) | | The filter of the log. It should be a valid CEL expression. Check the filter field in the SearchAuditLogsRequest message. |
| order_by | [string](#string) | | The order by of the log. Only support order by create_time. For example: - order_by = &#34;create_time asc&#34; - order_by = &#34;create_time desc&#34; |
| format | [ExportFormat](#bytebase-v1-ExportFormat) | | The export format. |
| page_size | [int32](#int32) | | The maximum number of logs to return. The service may return fewer than this value. If unspecified, at most 10 log entries will be returned. The maximum value is 5000; values above 5000 will be coerced to 5000. |
@@ -5628,7 +5640,9 @@ Metadata about the request.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| parent | [string](#string) | | |
-| filter | [string](#string) | | The filter of the log. It should be a valid CEL expression. Supported filter: - method - severity - user - create_time
+| filter | [string](#string) | | The filter of the log. It should be a valid CEL expression. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+Supported filter: - method: the API name, can be found in the docs, should start with &#34;/bytebase.v1.&#34; prefix. For example &#34;/bytebase.v1.UserService/CreateUser&#34;. Support &#34;==&#34; operator. - severity: support &#34;==&#34; operator, check Severity enum in AuditLog message for values. - user: the actor, should in &#34;users/{email}&#34; format, support &#34;==&#34; operator. - create_time: support &#34;&gt;=&#34; and &#34;&lt;=&#34; operator.
For example: - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39;&#34; - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39; &amp;&amp; severity == &#39;ERROR&#39;&#34; - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39; &amp;&amp; severity == &#39;ERROR&#39; &amp;&amp; user == &#39;users/[email protected]&#39;&#34; - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39; &amp;&amp; severity == &#39;ERROR&#39; &amp;&amp; create_time &lt;= &#39;2021-01-01T00:00:00Z&#39; &amp;&amp; create_time &gt;= &#39;2020-01-01T00:00:00Z&#39;&#34; |
| order_by | [string](#string) | | The order by of the log. Only support order by create_time. For example: - order_by = &#34;create_time asc&#34; - order_by = &#34;create_time desc&#34; |
@@ -7740,7 +7754,11 @@ When paginating, all other parameters provided to `ListPlans` must match the cal
| page_token | [string](#string) | | A page token, received from a previous `SearchPlans` call. Provide this to retrieve the subsequent page.
When paginating, all other parameters provided to `SearchPlans` must match the call that provided the page token. |
-| filter | [string](#string) | | Filter is used to filter plans returned in the list. |
+| filter | [string](#string) | | Filter is used to filter plans returned in the list. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+Supported filters: - creator: the plan creator full name in &#34;users/{email or id}&#34; format, support &#34;==&#34; operator. - create_time: issue create time in &#34;2006-01-02T15:04:05Z07:00&#34; format, support &#34;&gt;=&#34; or &#34;&lt;=&#34; operator. - has_pipeline: the plan has pipeline or not, support &#34;==&#34; operator, the value should be &#34;true&#34; or &#34;false&#34;. - has_issue: the plan has issue or not, support &#34;==&#34; operator, the value should be &#34;true&#34; or &#34;false&#34;.
+
+For example: creator == &#34;users/[email protected]&#34; &amp;&amp; create_time &gt;= &#34;2025-01-02T15:04:05Z07:00&#34; has_pipeline == false &amp;&amp; has_issue == true |
@@ -8120,7 +8138,9 @@ When paginating, all other parameters provided to `ListProjects` must match the
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| show_deleted | [bool](#bool) | | Show deleted projects if specified. |
-| filter | [string](#string) | | Filter the project. Supported filters: - name - resource_id - exclude_default: if not include the default project. - state
+| filter | [string](#string) | | Filter the project. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+Supported filters: - name: the project name, support &#34;==&#34; and &#34;.matches()&#34; operator. - resource_id: the project id, support &#34;==&#34; and &#34;.matches()&#34; operator. - exclude_default: if not include the default project, should be &#34;true&#34; or &#34;false&#34;, support &#34;==&#34; operator. - state: check the State enum for the values, support &#34;==&#34; operator.
For example: name = &#34;project name&#34; name.matches(&#34;project name&#34;) resource_id = &#34;project id&#34; resource_id.matches(&#34;project id&#34;) exclude_default == true state == &#34;DELETED&#34; You can combine filter conditions like: name = &#34;project name&#34; &amp;&amp; resource_id.matches(&#34;project id&#34;) name.matches(&#34;project name&#34;) || resource_id = &#34;project id&#34; |
| page_size | [int32](#int32) | | The maximum number of projects to return. The service may return fewer than this value. If unspecified, at most 10 projects will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |
@@ -8892,7 +8912,9 @@ 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 Supported filter: - project - database - instance - type - statement
+| filter | [string](#string) | | Filter is the filter to apply on the search query history The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+Supported filter: - project: the project full name in &#34;projects/{id}&#34; format, support &#34;==&#34; operator. - database: the database full name in &#34;instances/{id}/databases/{name}&#34; format, support &#34;==&#34; operator. - instance: the instance full name in &#34;instances/{id}&#34; format, support &#34;==&#34; operator. - type: the type, should be &#34;QUERY&#34; or &#34;EXPORT&#34;, support &#34;==&#34; operator. - statement: the SQL statemnt, support &#34;.matches()&#34; operator.
For example: project == &#34;projects/{project}&#34; database == &#34;instances/{instance}/databases/{database}&#34; instance == &#34;instances/{instance}&#34; type == &#34;QUERY&#34; type == &#34;EXPORT&#34; statement.matches(&#34;select&#34;) type == &#34;QUERY&#34; &amp;&amp; statement.matches(&#34;select&#34;) |
@@ -10952,7 +10974,9 @@ Type of the SheetPayload.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| filter | [string](#string) | | To filter the search result. Supported filter: - creator - starred - visibility
+| filter | [string](#string) | | To filter the search result. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+Supported filter: - creator: the worksheet creator in &#34;users/{email}&#34; format, support &#34;==&#34; and &#34;!=&#34; operator. - starred: should be &#34;true&#34; or &#34;false&#34;, filter starred/unstarred sheets, support &#34;==&#34; operator. - visibility: check Visibility enum in the Worksheet message for values, support &#34;==&#34; and &#34;in [xx]&#34; operator.
For example: creator == &#34;users/{email}&#34; creator != &#34;users/{email}&#34; starred == true starred == false visibility in [&#34;VISIBILITY_PRIVATE&#34;, &#34;VISIBILITY_PROJECT_READ&#34;, &#34;VISIBILITY_PROJECT_WRITE&#34;] visibility == &#34;VISIBILITY_PRIVATE&#34; |
| page_size | [int32](#int32) | | Not used. The maximum number of worksheets to return. The service may return fewer than this value. If unspecified, at most 10 worksheets will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 0dafa908d6..d4f5e89d8f 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -5087,15 +5087,17 @@ the call that provided the page token. </p></td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>Filter the instance.
+The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
Supported filters:
-- name
-- resource_id
-- environment
-- state
-- engine
-- host
-- port
-- project
+- name: the instance name, support &#34;==&#34; and &#34;.matches()&#34; operator.
+- resource_id: the instance id, support &#34;==&#34; and &#34;.matches()&#34; operator.
+- environment: the environment full name in &#34;environments/{id}&#34; format, support &#34;==&#34; operator.
+- state: the instance state, check State enum for values, support &#34;==&#34; operator.
+- engine: the instance engine, check Engine enum for values. Support &#34;==&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34; operator.
+- host: the instance host, support &#34;==&#34; operator.
+- port: the instance port, support &#34;==&#34; operator.
+- project: the project full name in &#34;projects/{id}&#34; format, support &#34;==&#34; operator.
For example:
name == &#34;sample instance&#34;
@@ -7417,9 +7419,11 @@ Format: instances/{instance}/databases/{database}/metadata </p></td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>Filter is used to filter databases returned in the list.
+The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
Supported filter:
-- schema
-- table
+- schema: the schema name, support &#34;==&#34; operator.
+- table: the table name, support &#34;==&#34; operator.
For example:
schema == &#34;schema-a&#34;
@@ -7880,15 +7884,17 @@ match the call that provided the page token. </p></td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>Filter is used to filter databases returned in the list.
+The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
Supported filter:
-- environment
-- name
-- project
-- instance
-- engine
-- label
-- exclude_unassigned: Not show unassigned databases if specified
-- drifted
+- environment: the environment full name in &#34;environments/{id}&#34; format, support &#34;==&#34; operator.
+- name: the database name, support &#34;.matches()&#34; operator.
+- project: the project full name in &#34;projects/{id}&#34; format, support &#34;==&#34; operator.
+- instance: the instance full name in &#34;instances/{id}&#34; format, support &#34;==&#34; operator.
+- engine: the database engine, check Engine enum for values. Support &#34;==&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34; operator.
+- label: the database label in &#34;{key}:{value1},{value2}&#34; format. Support &#34;==&#34; operator.
+- exclude_unassigned: should be &#34;true&#34; or &#34;false&#34;, will not show unassigned databases if it&#39;s true, support &#34;==&#34; operator.
+- drifted: should be &#34;true&#34; or &#34;false&#34;, show drifted databases if it&#39;s true, support &#34;==&#34; operator.
For example:
environment == &#34;environments/{environment resource id}&#34;
@@ -11244,7 +11250,26 @@ the call that provided the page token. </p></td>
<td>filter</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>Filter is used to filter issues returned in the list. </p></td>
+ <td><p>Filter is used to filter issues returned in the list.
+The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+Supported filters:
+- creator: issue creator full name in &#34;users/{email or id}&#34; format, support &#34;==&#34; operator.
+- subscriber: issue subscriber full name in &#34;users/{email or id}&#34; format, support &#34;==&#34; operator.
+- status: the issue status, support &#34;==&#34; and &#34;in&#34; operator, check the IssueStatus enum for the values.
+- create_time: issue create time in &#34;2006-01-02T15:04:05Z07:00&#34; format, support &#34;&gt;=&#34; or &#34;&lt;=&#34; operator.
+- type: the issue type, support &#34;==&#34; and &#34;in&#34; operator, check the Type enum in the Issue message for the values.
+- task_type: support &#34;==&#34; operator, the value can be &#34;DDL&#34;, &#34;DML&#34; or &#34;DATA_EXPORT&#34;
+- instance: the instance full name in the &#34;instances/{id}&#34; format, support &#34;==&#34; operator.
+- database: the database full name in the &#34;instances/{id}/databases/{name}&#34; format, support &#34;==&#34; operator.
+- labels: the issue labels, support &#34;==&#34; and &#34;in&#34; operator.
+- has_pipeline: the issue has pipeline or not, support &#34;==&#34; operator, the value should be &#34;true&#34; or &#34;false&#34;.
+
+For example:
+creator == &#34;users/[email protected]&#34; &amp;&amp; status in [&#34;OPEN&#34;, &#34;DONE&#34;]
+status == &#34;CANCELED&#34; &amp;&amp; type == &#34;DATABASE_CHANGE&#34;
+instance == &#34;instances/sample&#34; &amp;&amp; labels in [&#34;label1&#34;, &#34;label2&#34;]
+has_pipeline == true &amp;&amp; create_time &gt;= &#34;2025-01-02T15:04:05Z07:00&#34; </p></td>
</tr>
<tr>
@@ -11401,7 +11426,8 @@ the call that provided the page token. </p></td>
<td>filter</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>Filter is used to filter issues returned in the list. </p></td>
+ <td><p>Filter is used to filter issues returned in the list.
+Check the filter field in the ListIssuesRequest message. </p></td>
</tr>
<tr>
@@ -14119,8 +14145,8 @@ server would not persist the setting value if it is true. </p></td>
The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
Support variables:
-source: the risk source, check the Source enum in the Risk message for the values.
-level: the risk level, support 100 (low), 200 (moderate) and 300 (high).
+source: the risk source, check the Source enum in the Risk message for the values, support &#34;==&#34; operator.
+level: the risk level, support 100 (low), 200 (moderate) and 300 (high), support &#34;==&#34; operator.
For examples:
(source == &#34;DML&#34; &amp;&amp; level == 200) || (source == &#34;DDL&#34; &amp;&amp; level == 300) </p></td>
@@ -14709,12 +14735,14 @@ the call that provided the page token. </p></td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>Filter is used to filter users returned in the list.
+The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
Supported filter:
-- name
-- email
-- user_type
-- state
-- project
+- name: the user name, support &#34;==&#34; and &#34;.matches()&#34; operator.
+- email: the user email, support &#34;==&#34; and &#34;.matches()&#34; operator.
+- user_type: the type, check UserType enum for values, support &#34;==&#34;, &#34;in [xx]&#34;, &#34;!(in [xx])&#34; operator.
+- state: check State enum for values, support &#34;==&#34; operator.
+- project: the project full name in &#34;projects/{id}&#34; format, support &#34;==&#34; operator.
For example:
name == &#34;ed&#34;
@@ -15622,9 +15650,9 @@ If the condition evaluates to false, then this binding does not apply to the cur
The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
Support variables:
-resource.database: the database full name in &#34;instances/{instance}/databases/{database}&#34; format, used by the &#34;roles/sqlEditorUser&#34; and &#34;roles/projectExporter&#34; role.
-resource.schema: the schema name, used by the &#34;roles/sqlEditorUser&#34; and &#34;roles/projectExporter&#34; role.
-resource.table: the table name, used by the &#34;roles/sqlEditorUser&#34; and &#34;roles/projectExporter&#34; role.
+resource.database: the database full name in &#34;instances/{instance}/databases/{database}&#34; format, used by the &#34;roles/sqlEditorUser&#34; and &#34;roles/projectExporter&#34; role, support &#34;==&#34; operator.
+resource.schema: the schema name, used by the &#34;roles/sqlEditorUser&#34; and &#34;roles/projectExporter&#34; role, support &#34;==&#34; operator.
+resource.table: the table name, used by the &#34;roles/sqlEditorUser&#34; and &#34;roles/projectExporter&#34; role, support &#34;==&#34; operator.
request.time: the expiration. Only support &#34;&lt;&#34; operation in `request.time &lt; timestamp(&#34;{ISO datetime string format}&#34;)`.
request.row_limit: the maximum export rows, used by the &#34;roles/projectExporter&#34; role. Only support &#34;&lt;=&#34; operation.
@@ -16005,11 +16033,7 @@ Some fields are omitted because they are too large or contain sensitive informat
<td><a href="#string">string</a></td>
<td></td>
<td><p>The filter of the log. It should be a valid CEL expression.
-For example:
- - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39;&#34;
- - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39; &amp;&amp; severity == &#39;ERROR&#39;&#34;
- - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39; &amp;&amp; severity == &#39;ERROR&#39; &amp;&amp; user == &#39;users/[email protected]&#39;&#34;
- - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39; &amp;&amp; severity == &#39;ERROR&#39; &amp;&amp; create_time &lt;= &#39;2021-01-01T00:00:00Z&#39; &amp;&amp; create_time &gt;= &#39;2020-01-01T00:00:00Z&#39;&#34; </p></td>
+Check the filter field in the SearchAuditLogsRequest message. </p></td>
</tr>
<tr>
@@ -16142,11 +16166,13 @@ This information is not authenticated and should be treated accordingly. </p></t
<td><a href="#string">string</a></td>
<td></td>
<td><p>The filter of the log. It should be a valid CEL expression.
+The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
Supported filter:
-- method
-- severity
-- user
-- create_time
+- method: the API name, can be found in the docs, should start with &#34;/bytebase.v1.&#34; prefix. For example &#34;/bytebase.v1.UserService/CreateUser&#34;. Support &#34;==&#34; operator.
+- severity: support &#34;==&#34; operator, check Severity enum in AuditLog message for values.
+- user: the actor, should in &#34;users/{email}&#34; format, support &#34;==&#34; operator.
+- create_time: support &#34;&gt;=&#34; and &#34;&lt;=&#34; operator.
For example:
- filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39;&#34;
@@ -21534,7 +21560,18 @@ the call that provided the page token. </p></td>
<td>filter</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>Filter is used to filter plans returned in the list. </p></td>
+ <td><p>Filter is used to filter plans returned in the list.
+The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+Supported filters:
+- creator: the plan creator full name in &#34;users/{email or id}&#34; format, support &#34;==&#34; operator.
+- create_time: issue create time in &#34;2006-01-02T15:04:05Z07:00&#34; format, support &#34;&gt;=&#34; or &#34;&lt;=&#34; operator.
+- has_pipeline: the plan has pipeline or not, support &#34;==&#34; operator, the value should be &#34;true&#34; or &#34;false&#34;.
+- has_issue: the plan has issue or not, support &#34;==&#34; operator, the value should be &#34;true&#34; or &#34;false&#34;.
+
+For example:
+creator == &#34;users/[email protected]&#34; &amp;&amp; create_time &gt;= &#34;2025-01-02T15:04:05Z07:00&#34;
+has_pipeline == false &amp;&amp; has_issue == true </p></td>
</tr>
</tbody>
@@ -22522,11 +22559,13 @@ Without specification, sampling is disabled, resulting in a full validation. </p
<td><a href="#string">string</a></td>
<td></td>
<td><p>Filter the project.
+The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
Supported filters:
-- name
-- resource_id
-- exclude_default: if not include the default project.
-- state
+- name: the project name, support &#34;==&#34; and &#34;.matches()&#34; operator.
+- resource_id: the project id, support &#34;==&#34; and &#34;.matches()&#34; operator.
+- exclude_default: if not include the default project, should be &#34;true&#34; or &#34;false&#34;, support &#34;==&#34; operator.
+- state: check the State enum for the values, support &#34;==&#34; operator.
For example:
name = &#34;project name&#34;
@@ -24692,12 +24731,14 @@ Provide this to retrieve the subsequent page. </p></td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>Filter is the filter to apply on the search query history
+The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
Supported filter:
-- project
-- database
-- instance
-- type
-- statement
+- project: the project full name in &#34;projects/{id}&#34; format, support &#34;==&#34; operator.
+- database: the database full name in &#34;instances/{id}/databases/{name}&#34; format, support &#34;==&#34; operator.
+- instance: the instance full name in &#34;instances/{id}&#34; format, support &#34;==&#34; operator.
+- type: the type, should be &#34;QUERY&#34; or &#34;EXPORT&#34;, support &#34;==&#34; operator.
+- statement: the SQL statemnt, support &#34;.matches()&#34; operator.
For example:
project == &#34;projects/{project}&#34;
@@ -30108,10 +30149,12 @@ Format: worksheets/{worksheet} </p></td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>To filter the search result.
+The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
Supported filter:
-- creator
-- starred
-- visibility
+- creator: the worksheet creator in &#34;users/{email}&#34; format, support &#34;==&#34; and &#34;!=&#34; operator.
+- starred: should be &#34;true&#34; or &#34;false&#34;, filter starred/unstarred sheets, support &#34;==&#34; operator.
+- visibility: check Visibility enum in the Worksheet message for values, support &#34;==&#34; and &#34;in [xx]&#34; operator.
For example:
creator == &#34;users/{email}&#34;
diff --git a/proto/generated-go/v1/audit_log_service.pb.go b/proto/generated-go/v1/audit_log_service.pb.go
index bf067df782..2866059ae4 100644
--- a/proto/generated-go/v1/audit_log_service.pb.go
+++ b/proto/generated-go/v1/audit_log_service.pb.go
@@ -96,11 +96,13 @@ type SearchAuditLogsRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Parent string `protobuf:"bytes,5,opt,name=parent,proto3" json:"parent,omitempty"`
// The filter of the log. It should be a valid CEL expression.
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
// Supported filter:
- // - method
- // - severity
- // - user
- // - create_time
+ // - method: the API name, can be found in the docs, should start with "/bytebase.v1." prefix. For example "/bytebase.v1.UserService/CreateUser". Support "==" operator.
+ // - severity: support "==" operator, check Severity enum in AuditLog message for values.
+ // - user: the actor, should in "users/{email}" format, support "==" operator.
+ // - create_time: support ">=" and "<=" operator.
//
// For example:
// - filter = "method == '/bytebase.v1.SQLService/Query'"
@@ -250,11 +252,7 @@ type ExportAuditLogsRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Parent string `protobuf:"bytes,4,opt,name=parent,proto3" json:"parent,omitempty"`
// The filter of the log. It should be a valid CEL expression.
- // For example:
- // - filter = "method == '/bytebase.v1.SQLService/Query'"
- // - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR'"
- // - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && user == 'users/[email protected]'"
- // - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && create_time <= '2021-01-01T00:00:00Z' && create_time >= '2020-01-01T00:00:00Z'"
+ // Check the filter field in the SearchAuditLogsRequest message.
Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"`
// The order by of the log.
// Only support order by create_time.
diff --git a/proto/generated-go/v1/database_service.pb.go b/proto/generated-go/v1/database_service.pb.go
index 4bc9a3418a..e3e6969964 100644
--- a/proto/generated-go/v1/database_service.pb.go
+++ b/proto/generated-go/v1/database_service.pb.go
@@ -738,15 +738,17 @@ type ListDatabasesRequest struct {
// match the call that provided the page token.
PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
// Filter is used to filter databases returned in the list.
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
// Supported filter:
- // - environment
- // - name
- // - project
- // - instance
- // - engine
- // - label
- // - exclude_unassigned: Not show unassigned databases if specified
- // - drifted
+ // - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ // - name: the database name, support ".matches()" operator.
+ // - project: the project full name in "projects/{id}" format, support "==" operator.
+ // - instance: the instance full name in "instances/{id}" format, support "==" operator.
+ // - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ // - label: the database label in "{key}:{value1},{value2}" format. Support "==" operator.
+ // - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
+ // - drifted: should be "true" or "false", show drifted databases if it's true, support "==" operator.
//
// For example:
// environment == "environments/{environment resource id}"
@@ -1230,9 +1232,11 @@ type GetDatabaseMetadataRequest struct {
// Format: instances/{instance}/databases/{database}/metadata
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Filter is used to filter databases returned in the list.
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
// Supported filter:
- // - schema
- // - table
+ // - schema: the schema name, support "==" operator.
+ // - table: the table name, support "==" operator.
//
// For example:
// schema == "schema-a"
diff --git a/proto/generated-go/v1/iam_policy.pb.go b/proto/generated-go/v1/iam_policy.pb.go
index 1e8353ebd1..8bbce1b49a 100644
--- a/proto/generated-go/v1/iam_policy.pb.go
+++ b/proto/generated-go/v1/iam_policy.pb.go
@@ -257,9 +257,9 @@ type Binding struct {
// The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
//
// Support variables:
- // resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" and "roles/projectExporter" role.
- // resource.schema: the schema name, used by the "roles/sqlEditorUser" and "roles/projectExporter" role.
- // resource.table: the table name, used by the "roles/sqlEditorUser" and "roles/projectExporter" role.
+ // resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" and "roles/projectExporter" role, support "==" operator.
+ // resource.schema: the schema name, used by the "roles/sqlEditorUser" and "roles/projectExporter" role, support "==" operator.
+ // resource.table: the table name, used by the "roles/sqlEditorUser" and "roles/projectExporter" role, support "==" operator.
// request.time: the expiration. Only support "<" operation in `request.time < timestamp("{ISO datetime string format}")`.
// request.row_limit: the maximum export rows, used by the "roles/projectExporter" role. Only support "<=" operation.
//
diff --git a/proto/generated-go/v1/instance_service.pb.go b/proto/generated-go/v1/instance_service.pb.go
index a28d9ca0dc..66a0d84c52 100644
--- a/proto/generated-go/v1/instance_service.pb.go
+++ b/proto/generated-go/v1/instance_service.pb.go
@@ -398,15 +398,17 @@ type ListInstancesRequest struct {
// Show deleted instances if specified.
ShowDeleted bool `protobuf:"varint,3,opt,name=show_deleted,json=showDeleted,proto3" json:"show_deleted,omitempty"`
// Filter the instance.
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
// Supported filters:
- // - name
- // - resource_id
- // - environment
- // - state
- // - engine
- // - host
- // - port
- // - project
+ // - name: the instance name, support "==" and ".matches()" operator.
+ // - resource_id: the instance id, support "==" and ".matches()" operator.
+ // - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ // - state: the instance state, check State enum for values, support "==" operator.
+ // - engine: the instance engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ // - host: the instance host, support "==" operator.
+ // - port: the instance port, support "==" operator.
+ // - project: the project full name in "projects/{id}" format, support "==" operator.
//
// For example:
// name == "sample instance"
diff --git a/proto/generated-go/v1/issue_service.pb.go b/proto/generated-go/v1/issue_service.pb.go
index 073146b615..2247c84e33 100644
--- a/proto/generated-go/v1/issue_service.pb.go
+++ b/proto/generated-go/v1/issue_service.pb.go
@@ -575,6 +575,25 @@ type ListIssuesRequest struct {
// the call that provided the page token.
PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
// Filter is used to filter issues returned in the list.
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
+ // Supported filters:
+ // - creator: issue creator full name in "users/{email or id}" format, support "==" operator.
+ // - subscriber: issue subscriber full name in "users/{email or id}" format, support "==" operator.
+ // - status: the issue status, support "==" and "in" operator, check the IssueStatus enum for the values.
+ // - create_time: issue create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
+ // - type: the issue type, support "==" and "in" operator, check the Type enum in the Issue message for the values.
+ // - task_type: support "==" operator, the value can be "DDL", "DML" or "DATA_EXPORT"
+ // - instance: the instance full name in the "instances/{id}" format, support "==" operator.
+ // - database: the database full name in the "instances/{id}/databases/{name}" format, support "==" operator.
+ // - labels: the issue labels, support "==" and "in" operator.
+ // - has_pipeline: the issue has pipeline or not, support "==" operator, the value should be "true" or "false".
+ //
+ // For example:
+ // creator == "users/[email protected]" && status in ["OPEN", "DONE"]
+ // status == "CANCELED" && type == "DATABASE_CHANGE"
+ // instance == "instances/sample" && labels in ["label1", "label2"]
+ // has_pipeline == true && create_time >= "2025-01-02T15:04:05Z07:00"
Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"`
// Query is the query statement.
Query string `protobuf:"bytes,5,opt,name=query,proto3" json:"query,omitempty"`
@@ -720,6 +739,7 @@ type SearchIssuesRequest struct {
// the call that provided the page token.
PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
// Filter is used to filter issues returned in the list.
+ // Check the filter field in the ListIssuesRequest message.
Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"`
// Query is the query statement.
Query string `protobuf:"bytes,5,opt,name=query,proto3" json:"query,omitempty"`
diff --git a/proto/generated-go/v1/plan_service.pb.go b/proto/generated-go/v1/plan_service.pb.go
index 1de25765a1..5be9b1efbd 100644
--- a/proto/generated-go/v1/plan_service.pb.go
+++ b/proto/generated-go/v1/plan_service.pb.go
@@ -446,6 +446,17 @@ type SearchPlansRequest struct {
// the call that provided the page token.
PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
// Filter is used to filter plans returned in the list.
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
+ // Supported filters:
+ // - creator: the plan creator full name in "users/{email or id}" format, support "==" operator.
+ // - create_time: issue create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
+ // - has_pipeline: the plan has pipeline or not, support "==" operator, the value should be "true" or "false".
+ // - has_issue: the plan has issue or not, support "==" operator, the value should be "true" or "false".
+ //
+ // For example:
+ // creator == "users/[email protected]" && create_time >= "2025-01-02T15:04:05Z07:00"
+ // has_pipeline == false && has_issue == true
Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
diff --git a/proto/generated-go/v1/project_service.pb.go b/proto/generated-go/v1/project_service.pb.go
index 541a56bc8a..30b13c0742 100644
--- a/proto/generated-go/v1/project_service.pb.go
+++ b/proto/generated-go/v1/project_service.pb.go
@@ -410,11 +410,13 @@ type SearchProjectsRequest struct {
// Show deleted projects if specified.
ShowDeleted bool `protobuf:"varint,1,opt,name=show_deleted,json=showDeleted,proto3" json:"show_deleted,omitempty"`
// Filter the project.
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
// Supported filters:
- // - name
- // - resource_id
- // - exclude_default: if not include the default project.
- // - state
+ // - name: the project name, support "==" and ".matches()" operator.
+ // - resource_id: the project id, support "==" and ".matches()" operator.
+ // - exclude_default: if not include the default project, should be "true" or "false", support "==" operator.
+ // - state: check the State enum for the values, support "==" operator.
//
// For example:
// name = "project name"
diff --git a/proto/generated-go/v1/setting_service.pb.go b/proto/generated-go/v1/setting_service.pb.go
index e9dca9a203..7ac909af36 100644
--- a/proto/generated-go/v1/setting_service.pb.go
+++ b/proto/generated-go/v1/setting_service.pb.go
@@ -2459,8 +2459,8 @@ type WorkspaceApprovalSetting_Rule struct {
// The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
//
// Support variables:
- // source: the risk source, check the Source enum in the Risk message for the values.
- // level: the risk level, support 100 (low), 200 (moderate) and 300 (high).
+ // source: the risk source, check the Source enum in the Risk message for the values, support "==" operator.
+ // level: the risk level, support 100 (low), 200 (moderate) and 300 (high), support "==" operator.
//
// For examples:
// (source == "DML" && level == 200) || (source == "DDL" && level == 300)
diff --git a/proto/generated-go/v1/sql_service.pb.go b/proto/generated-go/v1/sql_service.pb.go
index 0d789c1b8f..c65d751490 100644
--- a/proto/generated-go/v1/sql_service.pb.go
+++ b/proto/generated-go/v1/sql_service.pb.go
@@ -1808,12 +1808,14 @@ type SearchQueryHistoriesRequest struct {
// Provide this to retrieve the subsequent page.
PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
// Filter is the filter to apply on the search query history
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
// Supported filter:
- // - project
- // - database
- // - instance
- // - type
- // - statement
+ // - project: the project full name in "projects/{id}" format, support "==" operator.
+ // - database: the database full name in "instances/{id}/databases/{name}" format, support "==" operator.
+ // - instance: the instance full name in "instances/{id}" format, support "==" operator.
+ // - type: the type, should be "QUERY" or "EXPORT", support "==" operator.
+ // - statement: the SQL statemnt, support ".matches()" operator.
//
// For example:
// project == "projects/{project}"
diff --git a/proto/generated-go/v1/user_service.pb.go b/proto/generated-go/v1/user_service.pb.go
index b80f407f48..f97b02a0e2 100644
--- a/proto/generated-go/v1/user_service.pb.go
+++ b/proto/generated-go/v1/user_service.pb.go
@@ -139,12 +139,14 @@ type ListUsersRequest struct {
// Show deleted users if specified.
ShowDeleted bool `protobuf:"varint,3,opt,name=show_deleted,json=showDeleted,proto3" json:"show_deleted,omitempty"`
// Filter is used to filter users returned in the list.
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
// Supported filter:
- // - name
- // - email
- // - user_type
- // - state
- // - project
+ // - name: the user name, support "==" and ".matches()" operator.
+ // - email: the user email, support "==" and ".matches()" operator.
+ // - user_type: the type, check UserType enum for values, support "==", "in [xx]", "!(in [xx])" operator.
+ // - state: check State enum for values, support "==" operator.
+ // - project: the project full name in "projects/{id}" format, support "==" operator.
//
// For example:
// name == "ed"
diff --git a/proto/generated-go/v1/worksheet_service.pb.go b/proto/generated-go/v1/worksheet_service.pb.go
index 8f6dc218e6..8d929a1065 100644
--- a/proto/generated-go/v1/worksheet_service.pb.go
+++ b/proto/generated-go/v1/worksheet_service.pb.go
@@ -399,10 +399,12 @@ func (x *DeleteWorksheetRequest) GetName() string {
type SearchWorksheetsRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
// To filter the search result.
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
// Supported filter:
- // - creator
- // - starred
- // - visibility
+ // - creator: the worksheet creator in "users/{email}" format, support "==" and "!=" operator.
+ // - starred: should be "true" or "false", filter starred/unstarred sheets, support "==" operator.
+ // - visibility: check Visibility enum in the Worksheet message for values, support "==" and "in [xx]" operator.
//
// For example:
// creator == "users/{email}"
diff --git a/proto/v1/v1/audit_log_service.proto b/proto/v1/v1/audit_log_service.proto
index 5e95e205e8..7a913c56e0 100644
--- a/proto/v1/v1/audit_log_service.proto
+++ b/proto/v1/v1/audit_log_service.proto
@@ -48,11 +48,13 @@ message SearchAuditLogsRequest {
];
// The filter of the log. It should be a valid CEL expression.
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
// Supported filter:
- // - method
- // - severity
- // - user
- // - create_time
+ // - method: the API name, can be found in the docs, should start with "/bytebase.v1." prefix. For example "/bytebase.v1.UserService/CreateUser". Support "==" operator.
+ // - severity: support "==" operator, check Severity enum in AuditLog message for values.
+ // - user: the actor, should in "users/{email}" format, support "==" operator.
+ // - create_time: support ">=" and "<=" operator.
//
// For example:
// - filter = "method == '/bytebase.v1.SQLService/Query'"
@@ -95,11 +97,7 @@ message ExportAuditLogsRequest {
];
// The filter of the log. It should be a valid CEL expression.
- // For example:
- // - filter = "method == '/bytebase.v1.SQLService/Query'"
- // - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR'"
- // - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && user == 'users/[email protected]'"
- // - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && create_time <= '2021-01-01T00:00:00Z' && create_time >= '2020-01-01T00:00:00Z'"
+ // Check the filter field in the SearchAuditLogsRequest message.
string filter = 1;
// The order by of the log.
diff --git a/proto/v1/v1/database_service.proto b/proto/v1/v1/database_service.proto
index 8c3f54dec5..72197d37a0 100644
--- a/proto/v1/v1/database_service.proto
+++ b/proto/v1/v1/database_service.proto
@@ -238,15 +238,17 @@ message ListDatabasesRequest {
string page_token = 3;
// Filter is used to filter databases returned in the list.
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
// Supported filter:
- // - environment
- // - name
- // - project
- // - instance
- // - engine
- // - label
- // - exclude_unassigned: Not show unassigned databases if specified
- // - drifted
+ // - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ // - name: the database name, support ".matches()" operator.
+ // - project: the project full name in "projects/{id}" format, support "==" operator.
+ // - instance: the instance full name in "instances/{id}" format, support "==" operator.
+ // - engine: the database engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ // - label: the database label in "{key}:{value1},{value2}" format. Support "==" operator.
+ // - exclude_unassigned: should be "true" or "false", will not show unassigned databases if it's true, support "==" operator.
+ // - drifted: should be "true" or "false", show drifted databases if it's true, support "==" operator.
//
// For example:
// environment == "environments/{environment resource id}"
@@ -341,9 +343,11 @@ message GetDatabaseMetadataRequest {
];
// Filter is used to filter databases returned in the list.
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
// Supported filter:
- // - schema
- // - table
+ // - schema: the schema name, support "==" operator.
+ // - table: the table name, support "==" operator.
//
// For example:
// schema == "schema-a"
diff --git a/proto/v1/v1/iam_policy.proto b/proto/v1/v1/iam_policy.proto
index 3ff1471e2d..4c265f3363 100644
--- a/proto/v1/v1/iam_policy.proto
+++ b/proto/v1/v1/iam_policy.proto
@@ -61,9 +61,9 @@ message Binding {
// The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
//
// Support variables:
- // resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" and "roles/projectExporter" role.
- // resource.schema: the schema name, used by the "roles/sqlEditorUser" and "roles/projectExporter" role.
- // resource.table: the table name, used by the "roles/sqlEditorUser" and "roles/projectExporter" role.
+ // resource.database: the database full name in "instances/{instance}/databases/{database}" format, used by the "roles/sqlEditorUser" and "roles/projectExporter" role, support "==" operator.
+ // resource.schema: the schema name, used by the "roles/sqlEditorUser" and "roles/projectExporter" role, support "==" operator.
+ // resource.table: the table name, used by the "roles/sqlEditorUser" and "roles/projectExporter" role, support "==" operator.
// request.time: the expiration. Only support "<" operation in `request.time < timestamp("{ISO datetime string format}")`.
// request.row_limit: the maximum export rows, used by the "roles/projectExporter" role. Only support "<=" operation.
//
diff --git a/proto/v1/v1/instance_service.proto b/proto/v1/v1/instance_service.proto
index 325187bca5..a2d0b08a15 100644
--- a/proto/v1/v1/instance_service.proto
+++ b/proto/v1/v1/instance_service.proto
@@ -155,15 +155,17 @@ message ListInstancesRequest {
bool show_deleted = 3;
// Filter the instance.
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
// Supported filters:
- // - name
- // - resource_id
- // - environment
- // - state
- // - engine
- // - host
- // - port
- // - project
+ // - name: the instance name, support "==" and ".matches()" operator.
+ // - resource_id: the instance id, support "==" and ".matches()" operator.
+ // - environment: the environment full name in "environments/{id}" format, support "==" operator.
+ // - state: the instance state, check State enum for values, support "==" operator.
+ // - engine: the instance engine, check Engine enum for values. Support "==", "in [xx]", "!(in [xx])" operator.
+ // - host: the instance host, support "==" operator.
+ // - port: the instance port, support "==" operator.
+ // - project: the project full name in "projects/{id}" format, support "==" operator.
//
// For example:
// name == "sample instance"
diff --git a/proto/v1/v1/issue_service.proto b/proto/v1/v1/issue_service.proto
index cf7c626dcf..0b645a8f64 100644
--- a/proto/v1/v1/issue_service.proto
+++ b/proto/v1/v1/issue_service.proto
@@ -180,6 +180,25 @@ message ListIssuesRequest {
string page_token = 3;
// Filter is used to filter issues returned in the list.
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
+ // Supported filters:
+ // - creator: issue creator full name in "users/{email or id}" format, support "==" operator.
+ // - subscriber: issue subscriber full name in "users/{email or id}" format, support "==" operator.
+ // - status: the issue status, support "==" and "in" operator, check the IssueStatus enum for the values.
+ // - create_time: issue create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
+ // - type: the issue type, support "==" and "in" operator, check the Type enum in the Issue message for the values.
+ // - task_type: support "==" operator, the value can be "DDL", "DML" or "DATA_EXPORT"
+ // - instance: the instance full name in the "instances/{id}" format, support "==" operator.
+ // - database: the database full name in the "instances/{id}/databases/{name}" format, support "==" operator.
+ // - labels: the issue labels, support "==" and "in" operator.
+ // - has_pipeline: the issue has pipeline or not, support "==" operator, the value should be "true" or "false".
+ //
+ // For example:
+ // creator == "users/[email protected]" && status in ["OPEN", "DONE"]
+ // status == "CANCELED" && type == "DATABASE_CHANGE"
+ // instance == "instances/sample" && labels in ["label1", "label2"]
+ // has_pipeline == true && create_time >= "2025-01-02T15:04:05Z07:00"
string filter = 4;
// Query is the query statement.
@@ -215,6 +234,7 @@ message SearchIssuesRequest {
string page_token = 3;
// Filter is used to filter issues returned in the list.
+ // Check the filter field in the ListIssuesRequest message.
string filter = 4;
// Query is the query statement.
diff --git a/proto/v1/v1/plan_service.proto b/proto/v1/v1/plan_service.proto
index 20984d4352..b400dc431c 100644
--- a/proto/v1/v1/plan_service.proto
+++ b/proto/v1/v1/plan_service.proto
@@ -162,6 +162,17 @@ message SearchPlansRequest {
string page_token = 3;
// Filter is used to filter plans returned in the list.
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
+ // Supported filters:
+ // - creator: the plan creator full name in "users/{email or id}" format, support "==" operator.
+ // - create_time: issue create time in "2006-01-02T15:04:05Z07:00" format, support ">=" or "<=" operator.
+ // - has_pipeline: the plan has pipeline or not, support "==" operator, the value should be "true" or "false".
+ // - has_issue: the plan has issue or not, support "==" operator, the value should be "true" or "false".
+ //
+ // For example:
+ // creator == "users/[email protected]" && create_time >= "2025-01-02T15:04:05Z07:00"
+ // has_pipeline == false && has_issue == true
string filter = 4;
}
diff --git a/proto/v1/v1/project_service.proto b/proto/v1/v1/project_service.proto
index 10ffbc07ea..24135585d1 100644
--- a/proto/v1/v1/project_service.proto
+++ b/proto/v1/v1/project_service.proto
@@ -181,11 +181,13 @@ message SearchProjectsRequest {
bool show_deleted = 1;
// Filter the project.
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
// Supported filters:
- // - name
- // - resource_id
- // - exclude_default: if not include the default project.
- // - state
+ // - name: the project name, support "==" and ".matches()" operator.
+ // - resource_id: the project id, support "==" and ".matches()" operator.
+ // - exclude_default: if not include the default project, should be "true" or "false", support "==" operator.
+ // - state: check the State enum for the values, support "==" operator.
//
// For example:
// name = "project name"
diff --git a/proto/v1/v1/setting_service.proto b/proto/v1/v1/setting_service.proto
index 1fffe24b3c..054b2497ff 100644
--- a/proto/v1/v1/setting_service.proto
+++ b/proto/v1/v1/setting_service.proto
@@ -287,8 +287,8 @@ message WorkspaceApprovalSetting {
// The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
//
// Support variables:
- // source: the risk source, check the Source enum in the Risk message for the values.
- // level: the risk level, support 100 (low), 200 (moderate) and 300 (high).
+ // source: the risk source, check the Source enum in the Risk message for the values, support "==" operator.
+ // level: the risk level, support 100 (low), 200 (moderate) and 300 (high), support "==" operator.
//
// For examples:
// (source == "DML" && level == 200) || (source == "DDL" && level == 300)
diff --git a/proto/v1/v1/sql_service.proto b/proto/v1/v1/sql_service.proto
index 730556694b..8e5bb26394 100644
--- a/proto/v1/v1/sql_service.proto
+++ b/proto/v1/v1/sql_service.proto
@@ -482,12 +482,14 @@ message SearchQueryHistoriesRequest {
string page_token = 2;
// Filter is the filter to apply on the search query history
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
// Supported filter:
- // - project
- // - database
- // - instance
- // - type
- // - statement
+ // - project: the project full name in "projects/{id}" format, support "==" operator.
+ // - database: the database full name in "instances/{id}/databases/{name}" format, support "==" operator.
+ // - instance: the instance full name in "instances/{id}" format, support "==" operator.
+ // - type: the type, should be "QUERY" or "EXPORT", support "==" operator.
+ // - statement: the SQL statemnt, support ".matches()" operator.
//
// For example:
// project == "projects/{project}"
diff --git a/proto/v1/v1/user_service.proto b/proto/v1/v1/user_service.proto
index 1942e9dc0e..63c69fffc7 100644
--- a/proto/v1/v1/user_service.proto
+++ b/proto/v1/v1/user_service.proto
@@ -110,12 +110,14 @@ message ListUsersRequest {
bool show_deleted = 3;
// Filter is used to filter users returned in the list.
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
// Supported filter:
- // - name
- // - email
- // - user_type
- // - state
- // - project
+ // - name: the user name, support "==" and ".matches()" operator.
+ // - email: the user email, support "==" and ".matches()" operator.
+ // - user_type: the type, check UserType enum for values, support "==", "in [xx]", "!(in [xx])" operator.
+ // - state: check State enum for values, support "==" operator.
+ // - project: the project full name in "projects/{id}" format, support "==" operator.
//
// For example:
// name == "ed"
diff --git a/proto/v1/v1/worksheet_service.proto b/proto/v1/v1/worksheet_service.proto
index eb32d7d074..b71a93981d 100644
--- a/proto/v1/v1/worksheet_service.proto
+++ b/proto/v1/v1/worksheet_service.proto
@@ -139,10 +139,12 @@ message DeleteWorksheetRequest {
message SearchWorksheetsRequest {
// To filter the search result.
+ // The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+ //
// Supported filter:
- // - creator
- // - starred
- // - visibility
+ // - creator: the worksheet creator in "users/{email}" format, support "==" and "!=" operator.
+ // - starred: should be "true" or "false", filter starred/unstarred sheets, support "==" operator.
+ // - visibility: check Visibility enum in the Worksheet message for values, support "==" and "in [xx]" operator.
//
// For example:
// creator == "users/{email}"