Skip to content

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

158 KB
Raw Blame

Protocol Documentation

Table of Contents

Top

store/access_grant.proto

AccessGrant

AccessGrantPayload

Field Type Label Description
issue_id int64 The issue associated with the access grant.
targets string repeated The target databases for this access grant. Format: instances/{instance}/databases/{database}
query string The query permission granted.
unmask bool Whether the grant allows unmasking sensitive data.
reason string
requested_duration google.protobuf.Duration The requested duration for the access grant. Stored when the user provides a TTL instead of an absolute expire_time. The server computes expire_time from this value at activation time.
export bool Whether export the query result.
schema string The default schema to execute the query.
container string The container name to execute the query against, used for CosmosDB only.
query_hash string Lowercase hex SHA-256 of query after trimming boundary space, tab, LF, CR, vertical tab, and form feed. Derived by the store for grant matching.

AccessGrant.Status

Name Number Description
STATUS_UNSPECIFIED 0
PENDING 1
ACTIVE 2
REVOKED 3

Top

store/common.proto

PageToken

PageToken is used internally for obfuscating pagination tokens.

Field Type Label Description
limit int32 Maximum number of items to return.
offset int32 Number of items to skip before starting to return results.
create_time_upper_bound google.protobuf.Timestamp Bounds later pages to the rows that existed when the traversal started, inclusive. Set by a list whose own reads write rows it would page over.

Position

Position in a text expressed as one-based line and one-based column. We use 1-based numbering to match the majority of industry standards:

Handling unknown positions:

  • If the entire position is unknown, leave this field as nil/undefined
  • If only line is known, set line and leave column as 0 (e.g., line=5, column=0)
  • If only column is known (rare), set column and leave line as 0 Frontends should check for nil/undefined/zero values and handle them appropriately.
Field Type Label Description
line int32 Line position in a text (one-based). First line of the text is line 1. A value of 0 indicates the line information is unknown.
column int32 Column position in a text (one-based). Column is measured in Unicode code points (characters/runes), not bytes or grapheme clusters. First character of the line is column 1. A value of 0 indicates the column information is unknown.

Examples: - "SELECT * FROM t" - column 8 is '*' - "SELECT 你好 FROM t" - column 8 is '你' (even though it's at byte offset 7) - "SELECT 😀 FROM t" - column 8 is '😀' (even though it's 4 bytes in UTF-8) |

Range

Range represents a span within a text or sequence. Whether the indices are byte offsets or character indices depends on the context. Check the documentation of the field using Range for specific semantics.

Field Type Label Description
start int32 Start index (inclusive).
end int32 End index (exclusive).

Engine

Engine represents the type of database system.

Name Number Description
ENGINE_UNSPECIFIED 0
CLICKHOUSE 1
MYSQL 2
POSTGRES 3
SNOWFLAKE 4
TIDB 6
MONGODB 7
REDIS 8
ORACLE 9
SPANNER 10
MSSQL 11
REDSHIFT 12
MARIADB 13
OCEANBASE 14
STARROCKS 15
DORIS 16
HIVE 17
ELASTICSEARCH 18
BIGQUERY 19
DYNAMODB 20
DATABRICKS 21
COCKROACHDB 22
COSMOSDB 23
TRINO 24
CASSANDRA 25

ExportFormat

ExportFormat represents the file format for exported data.

Name Number Description
FORMAT_UNSPECIFIED 0
CSV 1
JSON 2
SQL 3
XLSX 4

RiskLevel

RiskLevel represents the assessed risk level of a database operation.

Name Number Description
RISK_LEVEL_UNSPECIFIED 0
LOW 1
MODERATE 2
HIGH 3

SchemaChangeType

SchemaChangeType represents the strategy for schema changes.

Name Number Description
SCHEMA_CHANGE_TYPE_UNSPECIFIED 0
VERSIONED 1 Versioned migration with explicit migration scripts.
DECLARATIVE 2 Declarative schema definition (state-based).

StatementType

StatementType represents the type of SQL statement.

Name Number Description
STATEMENT_TYPE_UNSPECIFIED 0
CREATE_DATABASE 1 DDL - CREATE statements
CREATE_TABLE 2
CREATE_VIEW 3
CREATE_INDEX 4
CREATE_SEQUENCE 5
CREATE_SCHEMA 6
CREATE_FUNCTION 7
CREATE_TRIGGER 8
CREATE_PROCEDURE 9
CREATE_EVENT 10
CREATE_EXTENSION 11
CREATE_TYPE 12
DROP_DATABASE 20 DDL - DROP statements
DROP_TABLE 21
DROP_VIEW 22
DROP_INDEX 23
DROP_SEQUENCE 24
DROP_SCHEMA 25
DROP_FUNCTION 26
DROP_TRIGGER 27
DROP_PROCEDURE 28
DROP_EVENT 29
DROP_EXTENSION 30
DROP_TYPE 31
ALTER_DATABASE 40 DDL - ALTER statements
ALTER_TABLE 41
ALTER_VIEW 42
ALTER_SEQUENCE 43
ALTER_EVENT 44
ALTER_TYPE 45
ALTER_INDEX 46
TRUNCATE 50 DDL - Other
RENAME 51
RENAME_INDEX 52
RENAME_SCHEMA 53
RENAME_SEQUENCE 54
COMMENT 55
INSERT 60 DML statements
UPDATE 61
DELETE 62
MERGE 63

VCSType

VCSType represents the type of version control system.

Name Number Description
VCS_TYPE_UNSPECIFIED 0
GITHUB 1
GITLAB 2
BITBUCKET 3
AZURE_DEVOPS 4

WebhookType

Name Number Description
WEBHOOK_TYPE_UNSPECIFIED 0 Unspecified type.
SLACK 1 Slack integration.
DISCORD 2 Discord integration.
TEAMS 3 Microsoft Teams integration.
DINGTALK 4 DingTalk integration.
FEISHU 5 Feishu integration.
WECOM 6 WeCom (WeChat Work) integration.
LARK 7 Lark integration.
GOOGLE_CHAT 8 Google Chat integration.

Top

store/advice.proto

Advice

Field Type Label Description
status Advice.Status The advice status.
code int32 The advice code.
title string The advice title.
content string The advice content.
start_position Position The start_position is inclusive and the end_position is exclusive. TODO: use range instead.
end_position Position

Advice.Status

Status represents the result status of the advice.

Name Number Description
STATUS_UNSPECIFIED 0
SUCCESS 1
WARNING 2
ERROR 3

Top

store/approval.proto

ApprovalFlow

ApprovalFlow defines the sequence of approvals required.

Field Type Label Description
roles string repeated List of role names that must approve, in order.

ApprovalTemplate

ApprovalTemplate defines the approval workflow and requirements for an issue.

Field Type Label Description
flow ApprovalFlow The approval workflow specification.
title string Human-readable title of the approval template.
description string Detailed description of when this template applies.

IssuePayloadApproval

IssuePayloadApproval records the approval template used and approval history for an issue.

Field Type Label Description
approval_template ApprovalTemplate The approval template being used for this issue.
approvers IssuePayloadApproval.Approver repeated List of approvers and their current status.
approval_finding_done bool Whether the system has finished finding a matching approval template. False means the backend is still searching for matching templates.
approval_input_version int64 The plan approval input version used to generate this approval flow.

IssuePayloadApproval.Approver

Approver represents a user who can approve or reject an issue.

Field Type Label Description
status IssuePayloadApproval.Approver.Status The current approval status.
principal string The principal who is the approver. Format: users/{email}.

IssuePayloadApproval.Approver.Status

Status represents the approver's decision state.

Name Number Description
STATUS_UNSPECIFIED 0
PENDING 1 Approval is pending from this approver.
APPROVED 2 Approver has approved the issue.
REJECTED 3 Approver has rejected the issue.

Top

store/audit_log.proto

AuditLog

Field Type Label Description
parent string The project or workspace the audit log belongs to. Formats: - projects/{project} - workspaces/{workspace}
method string Example: /bytebase.v1.SQLService/Query
resource string The resource name. Example: projects/{project}
user string The principal who performed the action. Formats: users/{email}, serviceAccounts/{email}, or workloadIdentities/{email}.
severity AuditLog.Severity
request string Marshalled request.
response string Marshalled response. Some fields are omitted because they are too large or contain sensitive information.
status google.rpc.Status
latency google.protobuf.Duration The latency of the RPC.
service_data google.protobuf.Any The service-specific data about the request, response, and other activities.
request_metadata RequestMetadata Metadata about the operation.
mcp_delegation MCPDelegation MCP delegation provenance. Present exactly when the entry belongs to MCP: the audited call arrived through the MCP server's delegated credential, or it is one of the two MCP doors that sit outside the API — the /mcp connection gate and the OAuth2 consent that mints the credential it checks. Never set for public API calls. Presence of this message is the MCP-origin marker.

MCPDelegation

Provenance of a call that reached the API through the MCP (Model Context Protocol) server's delegated credential. The values are copied verbatim from the verified credential's grant state; empty fields record that the grant stored nothing (legacy sessions), never a resolved or synthesized value.

Field Type Label Description
scope string The OAuth2 grant's consented scope, e.g. "mcp:read-only". Empty when the grant recorded no scope.
resource string The grant's stored MCP resource URI. Empty for pre-grant legacy sessions.
client_id string The OAuth2 client the grant was consented to. Empty for legacy web-session tokens at /mcp.
correlation_id string Correlates the audit rows an MCP session produces. Minted at the /mcp boundary and session-scoped: the MCP SDK hands tool handlers the initialize-time context, so one MCP session carries one correlation ID across all of its tool calls.

Empty on the entries that belong to no session — a refused consent, which never reached that boundary, and a refused connection, which is decided before the SDK resolves a session. Filling those with a fresh value would read as a session ID that correlates exactly one row, and a mid-session refusal would get an ID different from the rows the session already wrote. |

RequestMetadata

Metadata about the request.

Field Type Label Description
caller_ip string The IP address of the caller.
caller_supplied_user_agent string The user agent of the caller. This information is not authenticated and should be treated accordingly.

AuditLog.Severity

Name Number Description
SEVERITY_UNSPECIFIED 0
DEBUG 1
INFO 2
NOTICE 3
WARNING 4
ERROR 5
CRITICAL 6
ALERT 7
EMERGENCY 8

Top

store/auth.proto

EmailVerificationCodePurpose

EmailVerificationCodePurpose distinguishes login codes from password reset codes. Stored as the enum name string in email_verification_code.purpose column.

Name Number Description
EMAIL_VERIFICATION_CODE_PURPOSE_UNSPECIFIED 0
LOGIN 1
PASSWORD_RESET 2
REAUTH 3 Re-authentication proof for a credential change (CredentialProof.email_code). Never accepted by Login.

LoginAttemptKind

LoginAttemptKind names what a login_attempt row counts. Stored as the enum name string in login_attempt.kind column. The kind also says what the identity column holds: the three credential kinds below count failed guesses against a person, share one attempt limit, and are cleared by a successful verification.

Name Number Description
LOGIN_ATTEMPT_KIND_UNSPECIFIED 0
PASSWORD 1
EMAIL_CODE 2 Submitting a 6-digit code. Sign-in, password reset and re-authentication share one bucket per email, so a guess anywhere counts everywhere.
MFA 3
EMAIL_CODE_SEND 4 Sending those codes rather than guessing them — the opposite direction, and the reason it is a separate kind. Its identity is the sending deployment and not a person, so exhausting it throttles outbound mail and locks no account, and nothing clears it because a delivered email is the thing counted and there is no success to forgive.

It also reads last_attempt_at differently: for this kind the column is the window's start, not the latest send, so the count resets on a fixed schedule. The kinds above intentionally reset only after a quiet window — wrong for a volume budget, where a steady trickle would never reset and "N per hour" would become "N ever". |

Top

store/changelog.proto

ChangelogPayload

Field Type Label Description
task_run string Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}
git_commit string

Top

store/database.proto

ColumnCatalog

Field Type Label Description
name string The name of the column.
semantic_type string
labels ColumnCatalog.LabelsEntry repeated The user labels for a column.
classification string
object_schema ObjectSchema optional

ColumnCatalog.LabelsEntry

Field Type Label Description
key string
value string

DatabaseConfig

Field Type Label Description
name string
schemas SchemaCatalog repeated The schema_configs is the list of configs for schemas in a database.

DatabaseMetadata

DatabaseMetadata is the metadata for databases.

Field Type Label Description
labels DatabaseMetadata.LabelsEntry repeated
last_sync_time google.protobuf.Timestamp
backup_available bool
datashare bool
release string The release that was last applied to this database. Format: projects/{project}/releases/{release_id}
sync_status SyncStatus The sync status of the database.
sync_error string The error message if sync failed.

DatabaseMetadata.LabelsEntry

Field Type Label Description
key string
value string

InstanceRoleMetadata

InstanceRoleMetadata is the message for instance role.

Field Type Label Description
name string The role name. It's unique within the instance.
grant string The grant display string on the instance. It's generated by database engine.

ObjectSchema

Field Type Label Description
type ObjectSchema.Type
struct_kind ObjectSchema.StructKind
array_kind ObjectSchema.ArrayKind
semantic_type string

ObjectSchema.ArrayKind

Field Type Label Description
kind ObjectSchema

ObjectSchema.StructKind

Field Type Label Description
properties ObjectSchema.StructKind.PropertiesEntry repeated

ObjectSchema.StructKind.PropertiesEntry

Field Type Label Description
key string
value ObjectSchema

SchemaCatalog

Field Type Label Description
name string The schema name. It is an empty string for databases without such concept such as MySQL.
tables TableCatalog repeated The table_configs is the list of configs for tables in a schema.

TableCatalog

Field Type Label Description
name string The name of the table.
columns ColumnCatalog repeated The column_configs is the ordered list of configs for columns in a table.
object_schema ObjectSchema optional
classification string

ObjectSchema.Type

Name Number Description
TYPE_UNSPECIFIED 0
STRING 1
NUMBER 2
BOOLEAN 3
OBJECT 4
ARRAY 5

SyncStatus

SyncStatus is the status of the database sync operation.

Name Number Description
SYNC_STATUS_UNSPECIFIED 0
SYNC_STATUS_OK 1
SYNC_STATUS_FAILED 2

Top

store/group.proto

GroupMember

Field Type Label Description
member string Member is the principal who belongs to this group.

Format: users/{email}. | | role | GroupMember.Role | | |

GroupPayload

Field Type Label Description
members GroupMember repeated
source string The source indicates where the group comes from. For now we support Entra ID SCIM sync, so the source could be Entra ID.

GroupMember.Role

Name Number Description
ROLE_UNSPECIFIED 0
OWNER 1
MEMBER 2

Top

store/idp.proto

FieldMapping

FieldMapping saves the field names from user info API of identity provider. As we save all raw json string of user info response data into principal.idp_user_info, we can extract the relevant data based with FieldMapping.

Field Type Label Description
identifier string Identifier is the field name of the unique identifier in 3rd-party idp user info. Required.
display_name string DisplayName is the field name of display name in 3rd-party idp user info. Optional.
phone string Phone is the field name of primary phone in 3rd-party idp user info. Optional.
groups string Groups is the field name of groups in 3rd-party idp user info. Optional. Mainly used for OIDC: https://developer.okta.com/docs/guides/customize-tokens-groups-claim/main/

IdentityProviderConfig

Field Type Label Description
oauth2_config OAuth2IdentityProviderConfig
oidc_config OIDCIdentityProviderConfig
ldap_config LDAPIdentityProviderConfig

IdentityProviderUserInfo

Field Type Label Description
identifier string Identifier is the value of the unique identifier in 3rd-party idp user info.
display_name string DisplayName is the value of display name in 3rd-party idp user info.
phone string Phone is the value of primary phone in 3rd-party idp user info.
groups string repeated Groups is the value of groups in 3rd-party idp user info. Mainly used for OIDC: https://developer.okta.com/docs/guides/customize-tokens-groups-claim/main/
has_groups bool

LDAPIdentityProviderConfig

LDAPIdentityProviderConfig is the structure for LDAP identity provider config.

Field Type Label Description
host string Host is the hostname or IP address of the LDAP server, e.g. "ldap.example.com".
port int32 Port is the port number of the LDAP server, e.g. 389. When not set, the default port of the corresponding security protocol will be used, i.e. 389 for StartTLS and 636 for LDAPS.
skip_tls_verify bool SkipTLSVerify controls whether to skip TLS certificate verification.
bind_dn string BindDN is the DN of the user to bind as a service account to perform search requests.
bind_password string BindPassword is the password of the user to bind as a service account.
base_dn string BaseDN is the base DN to search for users, e.g. "ou=users,dc=example,dc=com".
user_filter string UserFilter is the filter to search for users, e.g. "(uid=%s)".
security_protocol LDAPIdentityProviderConfig.SecurityProtocol SecurityProtocol is the security protocol to be used for establishing connections with the LDAP server.
field_mapping FieldMapping FieldMapping is the mapping of the user attributes returned by the LDAP server.

OAuth2IdentityProviderConfig

OAuth2IdentityProviderConfig is the structure for OAuth2 identity provider config.

Field Type Label Description
auth_url string
token_url string
user_info_url string
client_id string
client_secret string
scopes string repeated
field_mapping FieldMapping
skip_tls_verify bool
auth_style OAuth2AuthStyle

OIDCIdentityProviderConfig

OIDCIdentityProviderConfig is the structure for OIDC identity provider config.

Field Type Label Description
issuer string
client_id string
client_secret string
scopes string repeated
field_mapping FieldMapping
skip_tls_verify bool
auth_style OAuth2AuthStyle

IdentityProviderType

Name Number Description
IDENTITY_PROVIDER_TYPE_UNSPECIFIED 0
OAUTH2 1
OIDC 2
LDAP 3

LDAPIdentityProviderConfig.SecurityProtocol

Name Number Description
SECURITY_PROTOCOL_UNSPECIFIED 0
START_TLS 1 StartTLS is the security protocol that starts with an unencrypted connection and then upgrades to TLS.
LDAPS 2 LDAPS is the security protocol that uses TLS from the beginning.

OAuth2AuthStyle

Name Number Description
OAUTH2_AUTH_STYLE_UNSPECIFIED 0
IN_PARAMS 1 IN_PARAMS sends the "client_id" and "client_secret" in the POST body as application/x-www-form-urlencoded parameters.
IN_HEADER 2 IN_HEADER sends the client_id and client_secret using HTTP Basic Authorization. This is an optional style described in the OAuth2 RFC 6749 section 2.3.1.

Top

store/instance.proto

DataSource

Field Type Label Description
id string
type DataSourceType
username string
password string
obfuscated_password string
use_ssl bool Use SSL to connect to the data source. By default, we use the system's SSL configuration.
ssl_ca string
obfuscated_ssl_ca string
ssl_cert string
obfuscated_ssl_cert string
ssl_key string
obfuscated_ssl_key string
ssl_ca_path string
obfuscated_ssl_ca_path string
ssl_cert_path string
obfuscated_ssl_cert_path string
ssl_key_path string
obfuscated_ssl_key_path string
verify_tls_certificate bool verify_tls_certificate enables TLS certificate verification for SSL connections. Default is false (no verification) for backward compatibility. Set to true for secure connections (recommended for production). Only set to false for development or when certificates cannot be properly validated (e.g., self-signed certs, VPN environments).
host string
port string
database string
srv bool srv, authentication_database, and replica_set are used for MongoDB. srv is a boolean flag that indicates whether the host is a DNS SRV record.
authentication_database string authentication_database is the database name to authenticate against, which stores the user credentials.
replica_set string replica_set is used for MongoDB replica set.
sid string sid and service_name are used for Oracle.
service_name string
ssh_host string SSH related The hostname of the SSH server agent.
ssh_port string The port of the SSH server agent. It's 22 typically.
ssh_user string The user to login the server.
ssh_password string The password to login the server. If it's empty string, no password is required.
obfuscated_ssh_password string
ssh_private_key string The private key to login the server. If it's empty string, we will use the system default private key from os.Getenv("SSH_AUTH_SOCK").
obfuscated_ssh_private_key string
authentication_private_key string PKCS#8 private key in PEM format. If it's empty string, no private key is required. Used for authentication when connecting to the data source.
obfuscated_authentication_private_key string
authentication_private_key_passphrase string Passphrase for the encrypted PKCS#8 private key. Only used when the private key is encrypted.
obfuscated_authentication_private_key_passphrase string
external_secret DataSourceExternalSecret
authentication_type DataSource.AuthenticationType
cloud_sql_ip_type DataSource.CloudSQLIPType cloud_sql_ip_type selects the Cloud SQL IP type for Google Cloud SQL IAM connections. CLOUD_SQL_IP_TYPE_UNSPECIFIED is treated as PUBLIC for backward compatibility.
azure_credential DataSource.AzureCredential
aws_credential DataSource.AWSCredential
gcp_credential DataSource.GCPCredential
sasl_config SASLConfig
additional_addresses DataSource.Address repeated additional_addresses is used for MongoDB replica set.
direct_connection bool direct_connection is used for MongoDB to dispatch all the operations to the node specified in the connection string.
region string Region is the location of the database, used for AWS RDS. For example, us-east-1.
warehouse_id string warehouse_id is used by Databricks.
master_name string master_name is the master name used by connecting redis-master via redis sentinel.
master_username string master_username and master_obfuscated_password are master credentials used by redis sentinel mode.
master_password string
obfuscated_master_password string
redis_type DataSource.RedisType
extra_connection_parameters DataSource.ExtraConnectionParametersEntry repeated Extra connection parameters for the database connection. For PostgreSQL HA, this can be used to set target_session_attrs=read-write
project_id string project_id and instance_id are the GCP resource identifiers. project_id is used by Spanner and BigQuery; instance_id is used by Spanner. For these engines, host and port optionally override the default Google API endpoint (e.g. a Private Service Connect endpoint like spanner-nonprod.p.googleapis.com).
instance_id string

DataSource.AWSCredential

Field Type Label Description
access_key_id string
obfuscated_access_key_id string
secret_access_key string
obfuscated_secret_access_key string
session_token string
obfuscated_session_token string
role_arn string ARN of IAM role to assume for cross-account access. See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html
external_id string Optional external ID for additional security when assuming role. See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html

DataSource.Address

Field Type Label Description
host string
port string

DataSource.AzureCredential

Field Type Label Description
tenant_id string
client_id string
client_secret string
obfuscated_client_secret string

DataSource.ExtraConnectionParametersEntry

Field Type Label Description
key string
value string

DataSource.GCPCredential

Field Type Label Description
content string
obfuscated_content string

DataSourceExternalSecret

Field Type Label Description
secret_type DataSourceExternalSecret.SecretType
url string
auth_type DataSourceExternalSecret.AuthType
app_role DataSourceExternalSecret.AppRoleAuthOption
token string
token_type DataSourceExternalSecret.TokenType How to interpret the token field when auth_type is TOKEN.
engine_name string engine name is the name for secret engine.
secret_name string the secret name in the engine to store the password.
password_key_name string the key name for the password.
skip_vault_tls_verification bool TLS configuration for connecting to Vault server. These fields are separate from the database TLS configuration in DataSource. skip_vault_tls_verification disables TLS certificate verification for Vault connections. Default is false (verification enabled) for security. Only set to true for development or when certificates cannot be properly validated.
vault_ssl_ca string CA certificate for Vault server verification.
obfuscated_vault_ssl_ca string
vault_ssl_cert string Client certificate for mutual TLS authentication with Vault.
obfuscated_vault_ssl_cert string
vault_ssl_key string Client private key for mutual TLS authentication with Vault.
obfuscated_vault_ssl_key string

DataSourceExternalSecret.AppRoleAuthOption

Field Type Label Description
role_id string
secret_id string The secret ID for the role without TTL.
type DataSourceExternalSecret.AppRoleAuthOption.SecretType
mount_path string The path where the approle auth method is mounted.

Instance

Instance is the proto for instances.

Field Type Label Description
title string
engine Engine
activation bool
version string
external_link string
data_sources DataSource repeated
sync_interval google.protobuf.Duration The interval between automatic instance synchronizations.
sync_databases SyncDatabases Enable sync for the following databases. Not set means sync all schemas & databases.
mysql_lower_case_table_names int32 The lower_case_table_names config for MySQL instances. It is used to determine whether the table names and database names are case sensitive.
last_sync_time google.protobuf.Timestamp
roles InstanceRole repeated
labels Instance.LabelsEntry repeated Labels are key-value pairs that can be attached to the instance. For example, { "org_group": "infrastructure", "environment": "production" }

Instance.LabelsEntry

Field Type Label Description
key string
value string

InstanceRole

InstanceRole is the API message for instance role.

Field Type Label Description
name string The role name.
connection_limit int32 optional The connection count limit for this role.
valid_until string optional The expiration for the role's password.
attribute string optional The role attribute. For PostgreSQL, it contains super_user, no_inherit, create_role, create_db, can_login, replication and bypass_rls. Docs: https://www.postgresql.org/docs/current/role-attributes.html For MySQL, it is the global privileges as GRANT statements, which means it only contains "GRANT ... ON . TO ...". Docs: https://dev.mysql.com/doc/refman/8.0/en/grant.html

KerberosConfig

Field Type Label Description
primary string
instance string
realm string
keytab bytes
kdc_host string
kdc_port string
kdc_transport_protocol string

SASLConfig

Field Type Label Description
krb_config KerberosConfig

SyncDatabases

Field Type Label Description
databases string repeated

DataSource.AuthenticationType

Name Number Description
AUTHENTICATION_UNSPECIFIED 0
PASSWORD 1
GOOGLE_CLOUD_SQL_IAM 2
AWS_RDS_IAM 3
AZURE_IAM 4

DataSource.CloudSQLIPType

CloudSQLIPType selects which Cloud SQL IP to dial for Google Cloud SQL IAM connections.

Name Number Description
CLOUD_SQL_IP_TYPE_UNSPECIFIED 0
PUBLIC 1
PRIVATE 2
PSC 3

DataSource.RedisType

Name Number Description
REDIS_TYPE_UNSPECIFIED 0
STANDALONE 1
SENTINEL 2
CLUSTER 3

DataSourceExternalSecret.AppRoleAuthOption.SecretType

Name Number Description
SECRET_TYPE_UNSPECIFIED 0
PLAIN 1
ENVIRONMENT 2

DataSourceExternalSecret.AuthType

Name Number Description
AUTH_TYPE_UNSPECIFIED 0
TOKEN 1 ref: https://developer.hashicorp.com/vault/docs/auth/token
VAULT_APP_ROLE 2 ref: https://developer.hashicorp.com/vault/docs/auth/approle

DataSourceExternalSecret.SecretType

Name Number Description
SECRET_TYPE_UNSPECIFIED 0
VAULT_KV_V2 1 ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2
AWS_SECRETS_MANAGER 2 ref: https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html
GCP_SECRET_MANAGER 3 ref: https://cloud.google.com/secret-manager/docs
AZURE_KEY_VAULT 4 ref: https://learn.microsoft.com/en-us/azure/key-vault/secrets/about-secrets

DataSourceExternalSecret.TokenType

Name Number Description
TOKEN_TYPE_UNSPECIFIED 0
PLAIN 1 The token field holds the literal token value.
ENVIRONMENT 2 The token field holds the name of an environment variable on the Bytebase server that holds the token value.
FILE 3 The token field holds a path to a file on the Bytebase server that holds the token value.

DataSourceType

Name Number Description
DATA_SOURCE_UNSPECIFIED 0
ADMIN 1
READ_ONLY 2

Top

store/issue.proto

Issue

Issue is the metadata for issues that track database operations and access requests.

Field Type Label Description
approval IssuePayloadApproval Approval information for the issue workflow.
role_grant RoleGrant Role grant details if this is a role grant issue.
labels string repeated Labels attached to categorize and filter the issue.
risk_level RiskLevel Risk level for the issue, calculated from statement types.
access_grant_id string The access grant id for ACCESS_GRANT type issue.
draft bool Whether this issue is a Draft Review Issue. Missing from persisted payloads means false.

RoleGrant

RoleGrant contains details for requesting a project role.

Field Type Label Description
role string The role being requested for the user. Format: roles/{role}.
user string The user who will receive the role. Format: users/{email}.
condition google.type.Expr Optional conditional expression that limits when the grant applies.
expiration google.protobuf.Duration Duration after which the grant automatically expires.

Issue.Status

Status represents the current state of the issue.

Name Number Description
ISSUE_STATUS_UNSPECIFIED 0
OPEN 1 Issue is open and pending action.
DONE 2 Issue has been completed successfully.
CANCELED 3 Issue was canceled and will not be completed.

Issue.Type

Type represents the category of issue.

Name Number Description
ISSUE_TYPE_UNSPECIFIED 0
DATABASE_CHANGE 1 Issue for database schema or data changes.
ROLE_GRANT 2 Role grant request.
ACCESS_GRANT 4 Temporary access grant request.

Top

store/plan.proto

PlanConfig

Field Type Label Description
specs PlanConfig.Spec repeated
has_rollout bool Whether the plan has started the rollout.
approval_input_version int64 Internal monotonic version for plan inputs that affect approval generation. Starts at the proto default 0 for compatibility with existing plans.

PlanConfig.ChangeDatabaseConfig

Field Type Label Description
targets string repeated The list of targets. Multi-database format: [instances/{instance-id}/databases/{database-name}]. Single database group format: [projects/{project}/databaseGroups/{databaseGroup}].
sheet_sha256 string The SHA256 hash of the sheet content (hex-encoded).
release string The resource name of the release. Format: projects/{project}/releases/{release}
enable_prior_backup bool If set, a backup of the modified data will be created automatically before any changes are applied.

PlanConfig.CreateDatabaseConfig

Field Type Label Description
target string The resource name of the instance on which the database is created. Format: instances/{instance}
database string The name of the database to create.
table string table is the name of the table, if it is not empty, Bytebase should create a table after creating the database. For example, in MongoDB, it only creates the database when we first store data in that database.
character_set string character_set is the character set of the database.
collation string collation is the collation of the database.
cluster string cluster is the cluster of the database. This is only applicable to ClickHouse for "ON CLUSTER <<cluster>>".
owner string owner is the owner of the database. This is only applicable to Postgres for "WITH OWNER <<owner>>".
environment string The environment resource. Format: environments/prod where prod is the environment resource ID.

PlanConfig.Spec

Field Type Label Description
id string A UUID4 string that uniquely identifies the Spec.
create_database_config PlanConfig.CreateDatabaseConfig
change_database_config PlanConfig.ChangeDatabaseConfig

Top

store/review_rule.proto

ReviewRuleType

ReviewRuleType mirrors bytebase.v1.ReviewRuleType. The values are shared by ReviewRulePolicy and IssueCommentPayload.ReviewMetadata.

A value is never removed, only marked deprecated: both payloads are jsonb, protojson stores the enum name, and the store's unmarshaler discards an unknown name into REVIEW_RULE_TYPE_UNSPECIFIED, which would blank the rule on every stored comment that used it.

Name Number Description
REVIEW_RULE_TYPE_UNSPECIFIED 0
SYNTAX 1
WALK_THROUGH 2
ONLINE_MIGRATION 3
PRIOR_BACKUP 4
REQUIRE_IS_NULL 5
REQUIRE_WHERE 6
DISALLOW_DROP_OBJECT 7
DISALLOW_TRUNCATE 8
DISALLOW_DROP_CONSTRAINT 9
DISALLOW_RENAME 10
REQUIRE_PRIMARY_KEY 11

Top

store/review_run.proto

ReviewRun

ReviewRun is the status slot of one reviewer (rule engine or AI) on one issue. Results live in issue comments; the run carries none.

ReviewRunPayload

Field Type Label Description
error string Fatal execution error for the FAILED status, e.g. "metadata not synced: instances/prod/databases/db1, db2, db3 (+497 more)". Written by the executor or by the reaper.
approval_input_version int64 The plan's PlanConfig.approval_input_version when the slot was reset: the version of the plan's SQL this run reviews. Completion keeps it.

ReviewRun.Status

Strictly 1:1 with the status CHECK constraint — no unpersisted values.

Name Number Description
STATUS_UNSPECIFIED 0
AVAILABLE 1
RUNNING 2
DONE 3
FAILED 4

ReviewRun.Type

The reviewer. Stored by name in review_run.type, which has no CHECK: like Issue.Type and Task.Type, the enum is the source of truth and a new reviewer is a new value, not a migration.

Name Number Description
TYPE_UNSPECIFIED 0
RULE 1 Review against the standard rules.
AI 2 Review against the natural-language AI review policy, performed by a model.

Top

store/issue_comment.proto

IssueCommentPayload

Field Type Label Description
comment string
approval IssueCommentPayload.Approval
issue_update IssueCommentPayload.IssueUpdate
plan_update IssueCommentPayload.PlanUpdate
review_submission IssueCommentPayload.ReviewSubmission
review_run_completion IssueCommentPayload.ReviewRunCompletion
statement_anchor IssueCommentPayload.StatementAnchor The statement context an inline comment references. Set at creation and immutable afterward, except that a later run reporting a review result again moves the result to its statement in the SQL that run reviewed. Never set together with an event.
review_metadata IssueCommentPayload.ReviewMetadata Present on review results only, beside the text and never together with an event. Written by the review executor; CreateIssueComment rejects it. The anchor is statement_anchor; a result without one addresses the whole change.

IssueCommentPayload.Approval

Field Type Label Description
status IssuePayloadApproval.Approver.Status

IssueCommentPayload.IssueUpdate

Field Type Label Description
from_title string optional
to_title string optional
from_description string optional
to_description string optional
from_status Issue.Status optional
to_status Issue.Status optional
from_labels string repeated
to_labels string repeated

IssueCommentPayload.PlanUpdate

PlanUpdate carries before/after snapshots of plan.config.specs, emitted once per PlanService.UpdatePlan call whose specs branch produces a non-cosmetic diff. The renderer computes per-spec add/remove/update from the snapshot pair.

Field Type Label Description
from_specs PlanConfig.Spec repeated
to_specs PlanConfig.Spec repeated

IssueCommentPayload.ReviewMetadata

ReviewMetadata is what a review result carries beyond its text: which reviewer posted it, what it was judged against, its priority, and the databases it applies to. When a run completes, an earlier result of its type whose fingerprint the run reports again keeps its thread, and the run posts no new result for it; every other earlier root of its type is resolved and marked superseded, in the transaction that posts the new results.

Field Type Label Description
run_type ReviewRun.Type The reviewer slot that posted the result; review_run.type stores the same enum by name.
rule_type ReviewRuleType The rule judged against. Set if and only if run_type is RULE.
priority IssueCommentPayload.ReviewMetadata.Priority A result merged across databases carries the highest priority among them.
targets string repeated Every database the result applies to, sorted. Always complete; the renderer collapses it when it equals the spec's target set. Format: instances/{instance}/databases/{database}
superseded bool A later run of the same reviewer has completed without reporting the result again, so the latest review does not hold it. Set by that run whatever the thread state, and never cleared.
fingerprint string Identifies the finding across runs: equal fingerprints are the same finding on the same SQL. Unique among the results of one run. Empty when the reviewer cannot tell findings apart across runs, and an empty fingerprint matches nothing.
attempt int64 The review_run.attempt of the run that posted the result. A result a later run reports again keeps its attempt.
codes string repeated The conditions a RULE result reports, as omni finding codes such as "WT101", one per reason. Empty for other reviewers.

IssueCommentPayload.ReviewRunCompletion

ReviewRunCompletion records that a review run completed DONE, and what it did to the results of its reviewer. Posted with no creator, in the transaction that posts the run's results.

Field Type Label Description
run_type ReviewRun.Type
attempt int64 The run's review_run.attempt; its new results carry the same ReviewMetadata.attempt.
posted_count int32 Results the run posted as new threads.
kept_count int32 Earlier results the run reported again, which kept their threads.
superseded_count int32 Earlier results the run no longer reports, which it superseded.

IssueCommentPayload.ReviewSubmission

ReviewSubmission records that an issue entered review.

IssueCommentPayload.StatementAnchor

StatementAnchor records the anchored statement revision and range. The SQL excerpt and current/changed/unavailable state are computed on read against the anchored sheet and the current plan, not stored.

Field Type Label Description
spec_id string UUID of the anchored plan spec (PlanConfig.Spec.id); may no longer resolve after the spec is deleted from the plan.
sheet_sha256 string SHA256 hex of the anchored sheet revision.
start_position Position The anchored range. When both columns are 0, the anchor spans whole lines from start_position.line to end_position.line inclusive — overriding Position's "column 0 means unknown" convention. When both columns are set, start_position is inclusive and end_position is exclusive, in one-based lines and code-point columns (see Position). Setting exactly one column to 0 is invalid.
end_position Position

IssueCommentPayload.ReviewMetadata.Priority

Priority says what resolving the thread means. It has no bearing on blocking: an OPEN root thread blocks whatever its priority, and a result with no thread state never does.

Name Number Description
PRIORITY_UNSPECIFIED 0
P0 1 The SQL is wrong and must change. Resolving without changing the SQL is a claim of false positive.
P1 2 Dangerous but legitimate; a person must accept it.
P2 3 Advisory.

Top

store/oauth2.proto

OAuth2AuthorizationCodeConfig

Field Type Label Description
redirect_uri string
code_challenge string
code_challenge_method string
resource string The canonical resource URI (RFC 8707) this grant is bound to, validated at consent time against the configured external URL. Empty for clients that omit the resource parameter.
scope string The single mode consented to, normalized from the client's requested scope set to its maximum. Empty means no scope was requested.

OAuth2ClientConfig

Field Type Label Description
client_name string
redirect_uris string repeated
grant_types string repeated
token_endpoint_auth_method string

OAuth2RefreshTokenConfig

OAuth2RefreshTokenConfig is the consented grant state carried from the authorization code onto every refresh token issued from it, and re-issued unchanged by each refresh. Kept as a message rather than flat columns so the grant can gain fields without a schema migration.

Field Type Label Description
resource string The canonical resource URI (RFC 8707) this grant is bound to, validated at consent time against the configured external URL. Empty for clients that omit the resource parameter.
scope string The single mode consented to, normalized from the client's requested scope set to its maximum. Empty means no scope was requested.

Top

store/plan_check_run.proto

ChangedResourceDatabase

Field Type Label Description
name string
schemas ChangedResourceSchema repeated

ChangedResourceSchema

Field Type Label Description
name string
tables ChangedResourceTable repeated

ChangedResourceTable

Field Type Label Description
name string
table_rows int64 The estimated row count of the table.

ChangedResources

Field Type Label Description
databases ChangedResourceDatabase repeated

PlanCheckRunResult

Field Type Label Description
results PlanCheckRunResult.Result repeated
error string
approval_input_version int64 The plan approval input version this check run was created for.

PlanCheckRunResult.Result

Field Type Label Description
status Advice.Status
title string
content string
code int32
target string Target identification for consolidated results Format: instances/{instance}/databases/{database}
type PlanCheckType
sheet_sha256 string sheet_sha256 is the content hash of the SQL sheet used to produce this result. Empty for checks that are not tied to a SQL sheet.
sql_summary_report PlanCheckRunResult.Result.SqlSummaryReport
sql_review_report PlanCheckRunResult.Result.SqlReviewReport

PlanCheckRunResult.Result.SqlReviewReport

Field Type Label Description
start_position Position Position of the SQL statement.
end_position Position

PlanCheckRunResult.Result.SqlSummaryReport

Field Type Label Description
statement_types StatementType repeated statement_types are the types of statements found in the SQL.
affected_rows int64
changed_resources ChangedResources

PlanCheckType

Name Number Description
PLAN_CHECK_TYPE_UNSPECIFIED 0
PLAN_CHECK_TYPE_STATEMENT_ADVISE 1
PLAN_CHECK_TYPE_STATEMENT_SUMMARY_REPORT 2
PLAN_CHECK_TYPE_GHOST_SYNC 3

Top

store/policy.proto

Binding

Field Type Label Description
role string The role that is assigned to the members. Format: roles/{role}
members string repeated Specifies the principals requesting access for a Bytebase resource. For users, the member should be: users/{email} For groups, the member should be: groups/{email}
condition google.type.Expr The condition that is associated with this binding. 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.

IamPolicy

Field Type Label Description
bindings Binding repeated Collection of binding. A binding binds one or more members or groups to a single role.

MaskingExemptionPolicy

MaskingExemptionPolicy is the allowlist of users who can access sensitive data.

Field Type Label Description
exemptions MaskingExemptionPolicy.Exemption repeated

MaskingExemptionPolicy.Exemption

Field Type Label Description
members string repeated Members who bind to this exemption.

Format: users/{email} or groups/{group email} | | condition | google.type.Expr | | The condition that is associated with this exception policy instance. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec If the condition is empty, means the user can access all databases without expiration.

Support variables: resource.instance_id: the instance resource id. Only support "==" operation. resource.database_name: the database name. Only support "==" operation. resource.schema_name: the schema name. Only support "==" operation. resource.table_name: the table name. Only support "==" operation. resource.column_name: the column name. Only support "==" operation. request.time: the expiration. Only support "<" operation in request.time &lt; timestamp(&#34;{ISO datetime string format}&#34;) All variables should join with "&&" condition.

For example: resource.instance_id == "local" && resource.database_name == "employee" && request.time < timestamp("2025-04-30T11:10:39.000Z") resource.instance_id == "local" && resource.database_name == "employee" |

MaskingRulePolicy

Field Type Label Description
rules MaskingRulePolicy.MaskingRule repeated

MaskingRulePolicy.MaskingRule

Field Type Label Description
id string A unique identifier for a node in UUID format.
condition google.type.Expr
semantic_type string

Policy

QueryDataPolicy

QueryDataPolicy is the policy configuration for querying data in the SQL Editor.

Field Type Label Description
maximum_result_rows int32 Support both project-level and workspace-level. The maximum number of rows to return in the SQL editor. The default value <= 0, means no limit.
disable_copy_data bool workspace-level policy Disable copying data.
allow_admin_data_source bool workspace-level policy Allow using the admin data source to query in the SQL editor.
disable_download bool workspace-level policy Disable the Download export destination. Exports can still go to a configured storage destination such as SharePoint.
disallow_ddl bool ================ Deprecate following fields. Disallow running DDL statements in the SQL editor.
disallow_dml bool Disallow running DML statements in the SQL editor.

ReviewAIPolicy

ReviewAIPolicy holds the natural-language policy the AI review judges a change against. Both levels apply: the workspace policy and the project policy both reach the reviewer, and the project policy wins where they conflict.

Field Type Label Description
content string

ReviewRulePolicy

ReviewRulePolicy is the standard review rule switch. The nearest policy wins: the project's if it has one, else the workspace's, else every rule.

Field Type Label Description
rules ReviewRuleType repeated

RolloutPolicy

Field Type Label Description
automatic bool
roles string repeated

TagPolicy

Field Type Label Description
tags TagPolicy.TagsEntry repeated tags is the key-value map for resources. For example, the environment resource can have the SQL review config tag, such as "bb.tag.review_config": "reviewConfigs/{review config resource id}".

TagPolicy.TagsEntry

Field Type Label Description
key string
value string

Policy.Resource

Name Number Description
RESOURCE_UNSPECIFIED 0
WORKSPACE 1
ENVIRONMENT 2
PROJECT 3

Policy.Type

Name Number Description
TYPE_UNSPECIFIED 0
ROLLOUT 1
MASKING_EXEMPTION 2
QUERY_DATA 3
MASKING_RULE 4
IAM 5
TAG 6
REVIEW_RULE 7
REVIEW_AI 8

Top

store/project.proto

Label

Label represents a categorization tag that can be applied to issues.

Field Type Label Description
value string The display text of the label.
color google.type.Color The color for the label.
group string Optional group name for organizing related labels.

Project

Project contains settings and configuration for a Bytebase project.

Field Type Label Description
issue_labels Label repeated Available labels that can be applied to issues in this project.
force_issue_labels bool Force issue labels to be used when creating an issue.
enforce_issue_title bool Enforce issue title created by user instead of generated by Bytebase.
postgres_database_tenant_mode bool Whether to enable the database tenant mode for PostgreSQL. If enabled, the issue will be created with the prepend "set role <db_owner>" statement.
allow_self_approval bool Whether to allow the issue creator to self-approve the issue.
execution_retry_policy Project.ExecutionRetryPolicy Configuration for automatic retry on task execution failures.
ci_sampling_size int32 The maximum number of databases to sample during CI data validation and AI review. If not specified, sampling is disabled, resulting in a full validation.
parallel_tasks_per_rollout int32 The maximum number of parallel tasks to run during the rollout.
labels Project.LabelsEntry repeated Labels are key-value pairs that can be attached to the project. For example, { "environment": "production", "team": "backend" }
enforce_sql_review bool Whether to enforce SQL review checks to pass before issue creation. If enabled, issues cannot be created when SQL review finds errors.
require_issue_approval bool Whether issue approval is required before proceeding with rollout.
require_plan_check_no_error bool Whether to block rollout when plan check finds errors.
allow_request_role bool
data_classification_config_id string The data classification configuration ID for the project.
allow_just_in_time_access bool Once enabled, users can request and use the just-in-time access in the SQL Editor.
allow_last_plan_editor_approval bool Whether to allow the last Plan editor to approve a database change issue.
export_setting Project.ExportSetting Destinations offered for this project's exports.

Project.ExecutionRetryPolicy

ExecutionRetryPolicy defines retry behavior for failed task executions.

Field Type Label Description
maximum_retries int32 The maximum number of retry attempts for lock timeout errors.

Project.ExportSetting

Field Type Label Description
sharepoint Project.SharePointDestination

Project.LabelsEntry

Field Type Label Description
key string
value string

Project.SharePointDestination

Field Type Label Description
url string The canonical URL of a SharePoint document library root or folder.

Top

store/project_webhook.proto

Activity

Activity types for webhook notifications.

ProjectWebhook

Field Type Label Description
type WebhookType Webhook type.
title string Webhook title.
url string Webhook URL.
activities Activity.Type repeated List of activities that trigger this webhook.
direct_message bool If direct_message is set, the notification is sent directly to the persons and url will be ignored. IM integration setting should be set for this function to work.

Activity.Type

Activity type enumeration.

Name Number Description
TYPE_UNSPECIFIED 0 Unspecified type.
ISSUE_CREATED 10 ISSUE_CREATED represents a new issue creation event.
ISSUE_APPROVAL_REQUESTED 11 ISSUE_APPROVAL_REQUESTED represents an approval request event.
ISSUE_SENT_BACK 12 ISSUE_SENT_BACK represents an issue being sent back by an approver.
PIPELINE_FAILED 13 PIPELINE_FAILED represents a pipeline failure event.
PIPELINE_COMPLETED 14 PIPELINE_COMPLETED represents a pipeline completion event.
ISSUE_APPROVED 15 ISSUE_APPROVED represents an issue being fully approved.

Top

store/query_history.proto

QueryHistoryPayload

Field Type Label Description
error string optional
duration google.protobuf.Duration

Top

store/release.proto

ReleasePayload

Field Type Label Description
files ReleasePayload.File repeated
vcs_source ReleasePayload.VCSSource
type SchemaChangeType

ReleasePayload.File

Field Type Label Description
path string The path of the file, e.g., 2.2/V0001_create_table.sql.
sheet_sha256 string The SHA256 hash of the sheet content (hex-encoded).
version string

ReleasePayload.VCSSource

Field Type Label Description
vcs_type VCSType
url string

Top

store/review_config.proto

ReviewConfigPayload

Field Type Label Description
sql_review_rules SQLReviewRule repeated

SQLReviewRule

Field Type Label Description
type SQLReviewRule.Type
level SQLReviewRule.Level
naming_payload SQLReviewRule.NamingRulePayload
number_payload SQLReviewRule.NumberRulePayload
string_array_payload SQLReviewRule.StringArrayRulePayload
comment_convention_payload SQLReviewRule.CommentConventionRulePayload
string_payload SQLReviewRule.StringRulePayload
naming_case_payload SQLReviewRule.NamingCaseRulePayload
engine Engine

SQLReviewRule.CommentConventionRulePayload

Field Type Label Description
required bool
max_length int32

SQLReviewRule.NamingCaseRulePayload

Field Type Label Description
upper bool

SQLReviewRule.NamingRulePayload

Payload message types for SQL review rules

Field Type Label Description
max_length int32
format string

SQLReviewRule.NumberRulePayload

Field Type Label Description
number int32

SQLReviewRule.StringArrayRulePayload

Field Type Label Description
list string repeated

SQLReviewRule.StringRulePayload

Field Type Label Description
value string

SQLReviewRule.Level

The severity level for SQL review rules.

Name Number Description
LEVEL_UNSPECIFIED 0 Unspecified level.
ERROR 1 Rule violation is an error.
WARNING 2 Rule violation is a warning.

SQLReviewRule.Type

Name Number Description
TYPE_UNSPECIFIED 0
ENGINE_MYSQL_USE_INNODB 1
NAMING_FULLY_QUALIFIED 2
NAMING_TABLE 3
NAMING_COLUMN 4
NAMING_INDEX_PK 5
NAMING_INDEX_UK 6
NAMING_INDEX_FK 7
NAMING_INDEX_IDX 8
NAMING_COLUMN_AUTO_INCREMENT 9
NAMING_TABLE_NO_KEYWORD 10
NAMING_IDENTIFIER_NO_KEYWORD 11
NAMING_IDENTIFIER_CASE 12
STATEMENT_SELECT_NO_SELECT_ALL 13
STATEMENT_WHERE_REQUIRE_SELECT 14
STATEMENT_WHERE_REQUIRE_UPDATE_DELETE 15
STATEMENT_WHERE_NO_LEADING_WILDCARD_LIKE 16
STATEMENT_DISALLOW_ON_DEL_CASCADE 17
STATEMENT_DISALLOW_RM_TBL_CASCADE 18
STATEMENT_DISALLOW_COMMIT 19
STATEMENT_DISALLOW_LIMIT 20
STATEMENT_DISALLOW_ORDER_BY 21
STATEMENT_MERGE_ALTER_TABLE 22
STATEMENT_INSERT_ROW_LIMIT 23
STATEMENT_INSERT_MUST_SPECIFY_COLUMN 24
STATEMENT_INSERT_DISALLOW_ORDER_BY_RAND 25
STATEMENT_AFFECTED_ROW_LIMIT 26
STATEMENT_DML_DRY_RUN 27
STATEMENT_DISALLOW_ADD_COLUMN_WITH_DEFAULT 28
STATEMENT_ADD_CHECK_NOT_VALID 29
STATEMENT_ADD_FOREIGN_KEY_NOT_VALID 30
STATEMENT_DISALLOW_ADD_NOT_NULL 31
STATEMENT_CREATE_SPECIFY_SCHEMA 33
STATEMENT_CHECK_SET_ROLE_VARIABLE 34
STATEMENT_WHERE_NO_EQUAL_NULL 37
STATEMENT_WHERE_DISALLOW_FUNCTIONS_AND_CALCULATIONS 38
STATEMENT_WHERE_MAXIMUM_LOGICAL_OPERATOR_COUNT 40
STATEMENT_MAXIMUM_STATEMENTS_IN_TRANSACTION 43
STATEMENT_NON_TRANSACTIONAL 45
STATEMENT_ADD_COLUMN_WITHOUT_POSITION 46
STATEMENT_DISALLOW_OFFLINE_DDL 47
STATEMENT_DISALLOW_CROSS_DB_QUERIES 48
STATEMENT_MAX_EXECUTION_TIME 49
STATEMENT_REQUIRE_ALGORITHM_OPTION 50
STATEMENT_REQUIRE_LOCK_OPTION 51
STATEMENT_OBJECT_OWNER_CHECK 52
TABLE_REQUIRE_PK 53
TABLE_NO_FOREIGN_KEY 54
TABLE_DROP_NAMING_CONVENTION 55
TABLE_COMMENT 56
TABLE_DISALLOW_PARTITION 57
TABLE_DISALLOW_TRIGGER 58
TABLE_NO_DUPLICATE_INDEX 59
TABLE_TEXT_FIELDS_TOTAL_LENGTH 60
TABLE_DISALLOW_SET_CHARSET 61
TABLE_DISALLOW_DDL 62
TABLE_DISALLOW_DML 63
TABLE_LIMIT_SIZE 64
TABLE_REQUIRE_CHARSET 65
TABLE_REQUIRE_COLLATION 66
COLUMN_REQUIRED 67
COLUMN_NO_NULL 68
COLUMN_DISALLOW_CHANGE_TYPE 69
COLUMN_SET_DEFAULT_FOR_NOT_NULL 70
COLUMN_DISALLOW_CHANGE 71
COLUMN_DISALLOW_CHANGING_ORDER 72
COLUMN_DISALLOW_DROP 73
COLUMN_DISALLOW_DROP_IN_INDEX 74
COLUMN_COMMENT 75
COLUMN_AUTO_INCREMENT_MUST_INTEGER 76
COLUMN_TYPE_DISALLOW_LIST 77
COLUMN_DISALLOW_SET_CHARSET 78
COLUMN_MAXIMUM_CHARACTER_LENGTH 79
COLUMN_MAXIMUM_VARCHAR_LENGTH 80
COLUMN_AUTO_INCREMENT_INITIAL_VALUE 81
COLUMN_AUTO_INCREMENT_MUST_UNSIGNED 82
COLUMN_CURRENT_TIME_COUNT_LIMIT 83
COLUMN_REQUIRE_DEFAULT 84
COLUMN_DEFAULT_DISALLOW_VOLATILE 85
COLUMN_ADD_NOT_NULL_REQUIRE_DEFAULT 86
COLUMN_REQUIRE_CHARSET 87
COLUMN_REQUIRE_COLLATION 88
SCHEMA_BACKWARD_COMPATIBILITY 89
DATABASE_DROP_EMPTY_DATABASE 90
INDEX_NO_DUPLICATE_COLUMN 91
INDEX_KEY_NUMBER_LIMIT 92
INDEX_PK_TYPE_LIMIT 93
INDEX_TYPE_NO_BLOB 94
INDEX_TOTAL_NUMBER_LIMIT 95
INDEX_PRIMARY_KEY_TYPE_ALLOWLIST 96
INDEX_CREATE_CONCURRENTLY 97
INDEX_TYPE_ALLOW_LIST 98
INDEX_NOT_REDUNDANT 99
SYSTEM_CHARSET_ALLOWLIST 100
SYSTEM_COLLATION_ALLOWLIST 101
SYSTEM_COMMENT_LENGTH 102
SYSTEM_PROCEDURE_DISALLOW_CREATE 103
SYSTEM_EVENT_DISALLOW_CREATE 104
SYSTEM_VIEW_DISALLOW_CREATE 105
SYSTEM_FUNCTION_DISALLOW_CREATE 106
SYSTEM_FUNCTION_DISALLOWED_LIST 107
ADVICE_ONLINE_MIGRATION 108
BUILTIN_PRIOR_BACKUP_CHECK 109
BUILTIN_WALK_THROUGH_CHECK 110
STATEMENT_DISALLOW_TRUNCATE 111
BUILTIN_STATEMENT_MAXIMUM_SQL_SIZE 112

Top

store/revision.proto

RevisionPayload

Field Type Label Description
release string Format: projects/{project}/releases/{release} Can be empty.
file string The file filepath. Can be empty.
sheet_sha256 string The SHA256 hash of the sheet content (hex-encoded).
task_run string The task run associated with the revision. Can be empty. Format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}/taskRuns/{taskRun}
type SchemaChangeType The type of the revision.
project string The project that authored this revision's change — where the plan or release that produced it ran. Stamped by the server at creation from the database's then-current project; rows predating the field are backfilled from corroborated provenance (migration 3.22.5). Not a scope: revisions stay keyed by (instance, db_name) and follow the database across project transfers, while the statement's sheet stays readable under this project. Can be empty when no owner could be corroborated; such statements are unreadable and the revision carries no sheet name.

Top

store/role.proto

RolePermissions

Field Type Label Description
permissions string repeated

Top

store/sample_instance.proto

SaaSSampleInstanceSetupPayload

Field Type Label Description
project_id string
instance_id string
title string
environment_id string optional
database_name string
role_name string

SelfHostSampleInstanceSetupPayload

Field Type Label Description
instances SelfHostSampleInstanceSetupPayload.Instance repeated

SelfHostSampleInstanceSetupPayload.Instance

Field Type Label Description
instance_id string
title string
environment_id string optional
port_offset int32
database_name string
role_name string
project_id string optional

Top

store/saved_query.proto

SavedQueryBinding

One grant on a saved query. Stored in saved_query.bindings, which holds a protojson array of these messages at the jsonb root rather than a wrapper object, so the @&gt; containment probes the access queries run hit the GIN index directly.

Field Type Label Description
level SavedQueryBinding.Level
members string repeated Principals in the same resource-name form the IAM policy payloads use: "users/{email}" and "groups/{email}". The v1 API takes the binding form ("user:", "group:") and converts once on write, as the project policy does. Groups are named by reference and never expanded.

SavedQueryPayload

Field Type Label Description
database string The connected database, stored as its canonical resource name: instances/{instance}/databases/{database} for a workspace instance, projects/{project}/instances/{instance}/databases/{database} for a project instance. Validated against the saved query's own project at write time; the reference is soft and may dangle after the database is deleted or transferred, degrading to "no database" in the UI.

SavedQueryBinding.Level

Name Number Description
LEVEL_UNSPECIFIED 0
VIEWER 1
EDITOR 2

Top

store/server_config.proto

ServerConfigPayload

ServerConfigPayload stores global server-level infrastructure configuration. Only contains settings that are truly cross-workspace and cannot be derived from any workspace context (e.g., JWT signing secret). All other settings live in per-workspace WORKSPACE_PROFILE.

Field Type Label Description
auth_secret string Authentication secret for token signing (32-character random string).

Top

store/setting.proto

AISetting

Field Type Label Description
enabled bool
provider AISetting.Provider
endpoint string
api_key string
model string
version string
sql_review_enabled bool Whether the AI SQL review may run. It is a consent of its own beside enabled, because a review sends the statements of a change to the provider and can send the schema of its target databases.

Algorithm

Field Type Label Description
full_mask Algorithm.FullMask
range_mask Algorithm.RangeMask
md5_mask Algorithm.MD5Mask
inner_outer_mask Algorithm.InnerOuterMask

Algorithm.FullMask

Field Type Label Description
substitution string substitution is the string used to replace the original value, the max length of the string is 16 bytes.

Algorithm.InnerOuterMask

Field Type Label Description
prefix_len int32
suffix_len int32
type Algorithm.InnerOuterMask.MaskType
substitution string

Algorithm.MD5Mask

Field Type Label Description
salt string salt is the salt value to generate a different hash that with the word alone.

Algorithm.RangeMask

Field Type Label Description
slices Algorithm.RangeMask.Slice repeated We store it as a repeated field to face the fact that the original value may have multiple parts should be masked. But frontend can be started with a single rule easily.

Algorithm.RangeMask.Slice

Field Type Label Description
start int32 start is the start character index (0-based) of the original value, should be less than end. Uses character indices (not byte offsets) for display-oriented masking. Example: For "你好world", character index 2 refers to 'w' (the 3rd character).
end int32 end is the end character index (exclusive) of the original value. Uses character indices (not byte offsets) for display-oriented masking.
substitution string OriginalValue[start:end) would be replaced with substitution.

AppIMSetting

Field Type Label Description
settings AppIMSetting.IMSetting repeated

AppIMSetting.DingTalk

Field Type Label Description
client_id string
client_secret string
robot_code string

AppIMSetting.Feishu

Field Type Label Description
app_id string
app_secret string

AppIMSetting.IMSetting

Field Type Label Description
type WebhookType
slack AppIMSetting.Slack
feishu AppIMSetting.Feishu
wecom AppIMSetting.Wecom
lark AppIMSetting.Lark
dingtalk AppIMSetting.DingTalk
teams AppIMSetting.Teams

AppIMSetting.Lark

Field Type Label Description
app_id string
app_secret string

AppIMSetting.Slack

Field Type Label Description
token string

AppIMSetting.Teams

Field Type Label Description
tenant_id string Azure AD tenant ID (Directory ID).
client_id string Azure AD application (client) ID.
client_secret string Azure AD client secret.

AppIMSetting.Wecom

Field Type Label Description
corp_id string
agent_id string
secret string

DataClassificationSetting

Field Type Label Description
configs DataClassificationSetting.DataClassificationConfig repeated

DataClassificationSetting.DataClassificationConfig

Field Type Label Description
id string id is the uuid for classification. Each project can chose one classification config.
title string
levels DataClassificationSetting.DataClassificationConfig.Level repeated levels is user defined level list for classification.
classification DataClassificationSetting.DataClassificationConfig.ClassificationEntry repeated classification is the id - DataClassification map. The id should in [0-9]+-[0-9]+-[0-9]+ format.

DataClassificationSetting.DataClassificationConfig.ClassificationEntry

Field Type Label Description
key string
value DataClassificationSetting.DataClassificationConfig.DataClassification

DataClassificationSetting.DataClassificationConfig.DataClassification

Field Type Label Description
id string id is the classification id in [0-9]+-[0-9]+-[0-9]+ format.
title string
level int32 optional The sensitivity level. Maps to Level.level.

DataClassificationSetting.DataClassificationConfig.Level

Field Type Label Description
title string
level int32 The numeric level for ordering. Higher = more sensitive.

EmailSetting

Field Type Label Description
from string
from_name string
type EmailSetting.Type
smtp EmailSetting.SMTPConfig

EmailSetting.SMTPConfig

Field Type Label Description
host string
port int32
username string
password string
encryption EmailSetting.SMTPConfig.Encryption
authentication EmailSetting.SMTPConfig.Authentication

EnvironmentSetting

Field Type Label Description
environments EnvironmentSetting.Environment repeated

EnvironmentSetting.Environment

Field Type Label Description
name string
id string The resource id of the environment. This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
title string The display name of the environment.
tags EnvironmentSetting.Environment.TagsEntry repeated
color google.type.Color

EnvironmentSetting.Environment.TagsEntry

Field Type Label Description
key string
value string

ExportSetting

ExportSetting holds each export destination provider's credentials.

Field Type Label Description
sharepoint SharePointSetting

MCPSetting

MCPSetting is what an MCP (Model Context Protocol) session may do in this workspace. It is its own setting rather than a field of the workspace profile because the set grows, and because the /mcp kill switch reads it on every request and should not share a row — or a parse failure — with branding and sign-in configuration.

Field Type Label Description
capability MCPSetting.Capability The maximum capability available to MCP sessions in this workspace, acting as an admin-set ceiling. Enforced server-side at three points: the /mcp endpoint decides whether a connection is admitted at all, the ceiling gate on the internal MCP chain decides, per request, which method classes are served, and under READ_ONLY the SQL clamp decides, per statement, whether it only reads.

SQLEditorThemeSetting

Field Type Label Description
id string
name string
monaco_base string
tokens SQLEditorThemeSetting.TokensEntry repeated CSS token colors.

SQLEditorThemeSetting.TokensEntry

Field Type Label Description
key string
value google.type.Color

SemanticTypeSetting

Field Type Label Description
types SemanticTypeSetting.SemanticType repeated

SemanticTypeSetting.SemanticType

Field Type Label Description
id string id is the uuid for semantic type.
title string the title of the semantic type, it should not be empty.
description string the description of the semantic type, it can be empty.
algorithm Algorithm
icon string icon is the icon for semantic type, it can be emoji or base64 encoded image.

SharePointSetting

SharePointSetting is the Microsoft Entra application that uploads exports to SharePoint.

Field Type Label Description
tenant_id string
client_id string
client_secret string

SystemSetting

Field Type Label Description
license string Enterprise license JWT token.

WorkspaceApprovalSetting

Field Type Label Description
rules WorkspaceApprovalSetting.Rule repeated

WorkspaceApprovalSetting.Rule

Field Type Label Description
template ApprovalTemplate
condition google.type.Expr
source WorkspaceApprovalSetting.Rule.Source

WorkspaceProfileSetting

Field Type Label Description
external_url string The external URL is used for sso authentication callback.
disallow_signup bool Disallow self-service signup, users can only be invited by the owner.
require_2fa bool Require 2FA for all users.
refresh_token_duration google.protobuf.Duration The duration for refresh token. Default is 7 days.
announcement WorkspaceProfileSetting.Announcement The setting of custom announcement
maximum_request_expiration google.protobuf.Duration The max expiration duration for data access requests.
domains string repeated The workspace domain, e.g., bytebase.com.
enforce_identity_domain bool Only user and group from the domains can be created and login.
database_change_mode WorkspaceProfileSetting.DatabaseChangeMode The workspace database change mode.
disallow_password_signin bool Whether password sign-in is disabled for all end users.
enable_metric_collection bool Whether to enable metric collection for the workspace.
inactive_session_timeout google.protobuf.Duration The session expiration time if not activity detected for the user. Value <= 0 means no limit.
enable_audit_log_stdout bool Whether to enable audit logging to stdout in structured JSON format. Requires TEAM or ENTERPRISE license.
watermark bool Whether to display watermark on pages. Requires ENTERPRISE license.
password_restriction WorkspaceProfileSetting.PasswordRestriction Password restriction settings.
access_token_duration google.protobuf.Duration The duration for access token. Default is 1 hour.
enable_debug bool Whether debug mode is enabled.
sql_result_size int64 The maximum result size limit in bytes for query and export, works for the SQL Editor and Export Center. The default value is 100MB, we will use the default value if the setting not exists, or the limit <= 0.
query_timeout google.protobuf.Duration The query timeout duration for query and export, works for the SQL Editor and Export Center.
allow_email_code_signin bool Allow signin/signup using email + a 6-digit one-time verification code. Requires the EMAIL setting to be configured on the workspace.
sql_editor_theme_id string Enforced SQL Editor theme id: OPAQUE — a frontend-resolved built-in preset id OR a custom theme's uuid. Empty ⇒ default light.
sql_editor_custom_theme SQLEditorThemeSetting The enforced CUSTOM theme's full definition — present ONLY when sql_editor_theme_id is a custom uuid. tokens is always complete.
maximum_role_expiration google.protobuf.Duration The max expiration duration for request role. Deprecated: use just-in-time access request flows instead.
directory_sync_token_hash string Hex-encoded SHA-256 of the SCIM directory sync token. The plaintext is shown once at rotation and never stored. SHA-256 rather than a slow KDF because the token is 122 bits of crypto/rand, not a human-chosen secret.

WorkspaceProfileSetting.Announcement

Field Type Label Description
text string The text of the announcement.
link string The optional link, user can follow the link to check extra details
theme WorkspaceProfileSetting.Announcement.AnnouncementTheme Banner colors. Built-in presets (info/warning/critical) are a frontend-only concept that seeds these colors; the store only holds them.

WorkspaceProfileSetting.Announcement.AnnouncementTheme

Field Type Label Description
background google.type.Color
text google.type.Color

WorkspaceProfileSetting.PasswordRestriction

Field Type Label Description
min_length int32 min_length is the minimum password length. It must be at least 8.
require_number bool require_number requires the password to contain at least one number.
require_letter bool require_letter requires the password to contain at least one letter, either uppercase or lowercase.
require_uppercase_letter bool require_uppercase_letter requires the password to contain at least one uppercase letter.
require_special_character bool require_special_character requires the password to contain at least one special character.
require_reset_password_for_first_login bool require_reset_password_for_first_login requires users to change their password after their first login.
password_rotation google.protobuf.Duration password_rotation requires users to change their password after the duration.

AISetting.Provider

Name Number Description
PROVIDER_UNSPECIFIED 0
OPEN_AI 1
CLAUDE 2
GEMINI 3
AZURE_OPENAI 4

Algorithm.InnerOuterMask.MaskType

Name Number Description
MASK_TYPE_UNSPECIFIED 0
INNER 1
OUTER 2

EmailSetting.SMTPConfig.Authentication

Name Number Description
AUTHENTICATION_UNSPECIFIED 0
AUTHENTICATION_NONE 1
PLAIN 2
LOGIN 3
CRAM_MD5 4

EmailSetting.SMTPConfig.Encryption

Name Number Description
ENCRYPTION_UNSPECIFIED 0
ENCRYPTION_NONE 1
STARTTLS 2
SSL_TLS 3

EmailSetting.Type

Name Number Description
TYPE_UNSPECIFIED 0
SMTP 1

MCPSetting.Capability

Capability is the ceiling: a session runs at this level or lower.

Name Number Description
CAPABILITY_UNSPECIFIED 0
DISABLED 1 MCP connections are rejected.
READ_ONLY 3 MCP may inspect metadata and run read-only queries. (Enforced from P1b.)
READ_WRITE 4 MCP may perform mutations, still bounded by the user's RBAC.

SettingName

Name Number Description
SETTING_NAME_UNSPECIFIED 0
SYSTEM 1
WORKSPACE_PROFILE 2
WORKSPACE_APPROVAL 3
APP_IM 4
AI 5
DATA_CLASSIFICATION 6
SEMANTIC_TYPES 7
ENVIRONMENT 8
EMAIL 9
MCP 10
EXPORT 11

WorkspaceApprovalSetting.Rule.Source

Name Number Description
SOURCE_UNSPECIFIED 0
CHANGE_DATABASE 1
CREATE_DATABASE 2
EXPORT_DATA 3
REQUEST_ROLE 4
REQUEST_ACCESS 5

WorkspaceProfileSetting.DatabaseChangeMode

Name Number Description
DATABASE_CHANGE_MODE_UNSPECIFIED 0
PIPELINE 1 A more advanced database change process, including custom approval workflows and other advanced features. Default to this mode.
EDITOR 2 A simple database change process in SQL editor. Users can execute SQL directly.

Top

store/signal.proto

Signal

Signal represents a notification payload sent via PostgreSQL NOTIFY for HA coordination.

Field Type Label Description
type Signal.Type
uid int64
project string
approval_input_version int64

Signal.Type

Type represents the type of signal.

Name Number Description
TYPE_UNSPECIFIED 0
CANCEL_PLAN_CHECK_RUN 1
CANCEL_TASK_RUN 2

Top

store/subscription.proto

SubscriptionPayload

SubscriptionPayload stores all subscription data for a workspace. Serialized as JSONB in the subscription table's payload column.

Field Type Label Description
status SubscriptionPayload.Status Lifecycle
started_at google.protobuf.Timestamp
expires_at google.protobuf.Timestamp
plan SubscriptionPayload.Plan Billing details
interval SubscriptionPayload.BillingInterval
seat int32
instance_count int32
stripe_subscription_id string Stripe integration
stripe_customer_id string

SubscriptionPayload.BillingInterval

Name Number Description
BILLING_INTERVAL_UNSPECIFIED 0
MONTH 1
YEAR 2

SubscriptionPayload.Plan

Name Number Description
PLAN_UNSPECIFIED 0
TEAM 1
ENTERPRISE 2

SubscriptionPayload.Status

Name Number Description
STATUS_UNSPECIFIED 0
ACTIVE 1
PAUSED 2
CANCELED 3

Top

store/task.proto

Task

Task is the metadata for database operation tasks.

Field Type Label Description
skipped bool Whether the task was skipped during execution.
skipped_reason string Reason why the task was skipped.
spec_id string UUID that identifies the spec this task implements.
sheet_sha256 string The SHA256 hash of a single sheet content (hex-encoded). Used for non-release tasks.
release string The release resource name: projects/{project}/releases/{release}. Used for GitOps release-based tasks that execute multiple files.
enable_prior_backup bool Whether to create an automatic backup before applying changes.

Task.Type

Type represents the type of database operation to perform.

Name Number Description
TASK_TYPE_UNSPECIFIED 0
DATABASE_CREATE 1 Create a new database.
DATABASE_MIGRATE 2 Apply schema/data migrations to an existing database. Execution strategy is determined by release type (VERSIONED/DECLARATIVE) or sheet content for non-release tasks.

Top

store/task_run.proto

SchedulerInfo

SchedulerInfo contains information about task scheduling and execution delays.

Field Type Label Description
report_time google.protobuf.Timestamp Timestamp when the scheduler reported this information.
waiting_cause SchedulerInfo.WaitingCause Reason why the task run is currently waiting.

SchedulerInfo.WaitingCause

WaitingCause indicates why a task run is waiting to execute.

Field Type Label Description
parallel_tasks_limit bool Task is waiting due to parallel execution limit.

TaskRun

TaskRun represents an execution attempt of a task.

TaskRunPayload

TaskRunPayload contains extensible runtime data for a task run. Stored in the payload JSONB column. New fields can be added here without database schema changes.

Field Type Label Description
scheduler_info SchedulerInfo Scheduler information about why a task is waiting.
skip_prior_backup bool If true, prior backup is skipped for this task run.

TaskRunResult

TaskRunResult contains the outcome and metadata from a task run execution.

Field Type Label Description
detail string Error message for failed task runs. Empty for successful or canceled runs.
has_prior_backup bool Indicates whether a prior backup was created for this task run. When true, the task run can be rolled back using the backup tables. Backup details are available in the task run logs (PRIOR_BACKUP log entries).

TaskRun.Status

Status represents the current execution state of a task run.

Name Number Description
STATUS_UNSPECIFIED 0
PENDING 1 Task run is queued and waiting to execute.
RUNNING 2 Task run is currently executing.
DONE 3 Task run completed successfully.
FAILED 4 Task run encountered an error and failed.
CANCELED 5 Task run was canceled by user or system.
NOT_STARTED 6 Task run has not started yet.
SKIPPED 7 Task run was skipped and will not execute.
AVAILABLE 8 Task run is ready for immediate execution.

Top

store/task_run_log.proto

PriorBackupDetail

PriorBackupDetail contains information about automatic backups created before migration.

Field Type Label Description
items PriorBackupDetail.Item repeated List of backup operations performed.

PriorBackupDetail.Item

Item represents a single backup operation for a table.

Field Type Label Description
source_table PriorBackupDetail.Item.Table The original table that was backed up.
target_table PriorBackupDetail.Item.Table The backup table where data was copied.
start_position Position Starting position in SQL for this backup operation.
end_position Position Ending position in SQL for this backup operation.

PriorBackupDetail.Item.Table

Table identifies a database table.

Field Type Label Description
database string The database containing the table. Format: instances/{instance}/databases/{database}
schema string Schema name (for databases that support schemas).
table string Table name.

TaskRunLog

Field Type Label Description
type TaskRunLog.Type
replica_id string
schema_dump_start TaskRunLog.SchemaDumpStart
schema_dump_end TaskRunLog.SchemaDumpEnd
command_execute TaskRunLog.CommandExecute
command_response TaskRunLog.CommandResponse
database_sync_start TaskRunLog.DatabaseSyncStart
database_sync_end TaskRunLog.DatabaseSyncEnd
transaction_control TaskRunLog.TransactionControl
prior_backup_start TaskRunLog.PriorBackupStart
prior_backup_end TaskRunLog.PriorBackupEnd
retry_info TaskRunLog.RetryInfo
compute_diff_start TaskRunLog.ComputeDiffStart
compute_diff_end TaskRunLog.ComputeDiffEnd
release_file_execute TaskRunLog.ReleaseFileExecute
ghost_migration_start TaskRunLog.GhostMigrationStart
ghost_migration_end TaskRunLog.GhostMigrationEnd

TaskRunLog.CommandExecute

Field Type Label Description
range Range The byte offset range of the executed command in the sheet. Uses byte offsets (not character indices) for efficient slicing of sheet content bytes. Example: For "SELECT 你好;" in a UTF-8 sheet, range [0, 13) represents all 13 bytes.
statement string The statement to be executed.

TaskRunLog.CommandResponse

Field Type Label Description
error string
affected_rows int64
all_affected_rows int64 repeated all_affected_rows is the affected rows of each command. all_affected_rows may be unavailable if the database driver doesn't support it. Caller should fallback to affected_rows in that case.

TaskRunLog.ComputeDiffEnd

Field Type Label Description
error string

TaskRunLog.ComputeDiffStart

TaskRunLog.DatabaseSyncEnd

Field Type Label Description
error string

TaskRunLog.DatabaseSyncStart

TaskRunLog.GhostMigrationEnd

Field Type Label Description
error string

TaskRunLog.GhostMigrationStart

TaskRunLog.PriorBackupEnd

Field Type Label Description
prior_backup_detail PriorBackupDetail
error string

TaskRunLog.PriorBackupStart

TaskRunLog.ReleaseFileExecute

Field Type Label Description
version string The version of the file being executed (e.g., "0001").
file_path string The file path within the release (e.g., "2.2/V0001_create_table.sql").

TaskRunLog.RetryInfo

Field Type Label Description
error string
retry_count int32
maximum_retries int32

TaskRunLog.SchemaDumpEnd

Field Type Label Description
error string

TaskRunLog.SchemaDumpStart

TaskRunLog.TransactionControl

Field Type Label Description
type TaskRunLog.TransactionControl.Type
error string

TaskRunLog.TransactionControl.Type

Name Number Description
TYPE_UNSPECIFIED 0
BEGIN 1
COMMIT 2
ROLLBACK 3

TaskRunLog.Type

Name Number Description
TYPE_UNSPECIFIED 0
SCHEMA_DUMP_START 1
SCHEMA_DUMP_END 2
COMMAND_EXECUTE 3
COMMAND_RESPONSE 4
DATABASE_SYNC_START 5
DATABASE_SYNC_END 6
TRANSACTION_CONTROL 8
PRIOR_BACKUP_START 9
PRIOR_BACKUP_END 10
RETRY_INFO 11
COMPUTE_DIFF_START 12
COMPUTE_DIFF_END 13
RELEASE_FILE_EXECUTE 14
GHOST_MIGRATION_START 15
GHOST_MIGRATION_END 16

Top

store/user.proto

MFAConfig

MFAConfig is the MFA configuration for a user.

Field Type Label Description
otp_secret string The otp_secret is the secret key used to validate the OTP code.
temp_otp_secret string The temp_otp_secret is the temporary secret key used to validate the OTP code and will replace the otp_secret in two-phase commits.
recovery_codes string repeated The recovery_codes are the codes that can be used to recover the account.
temp_recovery_codes string repeated The temp_recovery_codes are the temporary codes that will replace the recovery_codes in two-phase commits.
temp_otp_secret_created_time google.protobuf.Timestamp The temp_otp_secret_created_time is the timestamp when temp_otp_secret was created. Used to enforce expiration.

UserProfile

Field Type Label Description
last_login_time google.protobuf.Timestamp
last_change_password_time google.protobuf.Timestamp
source string The source indicates where the user comes from. For now we support Entra ID SCIM sync, so the source could be Entra ID.
last_login_workspace string The workspace resource ID the user last logged into. Used to auto-select workspace on next login instead of requiring a workspace picker.

WorkloadIdentityConfig

WorkloadIdentityConfig stores OIDC configuration for workload identity.

Field Type Label Description
provider_type WorkloadIdentityConfig.ProviderType Provider configuration mode.
issuer_url string OIDC issuer URL
allowed_audiences string repeated Allowed audiences for token validation
subject_pattern string Subject pattern to match against token subject claim
jwks_url string Optional JWKS endpoint. When empty, use OIDC discovery from issuer_url.

PrincipalType

PrincipalType is the type of a principal.

Name Number Description
PRINCIPAL_TYPE_UNSPECIFIED 0
END_USER 1 END_USER represents the human being using Bytebase.
WORKLOAD_IDENTITY 2 WORKLOAD_IDENTITY represents external CI/CD workload identity.
SERVICE_ACCOUNT 3 SERVICE_ACCOUNT represents the external service calling Bytebase OpenAPI.

WorkloadIdentityConfig.ProviderType

ProviderType identifies the workload identity configuration mode.

Name Number Description
PROVIDER_TYPE_UNSPECIFIED 0
GITHUB 1
GITLAB 2
OIDC 3

Top

store/vcs_provider_user.proto

VCSProviderUserPayload

Field Type Label Description
user_name string
display_name string

Top

store/workspace.proto

WorkspacePayload

WorkspacePayload stores workspace-level metadata.

Field Type Label Description
title string
logo string

Scalar Value Types

.proto Type Notes C++ Java Python Go C# PHP Ruby
double double double float float64 double float Float
float float float float float32 float float Float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int int32 int integer Bignum or Fixnum (as required)
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long int64 long integer/string Bignum
uint32 Uses variable-length encoding. uint32 int int/long uint32 uint integer Bignum or Fixnum (as required)
uint64 Uses variable-length encoding. uint64 long int/long uint64 ulong integer/string Bignum or Fixnum (as required)
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int int32 int integer Bignum or Fixnum (as required)
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long int64 long integer/string Bignum
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int uint32 uint integer Bignum or Fixnum (as required)
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long uint64 ulong integer/string Bignum
sfixed32 Always four bytes. int32 int int int32 int integer Bignum or Fixnum (as required)
sfixed64 Always eight bytes. int64 long int/long int64 long integer/string Bignum
bool bool boolean boolean bool bool boolean TrueClass/FalseClass
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode string string string String (UTF-8)
bytes May contain any arbitrary sequence of bytes. string ByteString str []byte ByteString string String (ASCII-8BIT)