Skip to content

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

feat: changelog sync_history (#14167)

p0ny2c1277e9b1a1
diff --git a/backend/runner/schemasync/syncer.go b/backend/runner/schemasync/syncer.go
index d947e22fc7..165897896c 100644
--- a/backend/runner/schemasync/syncer.go
+++ b/backend/runner/schemasync/syncer.go
@@ -339,6 +339,124 @@ func (s *Syncer) SyncInstance(ctx context.Context, instance *store.InstanceMessa
return updatedInstance, newDatabases, nil
}
+// SyncDatabaseSchema will sync the schema for a database.
+func (s *Syncer) SyncDatabaseSchemaToHistory(ctx context.Context, database *store.DatabaseMessage, force bool) (int64, error) {
+ if s.profile.Readonly {
+ return 0, nil
+ }
+
+ instance, err := s.store.GetInstanceV2(ctx, &store.FindInstanceMessage{ResourceID: &database.InstanceID})
+ if err != nil {
+ return 0, errors.Wrapf(err, "failed to get instance %q", database.InstanceID)
+ }
+ if instance == nil {
+ return 0, errors.Errorf("instance %q not found", database.InstanceID)
+ }
+ driver, err := s.dbFactory.GetAdminDatabaseDriver(ctx, instance, database, db.ConnectionContext{})
+ if err != nil {
+ s.upsertDatabaseConnectionAnomaly(ctx, instance, database, err)
+ return 0, err
+ }
+ defer driver.Close(ctx)
+ s.upsertDatabaseConnectionAnomaly(ctx, instance, database, nil)
+ // Sync database schema
+ deadlineCtx, cancelFunc := context.WithDeadline(ctx, time.Now().Add(syncTimeout))
+ defer cancelFunc()
+ databaseMetadata, err := driver.SyncDBSchema(deadlineCtx)
+ if err != nil {
+ return 0, errors.Wrapf(err, "failed to sync database schema for database %q", database.DatabaseName)
+ }
+
+ dbSchema, err := s.store.GetDBSchema(ctx, database.UID)
+ if err != nil {
+ return 0, errors.Wrapf(err, "failed to get database schema for database %q", database.DatabaseName)
+ }
+
+ dbModelConfig := model.NewDatabaseConfig(nil)
+ if dbSchema != nil {
+ dbModelConfig = dbSchema.GetInternalConfig()
+ }
+
+ project, err := s.store.GetProjectV2(ctx, &store.FindProjectMessage{
+ ResourceID: &database.ProjectID,
+ })
+ if err != nil {
+ return 0, errors.Wrapf(err, `failed to get project by id "%s"`, database.ProjectID)
+ }
+ classificationConfig, err := s.store.GetDataClassificationConfigByID(ctx, project.DataClassificationConfigID)
+ if err != nil {
+ return 0, errors.Wrapf(err, `failed to get classification config by id "%s"`, project.DataClassificationConfigID)
+ }
+
+ if instance.Engine != storepb.Engine_MYSQL && instance.Engine != storepb.Engine_POSTGRES {
+ // Force to disable classification from comment if the engine is not MYSQL or PG.
+ classificationConfig.ClassificationFromConfig = true
+ }
+ if classificationConfig.ClassificationFromConfig {
+ // Only set the user comment.
+ setUserCommentFromComment(databaseMetadata)
+ } else {
+ // Get classification from the comment.
+ setClassificationAndUserCommentFromComment(databaseMetadata, dbModelConfig, classificationConfig)
+ }
+
+ syncStatus := api.OK
+ ts := time.Now().Unix()
+ if _, err := s.store.UpdateDatabase(ctx, &store.UpdateDatabaseMessage{
+ InstanceID: database.InstanceID,
+ DatabaseName: database.DatabaseName,
+ SyncState: &syncStatus,
+ SuccessfulSyncTimeTs: &ts,
+ MetadataUpsert: &storepb.DatabaseMetadata{
+ LastSyncTime: timestamppb.New(time.Unix(ts, 0)),
+ },
+ }, api.SystemBotID); err != nil {
+ return 0, errors.Wrapf(err, "failed to update database %q for instance %q", database.DatabaseName, database.InstanceID)
+ }
+
+ var oldDatabaseMetadata *storepb.DatabaseSchemaMetadata
+ var rawDump []byte
+ if dbSchema != nil {
+ oldDatabaseMetadata = dbSchema.GetMetadata()
+ rawDump = dbSchema.GetSchema()
+ }
+
+ // Avoid updating dump everytime by dumping the schema only when the database metadata is changed.
+ // if oldDatabaseMetadata is nil and databaseMetadata is not, they are not equal resulting a sync.
+ if force || !common.EqualDatabaseSchemaMetadataFast(oldDatabaseMetadata, databaseMetadata) {
+ var schemaBuf bytes.Buffer
+ if err := driver.Dump(ctx, &schemaBuf); err != nil {
+ return 0, errors.Wrapf(err, "failed to dump database schema for database %q", database.DatabaseName)
+ }
+ rawDump = schemaBuf.Bytes()
+ }
+
+ if err := s.store.UpsertDBSchema(ctx,
+ database.UID,
+ model.NewDBSchema(databaseMetadata, rawDump, dbModelConfig.BuildDatabaseConfig()),
+ api.SystemBotID,
+ ); err != nil {
+ if strings.Contains(err.Error(), "escape sequence") {
+ if metadataBytes, err := protojson.Marshal(databaseMetadata); err == nil {
+ slog.Error("unsupported Unicode escape sequence", slog.String("metadata", string(metadataBytes)), slog.String("raw_dump", string(rawDump)))
+ }
+ }
+ return 0, errors.Wrapf(err, "failed to upsert database schema for database %q", database.DatabaseName)
+ }
+
+ id, err := s.store.CreateSyncHistory(ctx, database.UID, databaseMetadata, string(rawDump), api.SystemBotID)
+ if err != nil {
+ if strings.Contains(err.Error(), "escape sequence") {
+ if metadataBytes, err := protojson.Marshal(databaseMetadata); err == nil {
+ slog.Error("unsupported Unicode escape sequence", slog.String("metadata", string(metadataBytes)), slog.String("raw_dump", string(rawDump)))
+ }
+ }
+ return 0, errors.Wrapf(err, "failed to insert sync history for database %q", database.DatabaseName)
+ }
+
+ return id, nil
+}
+
// SyncDatabaseSchema will sync the schema for a database.
func (s *Syncer) SyncDatabaseSchema(ctx context.Context, database *store.DatabaseMessage, force bool) (retErr error) {
if s.profile.Readonly {
diff --git a/backend/runner/taskrun/data_update_executor.go b/backend/runner/taskrun/data_update_executor.go
index 4d22535b50..dcde37f070 100644
--- a/backend/runner/taskrun/data_update_executor.go
+++ b/backend/runner/taskrun/data_update_executor.go
@@ -110,7 +110,7 @@ func (exec *DataUpdateExecutor) RunOnce(ctx context.Context, driverCtx context.C
}
}
version := model.Version{Version: payload.SchemaVersion}
- terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.stateCfg, exec.profile, task, taskRunUID, db.Data, statement, version, &sheetID)
+ terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.stateCfg, exec.schemaSyncer, exec.profile, task, taskRunUID, db.Data, statement, version, &sheetID)
if result != nil {
// Save prior backup detail to task run result.
result.PriorBackupDetail = priorBackupDetail
diff --git a/backend/runner/taskrun/executor.go b/backend/runner/taskrun/executor.go
index 7e37b4daec..4dc42c1bc0 100644
--- a/backend/runner/taskrun/executor.go
+++ b/backend/runner/taskrun/executor.go
@@ -19,6 +19,7 @@ import (
"github.com/bytebase/bytebase/backend/component/state"
api "github.com/bytebase/bytebase/backend/legacyapi"
"github.com/bytebase/bytebase/backend/plugin/db"
+ "github.com/bytebase/bytebase/backend/runner/schemasync"
"github.com/bytebase/bytebase/backend/store"
"github.com/bytebase/bytebase/backend/store/model"
"github.com/bytebase/bytebase/backend/utils"
@@ -59,6 +60,9 @@ func RunExecutorOnce(ctx context.Context, driverCtx context.Context, exec Execut
// Pointer fields are not nullable unless mentioned otherwise.
type migrateContext struct {
+ syncer *schemasync.Syncer
+ profile *config.Profile
+
instance *store.InstanceMessage
database *store.DatabaseMessage
// nullable if type=baseline
@@ -69,6 +73,7 @@ type migrateContext struct {
task *store.TaskMessage
taskRunUID int
taskRunName string
+ issueName string
version string
@@ -80,9 +85,15 @@ type migrateContext struct {
// e.g. `2.2/V001.sql`
file string
}
+
+ // mutable
+ changelog int64
+
+ syncHistoryPrev int64
+ syncHistory int64
}
-func getMigrationInfo(ctx context.Context, stores *store.Store, profile *config.Profile, task *store.TaskMessage, migrationType db.MigrationType, statement string, schemaVersion model.Version, sheetID *int, taskRunUID int) (*db.MigrationInfo, *migrateContext, error) {
+func getMigrationInfo(ctx context.Context, stores *store.Store, profile *config.Profile, syncer *schemasync.Syncer, task *store.TaskMessage, migrationType db.MigrationType, statement string, schemaVersion model.Version, sheetID *int, taskRunUID int) (*db.MigrationInfo, *migrateContext, error) {
if schemaVersion.Version == "" {
return nil, nil, errors.Errorf("empty schema version")
}
@@ -125,6 +136,8 @@ func getMigrationInfo(ctx context.Context, stores *store.Store, profile *config.
}
mc := &migrateContext{
+ syncer: syncer,
+ profile: profile,
instance: instance,
database: database,
task: task,
@@ -219,6 +232,8 @@ func getMigrationInfo(ctx context.Context, stores *store.Store, profile *config.
mi.Description = fmt.Sprintf("%s - %s", issue.Title, task.Name)
mi.ProjectUID = &issue.Project.UID
mi.IssueUID = &issue.UID
+
+ mc.issueName = common.FormatIssue(issue.Project.ResourceID, issue.UID)
}
mi.Source = db.UI
@@ -385,8 +400,8 @@ func postMigration(ctx context.Context, stores *store.Store, mi *db.MigrationInf
}, nil
}
-func runMigration(ctx context.Context, driverCtx context.Context, store *store.Store, dbFactory *dbfactory.DBFactory, stateCfg *state.State, profile *config.Profile, task *store.TaskMessage, taskRunUID int, migrationType db.MigrationType, statement string, schemaVersion model.Version, sheetID *int) (terminated bool, result *storepb.TaskRunResult, err error) {
- mi, mc, err := getMigrationInfo(ctx, store, profile, task, migrationType, statement, schemaVersion, sheetID, taskRunUID)
+func runMigration(ctx context.Context, driverCtx context.Context, store *store.Store, dbFactory *dbfactory.DBFactory, stateCfg *state.State, syncer *schemasync.Syncer, profile *config.Profile, task *store.TaskMessage, taskRunUID int, migrationType db.MigrationType, statement string, schemaVersion model.Version, sheetID *int) (terminated bool, result *storepb.TaskRunResult, err error) {
+ mi, mc, err := getMigrationInfo(ctx, store, profile, syncer, task, migrationType, statement, schemaVersion, sheetID, taskRunUID)
if err != nil {
return true, nil, err
}
@@ -504,17 +519,45 @@ func beginMigration(ctx context.Context, stores *store.Store, mi *db.MigrationIn
// users can create revisions though via API
// however we can warn users not to unless they know
// what they are doing
- if common.IsDev() {
- list, err := stores.ListRevisions(ctx, &store.FindRevisionMessage{
- DatabaseUID: &mc.database.UID,
- Version: &mc.version,
- })
+ if common.IsDev() && mc.profile.DevelopmentVersioned {
+ if mc.version != "" {
+ list, err := stores.ListRevisions(ctx, &store.FindRevisionMessage{
+ DatabaseUID: &mc.database.UID,
+ Version: &mc.version,
+ })
+ if err != nil {
+ return "", errors.Wrapf(err, "failed to list revisions")
+ }
+ if len(list) > 0 {
+ return "", errors.Errorf("database %q has already applied version %s, hint: please check the database revisions and the version", mc.database.DatabaseName, mc.version)
+ }
+ }
+
+ // sync history
+ syncHistoryPrev, err := mc.syncer.SyncDatabaseSchemaToHistory(ctx, mc.database, false)
if err != nil {
- return "", errors.Wrapf(err, "failed to list revisions")
+ return "", errors.Wrapf(err, "failed to sync database metadata and schema")
}
- if len(list) > 0 {
- return "", errors.Errorf("database %q has already applied version %s, hint: please check the database revisions and the version", mc.database.DatabaseName, mc.version)
+ mc.syncHistoryPrev = syncHistoryPrev
+
+ // changelog
+ changelogUID, err := stores.CreateChangelog(ctx, &store.ChangelogMessage{DatabaseUID: mc.database.UID, Payload: &storepb.ChangelogPayload{
+ Task: &storepb.ChangelogTask{
+ TaskRun: mc.taskRunName,
+ Issue: mc.issueName,
+ Revision: 0,
+ ChangedResources: nil,
+ Status: storepb.ChangelogTask_PENDING,
+ PrevSyncHistoryId: syncHistoryPrev,
+ SyncHistoryId: 0,
+ },
+ }}, api.SystemBotID)
+ if err != nil {
+ return "", errors.Wrapf(err, "failed to create changelog")
}
+ mc.changelog = changelogUID
+
+ return "", nil
}
// Phase 1 - Pre-check before executing migration
@@ -555,23 +598,51 @@ func beginMigration(ctx context.Context, stores *store.Store, mi *db.MigrationIn
// endMigration updates the migration history record to DONE or FAILED depending on migration is done or not.
func endMigration(ctx context.Context, storeInstance *store.Store, startedNs int64, insertedID string, updatedSchema, schemaPrev string, mc *migrateContext, sheetID *int, isDone bool) error {
- if common.IsDev() && isDone {
- _, err := storeInstance.CreateRevision(ctx, &store.RevisionMessage{
- DatabaseUID: mc.database.UID,
- Payload: &storepb.RevisionPayload{
- Release: mc.release.release,
- File: mc.release.file,
- Sheet: mc.sheetName,
- SheetSha256: mc.sheet.Sha256,
- TaskRun: mc.taskRunName,
- Version: mc.version,
- // TODO(p0ny): maybe remove this field.
- Type: storepb.ReleaseFileType_TYPE_UNSPECIFIED,
- },
- }, mc.task.CreatorID)
+ if common.IsDev() && mc.profile.DevelopmentVersioned {
+ syncHistory, err := mc.syncer.SyncDatabaseSchemaToHistory(ctx, mc.database, false)
if err != nil {
- return errors.Wrapf(err, "failed to create revision")
+ return errors.Wrapf(err, "failed to sync database metadata and schema")
+ }
+ mc.syncHistory = syncHistory
+
+ update := &store.UpdateChangelogMessage{
+ UID: mc.changelog,
+ SyncHistoryUID: &mc.syncHistory,
}
+
+ if isDone {
+ // if isDone, record in revision
+ if mc.version != "" {
+ revision, err := storeInstance.CreateRevision(ctx, &store.RevisionMessage{
+ DatabaseUID: mc.database.UID,
+ Payload: &storepb.RevisionPayload{
+ Release: mc.release.release,
+ File: mc.release.file,
+ Sheet: mc.sheetName,
+ SheetSha256: mc.sheet.Sha256,
+ TaskRun: mc.taskRunName,
+ Version: mc.version,
+ // TODO(p0ny): maybe remove this field.
+ Type: storepb.ReleaseFileType_TYPE_UNSPECIFIED,
+ },
+ }, mc.task.CreatorID)
+ if err != nil {
+ return errors.Wrapf(err, "failed to create revision")
+ }
+ update.RevisionUID = &revision.UID
+ }
+ status := storepb.ChangelogTask_DONE
+ update.Status = &status
+ } else {
+ status := storepb.ChangelogTask_FAILED
+ update.Status = &status
+ }
+
+ if err := storeInstance.UpdateChangelog(ctx, update); err != nil {
+ return errors.Wrapf(err, "failed to update changelog")
+ }
+
+ return nil
}
migrationDurationNs := time.Now().UnixNano() - startedNs
diff --git a/backend/runner/taskrun/schema_baseline_executor.go b/backend/runner/taskrun/schema_baseline_executor.go
index f49c5441fe..56435b4872 100644
--- a/backend/runner/taskrun/schema_baseline_executor.go
+++ b/backend/runner/taskrun/schema_baseline_executor.go
@@ -58,7 +58,7 @@ func (exec *SchemaBaselineExecutor) RunOnce(ctx context.Context, driverCtx conte
}
version := model.Version{Version: payload.SchemaVersion}
- terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.stateCfg, exec.profile, task, taskRunUID, db.Baseline, "" /* statement */, version, nil /* sheetID */)
+ terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.stateCfg, exec.schemaSyncer, exec.profile, task, taskRunUID, db.Baseline, "" /* statement */, version, nil /* sheetID */)
if err := exec.schemaSyncer.SyncDatabaseSchema(ctx, database, false /* force */); err != nil {
slog.Error("failed to sync database schema",
slog.String("instanceName", instance.ResourceID),
diff --git a/backend/runner/taskrun/schema_update_executor.go b/backend/runner/taskrun/schema_update_executor.go
index 1aa7114c5b..fe100391cf 100644
--- a/backend/runner/taskrun/schema_update_executor.go
+++ b/backend/runner/taskrun/schema_update_executor.go
@@ -65,7 +65,7 @@ func (exec *SchemaUpdateExecutor) RunOnce(ctx context.Context, driverCtx context
}
version := model.Version{Version: payload.SchemaVersion}
- terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.stateCfg, exec.profile, task, taskRunUID, db.Migrate, statement, version, &sheetID)
+ terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.stateCfg, exec.schemaSyncer, exec.profile, task, taskRunUID, db.Migrate, statement, version, &sheetID)
// sync database schema anyways
exec.store.CreateTaskRunLogS(ctx, taskRunUID, time.Now(), exec.profile.DeployID, &storepb.TaskRunLog{
Type: storepb.TaskRunLog_DATABASE_SYNC_START,
diff --git a/backend/runner/taskrun/schema_update_ghost_cutover_executor.go b/backend/runner/taskrun/schema_update_ghost_cutover_executor.go
index ae03ee3141..8da16c166e 100644
--- a/backend/runner/taskrun/schema_update_ghost_cutover_executor.go
+++ b/backend/runner/taskrun/schema_update_ghost_cutover_executor.go
@@ -101,7 +101,7 @@ func (e *SchemaUpdateGhostCutoverExecutor) RunOnce(ctx context.Context, taskCont
// not using the rendered statement here because we want to avoid leaking the rendered statement
version := model.Version{Version: payload.SchemaVersion}
- terminated, result, err := cutover(ctx, taskContext, e.store, e.dbFactory, e.profile, task, taskRunUID, statement, sheetID, version, postponeFilename, sharedGhost.migrationContext, sharedGhost.errCh)
+ terminated, result, err := cutover(ctx, taskContext, e.store, e.dbFactory, e.profile, e.schemaSyncer, task, taskRunUID, statement, sheetID, version, postponeFilename, sharedGhost.migrationContext, sharedGhost.errCh)
if err := e.schemaSyncer.SyncDatabaseSchema(ctx, database, false /* force */); err != nil {
slog.Error("failed to sync database schema",
slog.String("instanceName", instance.ResourceID),
@@ -113,7 +113,7 @@ func (e *SchemaUpdateGhostCutoverExecutor) RunOnce(ctx context.Context, taskCont
return terminated, result, err
}
-func cutover(ctx context.Context, taskContext context.Context, stores *store.Store, dbFactory *dbfactory.DBFactory, profile *config.Profile, task *store.TaskMessage, taskRunUID int, statement string, sheetID int, schemaVersion model.Version, postponeFilename string, migrationContext *base.MigrationContext, errCh <-chan error) (terminated bool, result *storepb.TaskRunResult, err error) {
+func cutover(ctx context.Context, taskContext context.Context, stores *store.Store, dbFactory *dbfactory.DBFactory, profile *config.Profile, syncer *schemasync.Syncer, task *store.TaskMessage, taskRunUID int, statement string, sheetID int, schemaVersion model.Version, postponeFilename string, migrationContext *base.MigrationContext, errCh <-chan error) (terminated bool, result *storepb.TaskRunResult, err error) {
statement = strings.TrimSpace(statement)
instance, err := stores.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &task.InstanceID})
if err != nil {
@@ -132,7 +132,7 @@ func cutover(ctx context.Context, taskContext context.Context, stores *store.Sto
return true, nil, err
}
- mi, mc, err := getMigrationInfo(ctx, stores, profile, task, db.Migrate, statement, schemaVersion, &sheetID, taskRunUID)
+ mi, mc, err := getMigrationInfo(ctx, stores, profile, syncer, task, db.Migrate, statement, schemaVersion, &sheetID, taskRunUID)
if err != nil {
return true, nil, err
}
diff --git a/backend/runner/taskrun/schema_update_sdl_executor.go b/backend/runner/taskrun/schema_update_sdl_executor.go
index ba0a799150..bba592d4c9 100644
--- a/backend/runner/taskrun/schema_update_sdl_executor.go
+++ b/backend/runner/taskrun/schema_update_sdl_executor.go
@@ -74,7 +74,7 @@ func (exec *SchemaUpdateSDLExecutor) RunOnce(ctx context.Context, driverCtx cont
if err != nil {
return true, nil, errors.Wrap(err, "invalid database schema diff")
}
- terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.stateCfg, exec.profile, task, taskRunUID, db.MigrateSDL, ddl, version, &sheetID)
+ terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.stateCfg, exec.schemaSyncer, exec.profile, task, taskRunUID, db.MigrateSDL, ddl, version, &sheetID)
if err := exec.schemaSyncer.SyncDatabaseSchema(ctx, database, false /* force */); err != nil {
slog.Error("failed to sync database schema",
diff --git a/backend/store/changelog.go b/backend/store/changelog.go
new file mode 100644
index 0000000000..735d456dc1
--- /dev/null
+++ b/backend/store/changelog.go
@@ -0,0 +1,113 @@
+package store
+
+import (
+ "context"
+ "fmt"
+ "strings"
+ "time"
+
+ "google.golang.org/protobuf/encoding/protojson"
+
+ "github.com/pkg/errors"
+
+ storepb "github.com/bytebase/bytebase/proto/generated-go/store"
+)
+
+type ChangelogMessage struct {
+ DatabaseUID int
+ Payload *storepb.ChangelogPayload
+
+ // output only
+ UID int64
+ CreatorUID int64
+ CreatedTime time.Time
+}
+
+type UpdateChangelogMessage struct {
+ UID int64
+
+ SyncHistoryUID *int64
+ RevisionUID *int64
+ Status *storepb.ChangelogTask_Status
+}
+
+func (s *Store) CreateChangelog(ctx context.Context, create *ChangelogMessage, creatorUID int) (int64, error) {
+ query := `
+ INSERT INTO changelog (
+ creator_id,
+ database_id,
+ payload
+ ) VALUES (
+ $1,
+ $2,
+ $3
+ )
+ RETURNING id
+ `
+
+ tx, err := s.db.BeginTx(ctx, nil)
+ if err != nil {
+ return 0, errors.Wrapf(err, "failed to begin tx")
+ }
+ defer tx.Rollback()
+
+ p, err := protojson.Marshal(create.Payload)
+ if err != nil {
+ return 0, errors.Wrapf(err, "failed to marshal")
+ }
+
+ var id int64
+ if err := tx.QueryRowContext(ctx, query, creatorUID, create.DatabaseUID, p).Scan(&id); err != nil {
+ return 0, errors.Wrapf(err, "failed to insert")
+ }
+
+ if err := tx.Commit(); err != nil {
+ return 0, errors.Wrapf(err, "failed to commit tx")
+ }
+
+ return id, nil
+}
+
+func (s *Store) UpdateChangelog(ctx context.Context, update *UpdateChangelogMessage) error {
+ args := []any{update.UID}
+ var payloadSet []string
+
+ if v := update.SyncHistoryUID; v != nil {
+ payloadSet = append(payloadSet, fmt.Sprintf("jsonb_build_object('syncHistoryUid', $%d::TEXT)", len(args)+1))
+ args = append(args, fmt.Sprintf("%d", *v))
+ }
+ if v := update.RevisionUID; v != nil {
+ payloadSet = append(payloadSet, fmt.Sprintf("jsonb_build_object('revision', $%d::TEXT)", len(args)+1))
+ args = append(args, fmt.Sprintf("%d", *v))
+ }
+ if v := update.Status; v != nil {
+ payloadSet = append(payloadSet, fmt.Sprintf("jsonb_build_object('status', $%d::TEXT)", len(args)+1))
+ args = append(args, v.String())
+ }
+
+ if len(payloadSet) == 0 {
+ return errors.Errorf("update nothing")
+ }
+
+ query := fmt.Sprintf(`
+ UPDATE changelog
+ SET payload = jsonb_set(payload, '{task}', payload->'task' || %s)
+ WHERE id = $1
+ `, strings.Join(payloadSet, " || "))
+
+ tx, err := s.db.BeginTx(ctx, nil)
+ if err != nil {
+ return errors.Wrapf(err, "failed to begin tx")
+ }
+ defer tx.Rollback()
+
+ if _, err := tx.ExecContext(ctx, query, args...); err != nil {
+ return errors.Wrapf(err, "failed to update")
+ }
+
+ if err := tx.Commit(); err != nil {
+ return errors.Wrapf(err, "failed to commit")
+ }
+
+ return nil
+}
diff --git a/backend/store/sync_history.go b/backend/store/sync_history.go
new file mode 100644
index 0000000000..85c4ef847a
--- /dev/null
+++ b/backend/store/sync_history.go
@@ -0,0 +1,60 @@
+package store
+
+import (
+ "context"
+
+ "google.golang.org/protobuf/encoding/protojson"
+
+ "github.com/pkg/errors"
+
+ storepb "github.com/bytebase/bytebase/proto/generated-go/store"
+)
+
+type SyncHistory struct {
+ UID int64
+ DatabaseUID int
+ Schema string
+
+ CreatorUID int
+}
+
+// UpsertDBSchema upserts a database schema.
+func (s *Store) CreateSyncHistory(ctx context.Context, databaseID int, metadata *storepb.DatabaseSchemaMetadata, schema string, updaterID int) (int64, error) {
+ metadataBytes, err := protojson.Marshal(metadata)
+ if err != nil {
+ return 0, errors.Wrapf(err, "failed to marshal")
+ }
+
+ query := `
+ INSERT INTO sync_history (
+ creator_id,
+ database_id,
+ metadata,
+ raw_dump
+ )
+ VALUES ($1, $2, $3, $4)
+ RETURNING id
+ `
+ tx, err := s.db.BeginTx(ctx, nil)
+ if err != nil {
+ return 0, errors.Wrapf(err, "failed to begin tx")
+ }
+ defer tx.Rollback()
+
+ var id int64
+ if err := tx.QueryRowContext(ctx, query,
+ updaterID,
+ databaseID,
+ metadataBytes,
+ schema,
+ ).Scan(
+ &id,
+ ); err != nil {
+ return 0, errors.Wrapf(err, "failed to insert")
+ }
+ if err := tx.Commit(); err != nil {
+ return 0, errors.Wrapf(err, "failed to commit")
+ }
+
+ return id, nil
+}
diff --git a/frontend/src/types/proto/store/changelog.ts b/frontend/src/types/proto/store/changelog.ts
new file mode 100644
index 0000000000..2acde93e20
--- /dev/null
+++ b/frontend/src/types/proto/store/changelog.ts
@@ -0,0 +1,511 @@
+// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
+// versions:
+// protoc-gen-ts_proto v2.2.0
+// protoc unknown
+// source: store/changelog.proto
+
+/* eslint-disable */
+import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
+import Long from "long";
+import { ChangedResources } from "./instance_change_history";
+
+export const protobufPackage = "bytebase.store";
+
+export interface ChangelogPayload {
+ task: ChangelogTask | undefined;
+ revision: ChangelogRevision | undefined;
+}
+
+export interface ChangelogTask {
+ taskRun: string;
+ issue: string;
+ /** optional */
+ revision: Long;
+ changedResources: ChangedResources | undefined;
+ status: ChangelogTask_Status;
+ prevSyncHistoryId: Long;
+ syncHistoryId: Long;
+ /**
+ * The sheet that holds the content.
+ * Format: projects/{project}/sheets/{sheet}
+ */
+ sheet: string;
+}
+
+export enum ChangelogTask_Status {
+ STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
+ PENDING = "PENDING",
+ DONE = "DONE",
+ FAILED = "FAILED",
+ UNRECOGNIZED = "UNRECOGNIZED",
+}
+
+export function changelogTask_StatusFromJSON(object: any): ChangelogTask_Status {
+ switch (object) {
+ case 0:
+ case "STATUS_UNSPECIFIED":
+ return ChangelogTask_Status.STATUS_UNSPECIFIED;
+ case 1:
+ case "PENDING":
+ return ChangelogTask_Status.PENDING;
+ case 2:
+ case "DONE":
+ return ChangelogTask_Status.DONE;
+ case 3:
+ case "FAILED":
+ return ChangelogTask_Status.FAILED;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return ChangelogTask_Status.UNRECOGNIZED;
+ }
+}
+
+export function changelogTask_StatusToJSON(object: ChangelogTask_Status): string {
+ switch (object) {
+ case ChangelogTask_Status.STATUS_UNSPECIFIED:
+ return "STATUS_UNSPECIFIED";
+ case ChangelogTask_Status.PENDING:
+ return "PENDING";
+ case ChangelogTask_Status.DONE:
+ return "DONE";
+ case ChangelogTask_Status.FAILED:
+ return "FAILED";
+ case ChangelogTask_Status.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
+export function changelogTask_StatusToNumber(object: ChangelogTask_Status): number {
+ switch (object) {
+ case ChangelogTask_Status.STATUS_UNSPECIFIED:
+ return 0;
+ case ChangelogTask_Status.PENDING:
+ return 1;
+ case ChangelogTask_Status.DONE:
+ return 2;
+ case ChangelogTask_Status.FAILED:
+ return 3;
+ case ChangelogTask_Status.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
+export interface ChangelogRevision {
+ /** Marshalled revision for display */
+ revision: string;
+ operation: ChangelogRevision_Op;
+}
+
+export enum ChangelogRevision_Op {
+ OP_UNSPECIFIED = "OP_UNSPECIFIED",
+ CREATE = "CREATE",
+ DELETE = "DELETE",
+ UNRECOGNIZED = "UNRECOGNIZED",
+}
+
+export function changelogRevision_OpFromJSON(object: any): ChangelogRevision_Op {
+ switch (object) {
+ case 0:
+ case "OP_UNSPECIFIED":
+ return ChangelogRevision_Op.OP_UNSPECIFIED;
+ case 1:
+ case "CREATE":
+ return ChangelogRevision_Op.CREATE;
+ case 2:
+ case "DELETE":
+ return ChangelogRevision_Op.DELETE;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return ChangelogRevision_Op.UNRECOGNIZED;
+ }
+}
+
+export function changelogRevision_OpToJSON(object: ChangelogRevision_Op): string {
+ switch (object) {
+ case ChangelogRevision_Op.OP_UNSPECIFIED:
+ return "OP_UNSPECIFIED";
+ case ChangelogRevision_Op.CREATE:
+ return "CREATE";
+ case ChangelogRevision_Op.DELETE:
+ return "DELETE";
+ case ChangelogRevision_Op.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
+export function changelogRevision_OpToNumber(object: ChangelogRevision_Op): number {
+ switch (object) {
+ case ChangelogRevision_Op.OP_UNSPECIFIED:
+ return 0;
+ case ChangelogRevision_Op.CREATE:
+ return 1;
+ case ChangelogRevision_Op.DELETE:
+ return 2;
+ case ChangelogRevision_Op.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
+function createBaseChangelogPayload(): ChangelogPayload {
+ return { task: undefined, revision: undefined };
+}
+
+export const ChangelogPayload: MessageFns<ChangelogPayload> = {
+ encode(message: ChangelogPayload, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+ if (message.task !== undefined) {
+ ChangelogTask.encode(message.task, writer.uint32(10).fork()).join();
+ }
+ if (message.revision !== undefined) {
+ ChangelogRevision.encode(message.revision, writer.uint32(18).fork()).join();
+ }
+ return writer;
+ },
+
+ decode(input: BinaryReader | Uint8Array, length?: number): ChangelogPayload {
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseChangelogPayload();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.task = ChangelogTask.decode(reader, reader.uint32());
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.revision = ChangelogRevision.decode(reader, reader.uint32());
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skip(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): ChangelogPayload {
+ return {
+ task: isSet(object.task) ? ChangelogTask.fromJSON(object.task) : undefined,
+ revision: isSet(object.revision) ? ChangelogRevision.fromJSON(object.revision) : undefined,
+ };
+ },
+
+ toJSON(message: ChangelogPayload): unknown {
+ const obj: any = {};
+ if (message.task !== undefined) {
+ obj.task = ChangelogTask.toJSON(message.task);
+ }
+ if (message.revision !== undefined) {
+ obj.revision = ChangelogRevision.toJSON(message.revision);
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<ChangelogPayload>): ChangelogPayload {
+ return ChangelogPayload.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<ChangelogPayload>): ChangelogPayload {
+ const message = createBaseChangelogPayload();
+ message.task = (object.task !== undefined && object.task !== null)
+ ? ChangelogTask.fromPartial(object.task)
+ : undefined;
+ message.revision = (object.revision !== undefined && object.revision !== null)
+ ? ChangelogRevision.fromPartial(object.revision)
+ : undefined;
+ return message;
+ },
+};
+
+function createBaseChangelogTask(): ChangelogTask {
+ return {
+ taskRun: "",
+ issue: "",
+ revision: Long.ZERO,
+ changedResources: undefined,
+ status: ChangelogTask_Status.STATUS_UNSPECIFIED,
+ prevSyncHistoryId: Long.ZERO,
+ syncHistoryId: Long.ZERO,
+ sheet: "",
+ };
+}
+
+export const ChangelogTask: MessageFns<ChangelogTask> = {
+ encode(message: ChangelogTask, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+ if (message.taskRun !== "") {
+ writer.uint32(10).string(message.taskRun);
+ }
+ if (message.issue !== "") {
+ writer.uint32(18).string(message.issue);
+ }
+ if (!message.revision.equals(Long.ZERO)) {
+ writer.uint32(24).int64(message.revision.toString());
+ }
+ if (message.changedResources !== undefined) {
+ ChangedResources.encode(message.changedResources, writer.uint32(34).fork()).join();
+ }
+ if (message.status !== ChangelogTask_Status.STATUS_UNSPECIFIED) {
+ writer.uint32(40).int32(changelogTask_StatusToNumber(message.status));
+ }
+ if (!message.prevSyncHistoryId.equals(Long.ZERO)) {
+ writer.uint32(48).int64(message.prevSyncHistoryId.toString());
+ }
+ if (!message.syncHistoryId.equals(Long.ZERO)) {
+ writer.uint32(56).int64(message.syncHistoryId.toString());
+ }
+ if (message.sheet !== "") {
+ writer.uint32(66).string(message.sheet);
+ }
+ return writer;
+ },
+
+ decode(input: BinaryReader | Uint8Array, length?: number): ChangelogTask {
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseChangelogTask();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.taskRun = reader.string();
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.issue = reader.string();
+ continue;
+ case 3:
+ if (tag !== 24) {
+ break;
+ }
+
+ message.revision = Long.fromString(reader.int64().toString());
+ continue;
+ case 4:
+ if (tag !== 34) {
+ break;
+ }
+
+ message.changedResources = ChangedResources.decode(reader, reader.uint32());
+ continue;
+ case 5:
+ if (tag !== 40) {
+ break;
+ }
+
+ message.status = changelogTask_StatusFromJSON(reader.int32());
+ continue;
+ case 6:
+ if (tag !== 48) {
+ break;
+ }
+
+ message.prevSyncHistoryId = Long.fromString(reader.int64().toString());
+ continue;
+ case 7:
+ if (tag !== 56) {
+ break;
+ }
+
+ message.syncHistoryId = Long.fromString(reader.int64().toString());
+ continue;
+ case 8:
+ if (tag !== 66) {
+ break;
+ }
+
+ message.sheet = reader.string();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skip(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): ChangelogTask {
+ return {
+ taskRun: isSet(object.taskRun) ? globalThis.String(object.taskRun) : "",
+ issue: isSet(object.issue) ? globalThis.String(object.issue) : "",
+ revision: isSet(object.revision) ? Long.fromValue(object.revision) : Long.ZERO,
+ changedResources: isSet(object.changedResources) ? ChangedResources.fromJSON(object.changedResources) : undefined,
+ status: isSet(object.status)
+ ? changelogTask_StatusFromJSON(object.status)
+ : ChangelogTask_Status.STATUS_UNSPECIFIED,
+ prevSyncHistoryId: isSet(object.prevSyncHistoryId) ? Long.fromValue(object.prevSyncHistoryId) : Long.ZERO,
+ syncHistoryId: isSet(object.syncHistoryId) ? Long.fromValue(object.syncHistoryId) : Long.ZERO,
+ sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
+ };
+ },
+
+ toJSON(message: ChangelogTask): unknown {
+ const obj: any = {};
+ if (message.taskRun !== "") {
+ obj.taskRun = message.taskRun;
+ }
+ if (message.issue !== "") {
+ obj.issue = message.issue;
+ }
+ if (!message.revision.equals(Long.ZERO)) {
+ obj.revision = (message.revision || Long.ZERO).toString();
+ }
+ if (message.changedResources !== undefined) {
+ obj.changedResources = ChangedResources.toJSON(message.changedResources);
+ }
+ if (message.status !== ChangelogTask_Status.STATUS_UNSPECIFIED) {
+ obj.status = changelogTask_StatusToJSON(message.status);
+ }
+ if (!message.prevSyncHistoryId.equals(Long.ZERO)) {
+ obj.prevSyncHistoryId = (message.prevSyncHistoryId || Long.ZERO).toString();
+ }
+ if (!message.syncHistoryId.equals(Long.ZERO)) {
+ obj.syncHistoryId = (message.syncHistoryId || Long.ZERO).toString();
+ }
+ if (message.sheet !== "") {
+ obj.sheet = message.sheet;
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<ChangelogTask>): ChangelogTask {
+ return ChangelogTask.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<ChangelogTask>): ChangelogTask {
+ const message = createBaseChangelogTask();
+ message.taskRun = object.taskRun ?? "";
+ message.issue = object.issue ?? "";
+ message.revision = (object.revision !== undefined && object.revision !== null)
+ ? Long.fromValue(object.revision)
+ : Long.ZERO;
+ message.changedResources = (object.changedResources !== undefined && object.changedResources !== null)
+ ? ChangedResources.fromPartial(object.changedResources)
+ : undefined;
+ message.status = object.status ?? ChangelogTask_Status.STATUS_UNSPECIFIED;
+ message.prevSyncHistoryId = (object.prevSyncHistoryId !== undefined && object.prevSyncHistoryId !== null)
+ ? Long.fromValue(object.prevSyncHistoryId)
+ : Long.ZERO;
+ message.syncHistoryId = (object.syncHistoryId !== undefined && object.syncHistoryId !== null)
+ ? Long.fromValue(object.syncHistoryId)
+ : Long.ZERO;
+ message.sheet = object.sheet ?? "";
+ return message;
+ },
+};
+
+function createBaseChangelogRevision(): ChangelogRevision {
+ return { revision: "", operation: ChangelogRevision_Op.OP_UNSPECIFIED };
+}
+
+export const ChangelogRevision: MessageFns<ChangelogRevision> = {
+ encode(message: ChangelogRevision, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+ if (message.revision !== "") {
+ writer.uint32(10).string(message.revision);
+ }
+ if (message.operation !== ChangelogRevision_Op.OP_UNSPECIFIED) {
+ writer.uint32(16).int32(changelogRevision_OpToNumber(message.operation));
+ }
+ return writer;
+ },
+
+ decode(input: BinaryReader | Uint8Array, length?: number): ChangelogRevision {
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseChangelogRevision();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.revision = reader.string();
+ continue;
+ case 2:
+ if (tag !== 16) {
+ break;
+ }
+
+ message.operation = changelogRevision_OpFromJSON(reader.int32());
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skip(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): ChangelogRevision {
+ return {
+ revision: isSet(object.revision) ? globalThis.String(object.revision) : "",
+ operation: isSet(object.operation)
+ ? changelogRevision_OpFromJSON(object.operation)
+ : ChangelogRevision_Op.OP_UNSPECIFIED,
+ };
+ },
+
+ toJSON(message: ChangelogRevision): unknown {
+ const obj: any = {};
+ if (message.revision !== "") {
+ obj.revision = message.revision;
+ }
+ if (message.operation !== ChangelogRevision_Op.OP_UNSPECIFIED) {
+ obj.operation = changelogRevision_OpToJSON(message.operation);
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<ChangelogRevision>): ChangelogRevision {
+ return ChangelogRevision.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<ChangelogRevision>): ChangelogRevision {
+ const message = createBaseChangelogRevision();
+ message.revision = object.revision ?? "";
+ message.operation = object.operation ?? ChangelogRevision_Op.OP_UNSPECIFIED;
+ return message;
+ },
+};
+
+type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
+
+export type DeepPartial<T> = T extends Builtin ? T
+ : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
+ : Partial<T>;
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
+export interface MessageFns<T> {
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
+ toJSON(message: T): unknown;
+ create(base?: DeepPartial<T>): T;
+ fromPartial(object: DeepPartial<T>): T;
+}
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 0c5fb81e93..a7a8e0728d 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -93,6 +93,24 @@
- [Changelist](#bytebase-store-Changelist)
- [Changelist.Change](#bytebase-store-Changelist-Change)
+- [store/instance_change_history.proto](#store_instance_change_history-proto)
+ - [ChangedResourceDatabase](#bytebase-store-ChangedResourceDatabase)
+ - [ChangedResourceFunction](#bytebase-store-ChangedResourceFunction)
+ - [ChangedResourceProcedure](#bytebase-store-ChangedResourceProcedure)
+ - [ChangedResourceSchema](#bytebase-store-ChangedResourceSchema)
+ - [ChangedResourceTable](#bytebase-store-ChangedResourceTable)
+ - [ChangedResourceView](#bytebase-store-ChangedResourceView)
+ - [ChangedResources](#bytebase-store-ChangedResources)
+ - [InstanceChangeHistoryPayload](#bytebase-store-InstanceChangeHistoryPayload)
+
+- [store/changelog.proto](#store_changelog-proto)
+ - [ChangelogPayload](#bytebase-store-ChangelogPayload)
+ - [ChangelogRevision](#bytebase-store-ChangelogRevision)
+ - [ChangelogTask](#bytebase-store-ChangelogTask)
+
+ - [ChangelogRevision.Op](#bytebase-store-ChangelogRevision-Op)
+ - [ChangelogTask.Status](#bytebase-store-ChangelogTask-Status)
+
- [store/data_source.proto](#store_data_source-proto)
- [DataSourceExternalSecret](#bytebase-store-DataSourceExternalSecret)
- [DataSourceExternalSecret.AppRoleAuthOption](#bytebase-store-DataSourceExternalSecret-AppRoleAuthOption)
@@ -135,16 +153,6 @@
- [InstanceOptions](#bytebase-store-InstanceOptions)
- [InstanceRole](#bytebase-store-InstanceRole)
-- [store/instance_change_history.proto](#store_instance_change_history-proto)
- - [ChangedResourceDatabase](#bytebase-store-ChangedResourceDatabase)
- - [ChangedResourceFunction](#bytebase-store-ChangedResourceFunction)
- - [ChangedResourceProcedure](#bytebase-store-ChangedResourceProcedure)
- - [ChangedResourceSchema](#bytebase-store-ChangedResourceSchema)
- - [ChangedResourceTable](#bytebase-store-ChangedResourceTable)
- - [ChangedResourceView](#bytebase-store-ChangedResourceView)
- - [ChangedResources](#bytebase-store-ChangedResources)
- - [InstanceChangeHistoryPayload](#bytebase-store-InstanceChangeHistoryPayload)
-
- [store/issue.proto](#store_issue-proto)
- [GrantRequest](#bytebase-store-GrantRequest)
- [IssuePayload](#bytebase-store-IssuePayload)
@@ -1699,6 +1707,249 @@ PostgreSQL: RANGE, LIST, HASH (https://www.postgresql.org/docs/current/ddl-parti
+<a name="store_instance_change_history-proto"></a>
+<p align="right"><a href="#top">Top</a></p>
+
+## store/instance_change_history.proto
+
+
+
+<a name="bytebase-store-ChangedResourceDatabase"></a>
+
+### ChangedResourceDatabase
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | |
+| schemas | [ChangedResourceSchema](#bytebase-store-ChangedResourceSchema) | repeated | |
+
+
+
+
+
+
+<a name="bytebase-store-ChangedResourceFunction"></a>
+
+### ChangedResourceFunction
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | |
+| ranges | [Range](#bytebase-store-Range) | repeated | The ranges of sub-strings correspond to the statements on the sheet. |
+
+
+
+
+
+
+<a name="bytebase-store-ChangedResourceProcedure"></a>
+
+### ChangedResourceProcedure
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | |
+| ranges | [Range](#bytebase-store-Range) | repeated | The ranges of sub-strings correspond to the statements on the sheet. |
+
+
+
+
+
+
+<a name="bytebase-store-ChangedResourceSchema"></a>
+
+### ChangedResourceSchema
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | |
+| tables | [ChangedResourceTable](#bytebase-store-ChangedResourceTable) | repeated | |
+| views | [ChangedResourceView](#bytebase-store-ChangedResourceView) | repeated | |
+| functions | [ChangedResourceFunction](#bytebase-store-ChangedResourceFunction) | repeated | |
+| procedures | [ChangedResourceProcedure](#bytebase-store-ChangedResourceProcedure) | repeated | |
+
+
+
+
+
+
+<a name="bytebase-store-ChangedResourceTable"></a>
+
+### ChangedResourceTable
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | |
+| table_rows | [int64](#int64) | | estimated row count of the table |
+| ranges | [Range](#bytebase-store-Range) | repeated | The ranges of sub-strings correspond to the statements on the sheet. |
+
+
+
+
+
+
+<a name="bytebase-store-ChangedResourceView"></a>
+
+### ChangedResourceView
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | |
+| ranges | [Range](#bytebase-store-Range) | repeated | The ranges of sub-strings correspond to the statements on the sheet. |
+
+
+
+
+
+
+<a name="bytebase-store-ChangedResources"></a>
+
+### ChangedResources
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| databases | [ChangedResourceDatabase](#bytebase-store-ChangedResourceDatabase) | repeated | |
+
+
+
+
+
+
+<a name="bytebase-store-InstanceChangeHistoryPayload"></a>
+
+### InstanceChangeHistoryPayload
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| changed_resources | [ChangedResources](#bytebase-store-ChangedResources) | | |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<a name="store_changelog-proto"></a>
+<p align="right"><a href="#top">Top</a></p>
+
+## store/changelog.proto
+
+
+
+<a name="bytebase-store-ChangelogPayload"></a>
+
+### ChangelogPayload
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| task | [ChangelogTask](#bytebase-store-ChangelogTask) | | |
+| revision | [ChangelogRevision](#bytebase-store-ChangelogRevision) | | |
+
+
+
+
+
+
+<a name="bytebase-store-ChangelogRevision"></a>
+
+### ChangelogRevision
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| revision | [string](#string) | | Marshalled revision for display |
+| operation | [ChangelogRevision.Op](#bytebase-store-ChangelogRevision-Op) | | |
+
+
+
+
+
+
+<a name="bytebase-store-ChangelogTask"></a>
+
+### ChangelogTask
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| task_run | [string](#string) | | |
+| issue | [string](#string) | | |
+| revision | [int64](#int64) | | optional |
+| changed_resources | [ChangedResources](#bytebase-store-ChangedResources) | | |
+| status | [ChangelogTask.Status](#bytebase-store-ChangelogTask-Status) | | |
+| prev_sync_history_id | [int64](#int64) | | |
+| sync_history_id | [int64](#int64) | | |
+| sheet | [string](#string) | | The sheet that holds the content. Format: projects/{project}/sheets/{sheet} |
+
+
+
+
+
+
+
+
+<a name="bytebase-store-ChangelogRevision-Op"></a>
+
+### ChangelogRevision.Op
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| OP_UNSPECIFIED | 0 | |
+| CREATE | 1 | |
+| DELETE | 2 | |
+
+
+
+<a name="bytebase-store-ChangelogTask-Status"></a>
+
+### ChangelogTask.Status
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| STATUS_UNSPECIFIED | 0 | |
+| PENDING | 1 | |
+| DONE | 2 | |
+| FAILED | 3 | |
+
+
+
+
+
+
+
+
+
+
<a name="store_data_source-proto"></a>
<p align="right"><a href="#top">Top</a></p>
@@ -2274,152 +2525,6 @@ InstanceRole is the API message for instance role.
-<a name="store_instance_change_history-proto"></a>
-<p align="right"><a href="#top">Top</a></p>
-
-## store/instance_change_history.proto
-
-
-
-<a name="bytebase-store-ChangedResourceDatabase"></a>
-
-### ChangedResourceDatabase
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| name | [string](#string) | | |
-| schemas | [ChangedResourceSchema](#bytebase-store-ChangedResourceSchema) | repeated | |
-
-
-
-
-
-
-<a name="bytebase-store-ChangedResourceFunction"></a>
-
-### ChangedResourceFunction
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| name | [string](#string) | | |
-| ranges | [Range](#bytebase-store-Range) | repeated | The ranges of sub-strings correspond to the statements on the sheet. |
-
-
-
-
-
-
-<a name="bytebase-store-ChangedResourceProcedure"></a>
-
-### ChangedResourceProcedure
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| name | [string](#string) | | |
-| ranges | [Range](#bytebase-store-Range) | repeated | The ranges of sub-strings correspond to the statements on the sheet. |
-
-
-
-
-
-
-<a name="bytebase-store-ChangedResourceSchema"></a>
-
-### ChangedResourceSchema
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| name | [string](#string) | | |
-| tables | [ChangedResourceTable](#bytebase-store-ChangedResourceTable) | repeated | |
-| views | [ChangedResourceView](#bytebase-store-ChangedResourceView) | repeated | |
-| functions | [ChangedResourceFunction](#bytebase-store-ChangedResourceFunction) | repeated | |
-| procedures | [ChangedResourceProcedure](#bytebase-store-ChangedResourceProcedure) | repeated | |
-
-
-
-
-
-
-<a name="bytebase-store-ChangedResourceTable"></a>
-
-### ChangedResourceTable
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| name | [string](#string) | | |
-| table_rows | [int64](#int64) | | estimated row count of the table |
-| ranges | [Range](#bytebase-store-Range) | repeated | The ranges of sub-strings correspond to the statements on the sheet. |
-
-
-
-
-
-
-<a name="bytebase-store-ChangedResourceView"></a>
-
-### ChangedResourceView
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| name | [string](#string) | | |
-| ranges | [Range](#bytebase-store-Range) | repeated | The ranges of sub-strings correspond to the statements on the sheet. |
-
-
-
-
-
-
-<a name="bytebase-store-ChangedResources"></a>
-
-### ChangedResources
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| databases | [ChangedResourceDatabase](#bytebase-store-ChangedResourceDatabase) | repeated | |
-
-
-
-
-
-
-<a name="bytebase-store-InstanceChangeHistoryPayload"></a>
-
-### InstanceChangeHistoryPayload
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| changed_resources | [ChangedResources](#bytebase-store-ChangedResources) | | |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
<a name="store_issue-proto"></a>
<p align="right"><a href="#top">Top</a></p>
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index 85a9201b06..70efdbb7f2 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -538,6 +538,80 @@
</li>
+ <li>
+ <a href="#store%2finstance_change_history.proto">store/instance_change_history.proto</a>
+ <ul>
+
+ <li>
+ <a href="#bytebase.store.ChangedResourceDatabase"><span class="badge">M</span>ChangedResourceDatabase</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.store.ChangedResourceFunction"><span class="badge">M</span>ChangedResourceFunction</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.store.ChangedResourceProcedure"><span class="badge">M</span>ChangedResourceProcedure</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.store.ChangedResourceSchema"><span class="badge">M</span>ChangedResourceSchema</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.store.ChangedResourceTable"><span class="badge">M</span>ChangedResourceTable</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.store.ChangedResourceView"><span class="badge">M</span>ChangedResourceView</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.store.ChangedResources"><span class="badge">M</span>ChangedResources</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.store.InstanceChangeHistoryPayload"><span class="badge">M</span>InstanceChangeHistoryPayload</a>
+ </li>
+
+
+
+
+ </ul>
+ </li>
+
+
+ <li>
+ <a href="#store%2fchangelog.proto">store/changelog.proto</a>
+ <ul>
+
+ <li>
+ <a href="#bytebase.store.ChangelogPayload"><span class="badge">M</span>ChangelogPayload</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.store.ChangelogRevision"><span class="badge">M</span>ChangelogRevision</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.store.ChangelogTask"><span class="badge">M</span>ChangelogTask</a>
+ </li>
+
+
+ <li>
+ <a href="#bytebase.store.ChangelogRevision.Op"><span class="badge">E</span>ChangelogRevision.Op</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.store.ChangelogTask.Status"><span class="badge">E</span>ChangelogTask.Status</a>
+ </li>
+
+
+
+ </ul>
+ </li>
+
+
<li>
<a href="#store%2fdata_source.proto">store/data_source.proto</a>
<ul>
@@ -708,49 +782,6 @@
- </ul>
- </li>
-
-
- <li>
- <a href="#store%2finstance_change_history.proto">store/instance_change_history.proto</a>
- <ul>
-
- <li>
- <a href="#bytebase.store.ChangedResourceDatabase"><span class="badge">M</span>ChangedResourceDatabase</a>
- </li>
-
- <li>
- <a href="#bytebase.store.ChangedResourceFunction"><span class="badge">M</span>ChangedResourceFunction</a>
- </li>
-
- <li>
- <a href="#bytebase.store.ChangedResourceProcedure"><span class="badge">M</span>ChangedResourceProcedure</a>
- </li>
-
- <li>
- <a href="#bytebase.store.ChangedResourceSchema"><span class="badge">M</span>ChangedResourceSchema</a>
- </li>
-
- <li>
- <a href="#bytebase.store.ChangedResourceTable"><span class="badge">M</span>ChangedResourceTable</a>
- </li>
-
- <li>
- <a href="#bytebase.store.ChangedResourceView"><span class="badge">M</span>ChangedResourceView</a>
- </li>
-
- <li>
- <a href="#bytebase.store.ChangedResources"><span class="badge">M</span>ChangedResources</a>
- </li>
-
- <li>
- <a href="#bytebase.store.InstanceChangeHistoryPayload"><span class="badge">M</span>InstanceChangeHistoryPayload</a>
- </li>
-
-
-
-
</ul>
</li>
@@ -4916,12 +4947,12 @@ Example: projects/project-id/branches/branch-id. </p></td>
<div class="file-heading">
- <h2 id="store/data_source.proto">store/data_source.proto</h2><a href="#title">Top</a>
+ <h2 id="store/instance_change_history.proto">store/instance_change_history.proto</h2><a href="#title">Top</a>
</div>
<p></p>
- <h3 id="bytebase.store.DataSourceExternalSecret">DataSourceExternalSecret</h3>
+ <h3 id="bytebase.store.ChangedResourceDatabase">ChangedResourceDatabase</h3>
<p></p>
@@ -4932,59 +4963,79 @@ Example: projects/project-id/branches/branch-id. </p></td>
<tbody>
<tr>
- <td>secret_type</td>
- <td><a href="#bytebase.store.DataSourceExternalSecret.SecretType">DataSourceExternalSecret.SecretType</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
- <tr>
- <td>url</td>
+ <td>name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>auth_type</td>
- <td><a href="#bytebase.store.DataSourceExternalSecret.AuthType">DataSourceExternalSecret.AuthType</a></td>
- <td></td>
+ <td>schemas</td>
+ <td><a href="#bytebase.store.ChangedResourceSchema">ChangedResourceSchema</a></td>
+ <td>repeated</td>
<td><p> </p></td>
</tr>
- <tr>
- <td>app_role</td>
- <td><a href="#bytebase.store.DataSourceExternalSecret.AppRoleAuthOption">DataSourceExternalSecret.AppRoleAuthOption</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.store.ChangedResourceFunction">ChangedResourceFunction</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
<tr>
- <td>token</td>
+ <td>name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>engine_name</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>engine name is the name for secret engine. </p></td>
+ <td>ranges</td>
+ <td><a href="#bytebase.store.Range">Range</a></td>
+ <td>repeated</td>
+ <td><p>The ranges of sub-strings correspond to the statements on the sheet. </p></td>
</tr>
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.store.ChangedResourceProcedure">ChangedResourceProcedure</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
<tr>
- <td>secret_name</td>
+ <td>name</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>the secret name in the engine to store the password. </p></td>
+ <td><p> </p></td>
</tr>
<tr>
- <td>password_key_name</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>the key name for the password. </p></td>
+ <td>ranges</td>
+ <td><a href="#bytebase.store.Range">Range</a></td>
+ <td>repeated</td>
+ <td><p>The ranges of sub-strings correspond to the statements on the sheet. </p></td>
</tr>
</tbody>
@@ -4994,7 +5045,7 @@ Example: projects/project-id/branches/branch-id. </p></td>
- <h3 id="bytebase.store.DataSourceExternalSecret.AppRoleAuthOption">DataSourceExternalSecret.AppRoleAuthOption</h3>
+ <h3 id="bytebase.store.ChangedResourceSchema">ChangedResourceSchema</h3>
<p></p>
@@ -5005,31 +5056,38 @@ Example: projects/project-id/branches/branch-id. </p></td>
<tbody>
<tr>
- <td>role_id</td>
+ <td>name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>secret_id</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>the secret id for the role without ttl. </p></td>
+ <td>tables</td>
+ <td><a href="#bytebase.store.ChangedResourceTable">ChangedResourceTable</a></td>
+ <td>repeated</td>
+ <td><p> </p></td>
</tr>
<tr>
- <td>type</td>
- <td><a href="#bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.SecretType">DataSourceExternalSecret.AppRoleAuthOption.SecretType</a></td>
- <td></td>
+ <td>views</td>
+ <td><a href="#bytebase.store.ChangedResourceView">ChangedResourceView</a></td>
+ <td>repeated</td>
<td><p> </p></td>
</tr>
<tr>
- <td>mount_path</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The path where the approle auth method is mounted. </p></td>
+ <td>functions</td>
+ <td><a href="#bytebase.store.ChangedResourceFunction">ChangedResourceFunction</a></td>
+ <td>repeated</td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>procedures</td>
+ <td><a href="#bytebase.store.ChangedResourceProcedure">ChangedResourceProcedure</a></td>
+ <td>repeated</td>
+ <td><p> </p></td>
</tr>
</tbody>
@@ -5039,7 +5097,7 @@ Example: projects/project-id/branches/branch-id. </p></td>
- <h3 id="bytebase.store.DataSourceOptions">DataSourceOptions</h3>
+ <h3 id="bytebase.store.ChangedResourceTable">ChangedResourceTable</h3>
<p></p>
@@ -5050,175 +5108,150 @@ Example: projects/project-id/branches/branch-id. </p></td>
<tbody>
<tr>
- <td>srv</td>
- <td><a href="#bool">bool</a></td>
- <td></td>
- <td><p>srv is a boolean flag that indicates whether the host is a DNS SRV record. </p></td>
- </tr>
-
- <tr>
- <td>authentication_database</td>
+ <td>name</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>authentication_database is the database name to authenticate against, which stores the user credentials. </p></td>
+ <td><p> </p></td>
</tr>
<tr>
- <td>sid</td>
- <td><a href="#string">string</a></td>
+ <td>table_rows</td>
+ <td><a href="#int64">int64</a></td>
<td></td>
- <td><p>sid and service_name are used for Oracle. </p></td>
+ <td><p>estimated row count of the table </p></td>
</tr>
<tr>
- <td>service_name</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p> </p></td>
+ <td>ranges</td>
+ <td><a href="#bytebase.store.Range">Range</a></td>
+ <td>repeated</td>
+ <td><p>The ranges of sub-strings correspond to the statements on the sheet. </p></td>
</tr>
- <tr>
- <td>ssh_host</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>SSH related
-The hostname of the SSH server agent. </p></td>
- </tr>
-
- <tr>
- <td>ssh_port</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The port of the SSH server agent. It&#39;s 22 typically. </p></td>
- </tr>
-
- <tr>
- <td>ssh_user</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The user to login the server. </p></td>
- </tr>
-
- <tr>
- <td>ssh_obfuscated_password</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The password to login the server. If it&#39;s empty string, no password is required. </p></td>
- </tr>
-
- <tr>
- <td>ssh_obfuscated_private_key</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The private key to login the server. If it&#39;s empty string, we will use the system default private key from os.Getenv(&#34;SSH_AUTH_SOCK&#34;). </p></td>
- </tr>
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.store.ChangedResourceView">ChangedResourceView</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
<tr>
- <td>authentication_private_key_obfuscated</td>
+ <td>name</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>PKCS#8 private key in PEM format. If it&#39;s empty string, no private key is required.
-Used for authentication when connecting to the data source. </p></td>
- </tr>
-
- <tr>
- <td>external_secret</td>
- <td><a href="#bytebase.store.DataSourceExternalSecret">DataSourceExternalSecret</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
- <tr>
- <td>authentication_type</td>
- <td><a href="#bytebase.store.DataSourceOptions.AuthenticationType">DataSourceOptions.AuthenticationType</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
- <tr>
- <td>sasl_config</td>
- <td><a href="#bytebase.store.SASLConfig">SASLConfig</a></td>
- <td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>additional_addresses</td>
- <td><a href="#bytebase.store.DataSourceOptions.Address">DataSourceOptions.Address</a></td>
+ <td>ranges</td>
+ <td><a href="#bytebase.store.Range">Range</a></td>
<td>repeated</td>
- <td><p>additional_addresses is used for MongoDB replica set. </p></td>
- </tr>
-
- <tr>
- <td>replica_set</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>replica_set is used for MongoDB replica set. </p></td>
+ <td><p>The ranges of sub-strings correspond to the statements on the sheet. </p></td>
</tr>
- <tr>
- <td>direct_connection</td>
- <td><a href="#bool">bool</a></td>
- <td></td>
- <td><p>direct_connection is used for MongoDB to dispatch all the operations to the node specified in the connection string. </p></td>
- </tr>
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.store.ChangedResources">ChangedResources</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
<tr>
- <td>region</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>region is the location of where the DB is, works for AWS RDS. For example, us-east-1. </p></td>
+ <td>databases</td>
+ <td><a href="#bytebase.store.ChangedResourceDatabase">ChangedResourceDatabase</a></td>
+ <td>repeated</td>
+ <td><p> </p></td>
</tr>
- <tr>
- <td>warehouse_id</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>warehouse_id is used by Databricks. </p></td>
- </tr>
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.store.InstanceChangeHistoryPayload">InstanceChangeHistoryPayload</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
<tr>
- <td>master_name</td>
- <td><a href="#string">string</a></td>
+ <td>changed_resources</td>
+ <td><a href="#bytebase.store.ChangedResources">ChangedResources</a></td>
<td></td>
- <td><p>master_name is the master name used by connecting redis-master via redis sentinel. </p></td>
+ <td><p> </p></td>
</tr>
- <tr>
- <td>master_username</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>master_username and master_obfuscated_password are master credentials used by redis sentinel mode. </p></td>
- </tr>
+ </tbody>
+ </table>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <div class="file-heading">
+ <h2 id="store/changelog.proto">store/changelog.proto</h2><a href="#title">Top</a>
+ </div>
+ <p></p>
+
+
+ <h3 id="bytebase.store.ChangelogPayload">ChangelogPayload</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
<tr>
- <td>master_obfuscated_password</td>
- <td><a href="#string">string</a></td>
+ <td>task</td>
+ <td><a href="#bytebase.store.ChangelogTask">ChangelogTask</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>redis_type</td>
- <td><a href="#bytebase.store.DataSourceOptions.RedisType">DataSourceOptions.RedisType</a></td>
+ <td>revision</td>
+ <td><a href="#bytebase.store.ChangelogRevision">ChangelogRevision</a></td>
<td></td>
<td><p> </p></td>
</tr>
- <tr>
- <td>use_ssl</td>
- <td><a href="#bool">bool</a></td>
- <td></td>
- <td><p>Use SSL to connect to the data source. By default, we use system default SSL configuration. </p></td>
- </tr>
-
- <tr>
- <td>cluster</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>Cluster is the cluster name for the data source. Used by CockroachDB. </p></td>
- </tr>
-
</tbody>
</table>
@@ -5226,7 +5259,7 @@ Used for authentication when connecting to the data source. </p></td>
- <h3 id="bytebase.store.DataSourceOptions.Address">DataSourceOptions.Address</h3>
+ <h3 id="bytebase.store.ChangelogRevision">ChangelogRevision</h3>
<p></p>
@@ -5237,15 +5270,15 @@ Used for authentication when connecting to the data source. </p></td>
<tbody>
<tr>
- <td>host</td>
+ <td>revision</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p> </p></td>
+ <td><p>Marshalled revision for display </p></td>
</tr>
<tr>
- <td>port</td>
- <td><a href="#string">string</a></td>
+ <td>operation</td>
+ <td><a href="#bytebase.store.ChangelogRevision.Op">ChangelogRevision.Op</a></td>
<td></td>
<td><p> </p></td>
</tr>
@@ -5257,7 +5290,7 @@ Used for authentication when connecting to the data source. </p></td>
- <h3 id="bytebase.store.KerberosConfig">KerberosConfig</h3>
+ <h3 id="bytebase.store.ChangelogTask">ChangelogTask</h3>
<p></p>
@@ -5268,76 +5301,60 @@ Used for authentication when connecting to the data source. </p></td>
<tbody>
<tr>
- <td>primary</td>
+ <td>task_run</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>instance</td>
+ <td>issue</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>realm</td>
- <td><a href="#string">string</a></td>
+ <td>revision</td>
+ <td><a href="#int64">int64</a></td>
<td></td>
- <td><p> </p></td>
+ <td><p>optional </p></td>
</tr>
<tr>
- <td>keytab</td>
- <td><a href="#bytes">bytes</a></td>
+ <td>changed_resources</td>
+ <td><a href="#bytebase.store.ChangedResources">ChangedResources</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>kdc_host</td>
- <td><a href="#string">string</a></td>
+ <td>status</td>
+ <td><a href="#bytebase.store.ChangelogTask.Status">ChangelogTask.Status</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>kdc_port</td>
- <td><a href="#string">string</a></td>
+ <td>prev_sync_history_id</td>
+ <td><a href="#int64">int64</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>kdc_transport_protocol</td>
- <td><a href="#string">string</a></td>
+ <td>sync_history_id</td>
+ <td><a href="#int64">int64</a></td>
<td></td>
<td><p> </p></td>
</tr>
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.store.SASLConfig">SASLConfig</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
<tr>
- <td>krb_config</td>
- <td><a href="#bytebase.store.KerberosConfig">KerberosConfig</a></td>
+ <td>sheet</td>
+ <td><a href="#string">string</a></td>
<td></td>
- <td><p> </p></td>
+ <td><p>The sheet that holds the content.
+Format: projects/{project}/sheets/{sheet} </p></td>
</tr>
</tbody>
@@ -5349,7 +5366,7 @@ Used for authentication when connecting to the data source. </p></td>
- <h3 id="bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.SecretType">DataSourceExternalSecret.AppRoleAuthOption.SecretType</h3>
+ <h3 id="bytebase.store.ChangelogRevision.Op">ChangelogRevision.Op</h3>
<p></p>
<table class="enum-table">
<thead>
@@ -5358,19 +5375,19 @@ Used for authentication when connecting to the data source. </p></td>
<tbody>
<tr>
- <td>SECRET_TYPE_UNSPECIFIED</td>
+ <td>OP_UNSPECIFIED</td>
<td>0</td>
<td><p></p></td>
</tr>
<tr>
- <td>PLAIN</td>
+ <td>CREATE</td>
<td>1</td>
<td><p></p></td>
</tr>
<tr>
- <td>ENVIRONMENT</td>
+ <td>DELETE</td>
<td>2</td>
<td><p></p></td>
</tr>
@@ -5378,7 +5395,7 @@ Used for authentication when connecting to the data source. </p></td>
</tbody>
</table>
- <h3 id="bytebase.store.DataSourceExternalSecret.AuthType">DataSourceExternalSecret.AuthType</h3>
+ <h3 id="bytebase.store.ChangelogTask.Status">ChangelogTask.Status</h3>
<p></p>
<table class="enum-table">
<thead>
@@ -5387,124 +5404,25 @@ Used for authentication when connecting to the data source. </p></td>
<tbody>
<tr>
- <td>AUTH_TYPE_UNSPECIFIED</td>
+ <td>STATUS_UNSPECIFIED</td>
<td>0</td>
<td><p></p></td>
</tr>
<tr>
- <td>TOKEN</td>
+ <td>PENDING</td>
<td>1</td>
- <td><p>ref: https://developer.hashicorp.com/vault/docs/auth/token</p></td>
+ <td><p></p></td>
</tr>
<tr>
- <td>VAULT_APP_ROLE</td>
- <td>2</td>
- <td><p>ref: https://developer.hashicorp.com/vault/docs/auth/approle</p></td>
- </tr>
-
- </tbody>
- </table>
-
- <h3 id="bytebase.store.DataSourceExternalSecret.SecretType">DataSourceExternalSecret.SecretType</h3>
- <p></p>
- <table class="enum-table">
- <thead>
- <tr><td>Name</td><td>Number</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>SAECRET_TYPE_UNSPECIFIED</td>
- <td>0</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>VAULT_KV_V2</td>
- <td>1</td>
- <td><p>ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2</p></td>
- </tr>
-
- <tr>
- <td>AWS_SECRETS_MANAGER</td>
- <td>2</td>
- <td><p>ref: https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html</p></td>
- </tr>
-
- <tr>
- <td>GCP_SECRET_MANAGER</td>
- <td>3</td>
- <td><p>ref: https://cloud.google.com/secret-manager/docs</p></td>
- </tr>
-
- </tbody>
- </table>
-
- <h3 id="bytebase.store.DataSourceOptions.AuthenticationType">DataSourceOptions.AuthenticationType</h3>
- <p></p>
- <table class="enum-table">
- <thead>
- <tr><td>Name</td><td>Number</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>AUTHENTICATION_UNSPECIFIED</td>
- <td>0</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>PASSWORD</td>
- <td>1</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>GOOGLE_CLOUD_SQL_IAM</td>
- <td>2</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>AWS_RDS_IAM</td>
- <td>3</td>
- <td><p></p></td>
- </tr>
-
- </tbody>
- </table>
-
- <h3 id="bytebase.store.DataSourceOptions.RedisType">DataSourceOptions.RedisType</h3>
- <p></p>
- <table class="enum-table">
- <thead>
- <tr><td>Name</td><td>Number</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>REDIS_TYPE_UNSPECIFIED</td>
- <td>0</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>STANDALONE</td>
- <td>1</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>SENTINEL</td>
+ <td>DONE</td>
<td>2</td>
<td><p></p></td>
</tr>
<tr>
- <td>CLUSTER</td>
+ <td>FAILED</td>
<td>3</td>
<td><p></p></td>
</tr>
@@ -5519,12 +5437,12 @@ Used for authentication when connecting to the data source. </p></td>
<div class="file-heading">
- <h2 id="store/db_group.proto">store/db_group.proto</h2><a href="#title">Top</a>
+ <h2 id="store/data_source.proto">store/data_source.proto</h2><a href="#title">Top</a>
</div>
<p></p>
- <h3 id="bytebase.store.DatabaseGroupPayload">DatabaseGroupPayload</h3>
+ <h3 id="bytebase.store.DataSourceExternalSecret">DataSourceExternalSecret</h3>
<p></p>
@@ -5535,48 +5453,59 @@ Used for authentication when connecting to the data source. </p></td>
<tbody>
<tr>
- <td>multitenancy</td>
- <td><a href="#bool">bool</a></td>
+ <td>secret_type</td>
+ <td><a href="#bytebase.store.DataSourceExternalSecret.SecretType">DataSourceExternalSecret.SecretType</a></td>
<td></td>
<td><p> </p></td>
</tr>
- </tbody>
- </table>
-
-
-
-
-
-
-
-
-
-
-
-
-
- <div class="file-heading">
- <h2 id="store/export_archive.proto">store/export_archive.proto</h2><a href="#title">Top</a>
- </div>
- <p></p>
-
-
- <h3 id="bytebase.store.ExportArchivePayload">ExportArchivePayload</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
+ <tr>
+ <td>url</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
<tr>
- <td>file_format</td>
- <td><a href="#bytebase.store.ExportFormat">ExportFormat</a></td>
+ <td>auth_type</td>
+ <td><a href="#bytebase.store.DataSourceExternalSecret.AuthType">DataSourceExternalSecret.AuthType</a></td>
<td></td>
- <td><p>The exported file format. e.g. JSON, CSV, SQL </p></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>app_role</td>
+ <td><a href="#bytebase.store.DataSourceExternalSecret.AppRoleAuthOption">DataSourceExternalSecret.AppRoleAuthOption</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>token</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>engine_name</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>engine name is the name for secret engine. </p></td>
+ </tr>
+
+ <tr>
+ <td>secret_name</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>the secret name in the engine to store the password. </p></td>
+ </tr>
+
+ <tr>
+ <td>password_key_name</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>the key name for the password. </p></td>
</tr>
</tbody>
@@ -5586,21 +5515,7 @@ Used for authentication when connecting to the data source. </p></td>
-
-
-
-
-
-
-
-
- <div class="file-heading">
- <h2 id="store/group.proto">store/group.proto</h2><a href="#title">Top</a>
- </div>
- <p></p>
-
-
- <h3 id="bytebase.store.GroupMember">GroupMember</h3>
+ <h3 id="bytebase.store.DataSourceExternalSecret.AppRoleAuthOption">DataSourceExternalSecret.AppRoleAuthOption</h3>
<p></p>
@@ -5611,21 +5526,33 @@ Used for authentication when connecting to the data source. </p></td>
<tbody>
<tr>
- <td>member</td>
+ <td>role_id</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>Member is the principal who belong to this group.
-
-Format: users/{userUID}. </p></td>
+ <td><p> </p></td>
</tr>
<tr>
- <td>role</td>
- <td><a href="#bytebase.store.GroupMember.Role">GroupMember.Role</a></td>
+ <td>secret_id</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>the secret id for the role without ttl. </p></td>
+ </tr>
+
+ <tr>
+ <td>type</td>
+ <td><a href="#bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.SecretType">DataSourceExternalSecret.AppRoleAuthOption.SecretType</a></td>
<td></td>
<td><p> </p></td>
</tr>
+ <tr>
+ <td>mount_path</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The path where the approle auth method is mounted. </p></td>
+ </tr>
+
</tbody>
</table>
@@ -5633,7 +5560,7 @@ Format: users/{userUID}. </p></td>
- <h3 id="bytebase.store.GroupPayload">GroupPayload</h3>
+ <h3 id="bytebase.store.DataSourceOptions">DataSourceOptions</h3>
<p></p>
@@ -5644,275 +5571,173 @@ Format: users/{userUID}. </p></td>
<tbody>
<tr>
- <td>members</td>
- <td><a href="#bytebase.store.GroupMember">GroupMember</a></td>
- <td>repeated</td>
- <td><p> </p></td>
+ <td>srv</td>
+ <td><a href="#bool">bool</a></td>
+ <td></td>
+ <td><p>srv is a boolean flag that indicates whether the host is a DNS SRV record. </p></td>
</tr>
<tr>
- <td>source</td>
+ <td>authentication_database</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>source means where the group comes from. For now we support Entra ID SCIM sync, so the source could be Entra ID. </p></td>
+ <td><p>authentication_database is the database name to authenticate against, which stores the user credentials. </p></td>
</tr>
- </tbody>
- </table>
-
-
-
-
-
-
-
- <h3 id="bytebase.store.GroupMember.Role">GroupMember.Role</h3>
- <p></p>
- <table class="enum-table">
- <thead>
- <tr><td>Name</td><td>Number</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>ROLE_UNSPECIFIED</td>
- <td>0</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>OWNER</td>
- <td>1</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>MEMBER</td>
- <td>2</td>
- <td><p></p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
-
-
- <div class="file-heading">
- <h2 id="store/idp.proto">store/idp.proto</h2><a href="#title">Top</a>
- </div>
- <p></p>
-
-
- <h3 id="bytebase.store.FieldMapping">FieldMapping</h3>
- <p>FieldMapping saves the field names from user info API of identity provider.</p><p>As we save all raw json string of user info response data into `principal.idp_user_info`,</p><p>we can extract the relevant data based with `FieldMapping`.</p><p>e.g. For GitHub authenticated user API, it will return `login`, `name` and `email` in response.</p><p>Then the identifier of FieldMapping will be `login`, display_name will be `name`,</p><p>and email will be `email`.</p><p>reference: https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#get-the-authenticated-user</p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
<tr>
- <td>identifier</td>
+ <td>sid</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>Identifier is the field name of the unique identifier in 3rd-party idp user info. Required. </p></td>
+ <td><p>sid and service_name are used for Oracle. </p></td>
</tr>
<tr>
- <td>display_name</td>
+ <td>service_name</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>DisplayName is the field name of display name in 3rd-party idp user info. Optional. </p></td>
+ <td><p> </p></td>
</tr>
<tr>
- <td>email</td>
+ <td>ssh_host</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>Email is the field name of primary email in 3rd-party idp user info. Optional. </p></td>
+ <td><p>SSH related
+The hostname of the SSH server agent. </p></td>
</tr>
<tr>
- <td>phone</td>
+ <td>ssh_port</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>Phone is the field name of primary phone in 3rd-party idp user info. Optional. </p></td>
+ <td><p>The port of the SSH server agent. It&#39;s 22 typically. </p></td>
</tr>
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.store.IdentityProviderConfig">IdentityProviderConfig</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
<tr>
- <td>oauth2_config</td>
- <td><a href="#bytebase.store.OAuth2IdentityProviderConfig">OAuth2IdentityProviderConfig</a></td>
+ <td>ssh_user</td>
+ <td><a href="#string">string</a></td>
<td></td>
- <td><p> </p></td>
+ <td><p>The user to login the server. </p></td>
</tr>
<tr>
- <td>oidc_config</td>
- <td><a href="#bytebase.store.OIDCIdentityProviderConfig">OIDCIdentityProviderConfig</a></td>
+ <td>ssh_obfuscated_password</td>
+ <td><a href="#string">string</a></td>
<td></td>
- <td><p> </p></td>
+ <td><p>The password to login the server. If it&#39;s empty string, no password is required. </p></td>
</tr>
<tr>
- <td>ldap_config</td>
- <td><a href="#bytebase.store.LDAPIdentityProviderConfig">LDAPIdentityProviderConfig</a></td>
+ <td>ssh_obfuscated_private_key</td>
+ <td><a href="#string">string</a></td>
<td></td>
- <td><p> </p></td>
+ <td><p>The private key to login the server. If it&#39;s empty string, we will use the system default private key from os.Getenv(&#34;SSH_AUTH_SOCK&#34;). </p></td>
</tr>
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.store.IdentityProviderUserInfo">IdentityProviderUserInfo</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
-
<tr>
- <td>identifier</td>
+ <td>authentication_private_key_obfuscated</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>Identifier is the value of the unique identifier in 3rd-party idp user info. </p></td>
+ <td><p>PKCS#8 private key in PEM format. If it&#39;s empty string, no private key is required.
+Used for authentication when connecting to the data source. </p></td>
</tr>
<tr>
- <td>display_name</td>
- <td><a href="#string">string</a></td>
+ <td>external_secret</td>
+ <td><a href="#bytebase.store.DataSourceExternalSecret">DataSourceExternalSecret</a></td>
<td></td>
- <td><p>DisplayName is the value of display name in 3rd-party idp user info. </p></td>
+ <td><p> </p></td>
</tr>
<tr>
- <td>email</td>
- <td><a href="#string">string</a></td>
+ <td>authentication_type</td>
+ <td><a href="#bytebase.store.DataSourceOptions.AuthenticationType">DataSourceOptions.AuthenticationType</a></td>
<td></td>
- <td><p>Email is the value of primary email in 3rd-party idp user info. </p></td>
+ <td><p> </p></td>
</tr>
<tr>
- <td>phone</td>
- <td><a href="#string">string</a></td>
+ <td>sasl_config</td>
+ <td><a href="#bytebase.store.SASLConfig">SASLConfig</a></td>
<td></td>
- <td><p>Phone is the value of primary phone in 3rd-party idp user info. </p></td>
+ <td><p> </p></td>
</tr>
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.store.LDAPIdentityProviderConfig">LDAPIdentityProviderConfig</h3>
- <p>LDAPIdentityProviderConfig is the structure for LDAP identity provider config.</p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
+ <tr>
+ <td>additional_addresses</td>
+ <td><a href="#bytebase.store.DataSourceOptions.Address">DataSourceOptions.Address</a></td>
+ <td>repeated</td>
+ <td><p>additional_addresses is used for MongoDB replica set. </p></td>
+ </tr>
<tr>
- <td>host</td>
+ <td>replica_set</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>Host is the hostname or IP address of the LDAP server, e.g.
-&#34;ldap.example.com&#34;. </p></td>
+ <td><p>replica_set is used for MongoDB replica set. </p></td>
</tr>
<tr>
- <td>port</td>
- <td><a href="#int32">int32</a></td>
+ <td>direct_connection</td>
+ <td><a href="#bool">bool</a></td>
<td></td>
- <td><p>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. </p></td>
+ <td><p>direct_connection is used for MongoDB to dispatch all the operations to the node specified in the connection string. </p></td>
</tr>
<tr>
- <td>skip_tls_verify</td>
- <td><a href="#bool">bool</a></td>
+ <td>region</td>
+ <td><a href="#string">string</a></td>
<td></td>
- <td><p>SkipTLSVerify controls whether to skip TLS certificate verification. </p></td>
+ <td><p>region is the location of where the DB is, works for AWS RDS. For example, us-east-1. </p></td>
</tr>
<tr>
- <td>bind_dn</td>
+ <td>warehouse_id</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>BindDN is the DN of the user to bind as a service account to perform
-search requests. </p></td>
+ <td><p>warehouse_id is used by Databricks. </p></td>
</tr>
<tr>
- <td>bind_password</td>
+ <td>master_name</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>BindPassword is the password of the user to bind as a service account. </p></td>
+ <td><p>master_name is the master name used by connecting redis-master via redis sentinel. </p></td>
</tr>
<tr>
- <td>base_dn</td>
+ <td>master_username</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>BaseDN is the base DN to search for users, e.g. &#34;ou=users,dc=example,dc=com&#34;. </p></td>
+ <td><p>master_username and master_obfuscated_password are master credentials used by redis sentinel mode. </p></td>
</tr>
<tr>
- <td>user_filter</td>
+ <td>master_obfuscated_password</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>UserFilter is the filter to search for users, e.g. &#34;(uid=%s)&#34;. </p></td>
+ <td><p> </p></td>
</tr>
<tr>
- <td>security_protocol</td>
- <td><a href="#string">string</a></td>
+ <td>redis_type</td>
+ <td><a href="#bytebase.store.DataSourceOptions.RedisType">DataSourceOptions.RedisType</a></td>
<td></td>
- <td><p>SecurityProtocol is the security protocol to be used for establishing
-connections with the LDAP server. It should be either StartTLS or LDAPS, and
-cannot be empty. </p></td>
+ <td><p> </p></td>
</tr>
<tr>
- <td>field_mapping</td>
- <td><a href="#bytebase.store.FieldMapping">FieldMapping</a></td>
+ <td>use_ssl</td>
+ <td><a href="#bool">bool</a></td>
<td></td>
- <td><p>FieldMapping is the mapping of the user attributes returned by the LDAP
-server. </p></td>
+ <td><p>Use SSL to connect to the data source. By default, we use system default SSL configuration. </p></td>
+ </tr>
+
+ <tr>
+ <td>cluster</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>Cluster is the cluster name for the data source. Used by CockroachDB. </p></td>
</tr>
</tbody>
@@ -5922,8 +5747,8 @@ server. </p></td>
- <h3 id="bytebase.store.OAuth2IdentityProviderConfig">OAuth2IdentityProviderConfig</h3>
- <p>OAuth2IdentityProviderConfig is the structure for OAuth2 identity provider config.</p>
+ <h3 id="bytebase.store.DataSourceOptions.Address">DataSourceOptions.Address</h3>
+ <p></p>
<table class="field-table">
@@ -5933,64 +5758,81 @@ server. </p></td>
<tbody>
<tr>
- <td>auth_url</td>
+ <td>host</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>token_url</td>
+ <td>port</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.store.KerberosConfig">KerberosConfig</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
<tr>
- <td>user_info_url</td>
+ <td>primary</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>client_id</td>
+ <td>instance</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>client_secret</td>
+ <td>realm</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>scopes</td>
- <td><a href="#string">string</a></td>
- <td>repeated</td>
+ <td>keytab</td>
+ <td><a href="#bytes">bytes</a></td>
+ <td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>field_mapping</td>
- <td><a href="#bytebase.store.FieldMapping">FieldMapping</a></td>
+ <td>kdc_host</td>
+ <td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>skip_tls_verify</td>
- <td><a href="#bool">bool</a></td>
+ <td>kdc_port</td>
+ <td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>auth_style</td>
- <td><a href="#bytebase.store.OAuth2AuthStyle">OAuth2AuthStyle</a></td>
+ <td>kdc_transport_protocol</td>
+ <td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>
@@ -6002,8 +5844,8 @@ server. </p></td>
- <h3 id="bytebase.store.OIDCIdentityProviderConfig">OIDCIdentityProviderConfig</h3>
- <p>OIDCIdentityProviderConfig is the structure for OIDC identity provider config.</p>
+ <h3 id="bytebase.store.SASLConfig">SASLConfig</h3>
+ <p></p>
<table class="field-table">
@@ -6013,45 +5855,327 @@ server. </p></td>
<tbody>
<tr>
- <td>issuer</td>
- <td><a href="#string">string</a></td>
+ <td>krb_config</td>
+ <td><a href="#bytebase.store.KerberosConfig">KerberosConfig</a></td>
<td></td>
<td><p> </p></td>
</tr>
+ </tbody>
+ </table>
+
+
+
+
+
+
+
+ <h3 id="bytebase.store.DataSourceExternalSecret.AppRoleAuthOption.SecretType">DataSourceExternalSecret.AppRoleAuthOption.SecretType</h3>
+ <p></p>
+ <table class="enum-table">
+ <thead>
+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>SECRET_TYPE_UNSPECIFIED</td>
+ <td>0</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>PLAIN</td>
+ <td>1</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>ENVIRONMENT</td>
+ <td>2</td>
+ <td><p></p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+ <h3 id="bytebase.store.DataSourceExternalSecret.AuthType">DataSourceExternalSecret.AuthType</h3>
+ <p></p>
+ <table class="enum-table">
+ <thead>
+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>AUTH_TYPE_UNSPECIFIED</td>
+ <td>0</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>TOKEN</td>
+ <td>1</td>
+ <td><p>ref: https://developer.hashicorp.com/vault/docs/auth/token</p></td>
+ </tr>
+
+ <tr>
+ <td>VAULT_APP_ROLE</td>
+ <td>2</td>
+ <td><p>ref: https://developer.hashicorp.com/vault/docs/auth/approle</p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+ <h3 id="bytebase.store.DataSourceExternalSecret.SecretType">DataSourceExternalSecret.SecretType</h3>
+ <p></p>
+ <table class="enum-table">
+ <thead>
+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>SAECRET_TYPE_UNSPECIFIED</td>
+ <td>0</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>VAULT_KV_V2</td>
+ <td>1</td>
+ <td><p>ref: https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2</p></td>
+ </tr>
+
+ <tr>
+ <td>AWS_SECRETS_MANAGER</td>
+ <td>2</td>
+ <td><p>ref: https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html</p></td>
+ </tr>
+
+ <tr>
+ <td>GCP_SECRET_MANAGER</td>
+ <td>3</td>
+ <td><p>ref: https://cloud.google.com/secret-manager/docs</p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+ <h3 id="bytebase.store.DataSourceOptions.AuthenticationType">DataSourceOptions.AuthenticationType</h3>
+ <p></p>
+ <table class="enum-table">
+ <thead>
+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>AUTHENTICATION_UNSPECIFIED</td>
+ <td>0</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>PASSWORD</td>
+ <td>1</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>GOOGLE_CLOUD_SQL_IAM</td>
+ <td>2</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>AWS_RDS_IAM</td>
+ <td>3</td>
+ <td><p></p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+ <h3 id="bytebase.store.DataSourceOptions.RedisType">DataSourceOptions.RedisType</h3>
+ <p></p>
+ <table class="enum-table">
+ <thead>
+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>REDIS_TYPE_UNSPECIFIED</td>
+ <td>0</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>STANDALONE</td>
+ <td>1</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>SENTINEL</td>
+ <td>2</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>CLUSTER</td>
+ <td>3</td>
+ <td><p></p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+
+
+ <div class="file-heading">
+ <h2 id="store/db_group.proto">store/db_group.proto</h2><a href="#title">Top</a>
+ </div>
+ <p></p>
+
+
+ <h3 id="bytebase.store.DatabaseGroupPayload">DatabaseGroupPayload</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
<tr>
- <td>client_id</td>
- <td><a href="#string">string</a></td>
+ <td>multitenancy</td>
+ <td><a href="#bool">bool</a></td>
<td></td>
<td><p> </p></td>
</tr>
+ </tbody>
+ </table>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <div class="file-heading">
+ <h2 id="store/export_archive.proto">store/export_archive.proto</h2><a href="#title">Top</a>
+ </div>
+ <p></p>
+
+
+ <h3 id="bytebase.store.ExportArchivePayload">ExportArchivePayload</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
<tr>
- <td>client_secret</td>
+ <td>file_format</td>
+ <td><a href="#bytebase.store.ExportFormat">ExportFormat</a></td>
+ <td></td>
+ <td><p>The exported file format. e.g. JSON, CSV, SQL </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <div class="file-heading">
+ <h2 id="store/group.proto">store/group.proto</h2><a href="#title">Top</a>
+ </div>
+ <p></p>
+
+
+ <h3 id="bytebase.store.GroupMember">GroupMember</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>member</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p> </p></td>
+ <td><p>Member is the principal who belong to this group.
+
+Format: users/{userUID}. </p></td>
</tr>
<tr>
- <td>field_mapping</td>
- <td><a href="#bytebase.store.FieldMapping">FieldMapping</a></td>
+ <td>role</td>
+ <td><a href="#bytebase.store.GroupMember.Role">GroupMember.Role</a></td>
<td></td>
<td><p> </p></td>
</tr>
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.store.GroupPayload">GroupPayload</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
<tr>
- <td>skip_tls_verify</td>
- <td><a href="#bool">bool</a></td>
- <td></td>
+ <td>members</td>
+ <td><a href="#bytebase.store.GroupMember">GroupMember</a></td>
+ <td>repeated</td>
<td><p> </p></td>
</tr>
<tr>
- <td>auth_style</td>
- <td><a href="#bytebase.store.OAuth2AuthStyle">OAuth2AuthStyle</a></td>
+ <td>source</td>
+ <td><a href="#string">string</a></td>
<td></td>
- <td><p> </p></td>
+ <td><p>source means where the group comes from. For now we support Entra ID SCIM sync, so the source could be Entra ID. </p></td>
</tr>
</tbody>
@@ -6063,7 +6187,7 @@ server. </p></td>
- <h3 id="bytebase.store.IdentityProviderType">IdentityProviderType</h3>
+ <h3 id="bytebase.store.GroupMember.Role">GroupMember.Role</h3>
<p></p>
<table class="enum-table">
<thead>
@@ -6072,60 +6196,23 @@ server. </p></td>
<tbody>
<tr>
- <td>IDENTITY_PROVIDER_TYPE_UNSPECIFIED</td>
+ <td>ROLE_UNSPECIFIED</td>
<td>0</td>
<td><p></p></td>
</tr>
<tr>
- <td>OAUTH2</td>
+ <td>OWNER</td>
<td>1</td>
<td><p></p></td>
</tr>
<tr>
- <td>OIDC</td>
+ <td>MEMBER</td>
<td>2</td>
<td><p></p></td>
</tr>
- <tr>
- <td>LDAP</td>
- <td>3</td>
- <td><p></p></td>
- </tr>
-
- </tbody>
- </table>
-
- <h3 id="bytebase.store.OAuth2AuthStyle">OAuth2AuthStyle</h3>
- <p></p>
- <table class="enum-table">
- <thead>
- <tr><td>Name</td><td>Number</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>OAUTH2_AUTH_STYLE_UNSPECIFIED</td>
- <td>0</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>IN_PARAMS</td>
- <td>1</td>
- <td><p>IN_PARAMS sends the &#34;client_id&#34; and &#34;client_secret&#34; in the POST body
-as application/x-www-form-urlencoded parameters.</p></td>
- </tr>
-
- <tr>
- <td>IN_HEADER</td>
- <td>2</td>
- <td><p>IN_HEADER sends the client_id and client_password using HTTP Basic Authorization.
-This is an optional style described in the OAuth2 RFC 6749 section 2.3.1.</p></td>
- </tr>
-
</tbody>
</table>
@@ -6136,13 +6223,13 @@ This is an optional style described in the OAuth2 RFC 6749 section 2.3.1.</p></t
<div class="file-heading">
- <h2 id="store/instance.proto">store/instance.proto</h2><a href="#title">Top</a>
+ <h2 id="store/idp.proto">store/idp.proto</h2><a href="#title">Top</a>
</div>
<p></p>
- <h3 id="bytebase.store.InstanceMetadata">InstanceMetadata</h3>
- <p>InstanceMetadata is the metadata for instances.</p>
+ <h3 id="bytebase.store.FieldMapping">FieldMapping</h3>
+ <p>FieldMapping saves the field names from user info API of identity provider.</p><p>As we save all raw json string of user info response data into `principal.idp_user_info`,</p><p>we can extract the relevant data based with `FieldMapping`.</p><p>e.g. For GitHub authenticated user API, it will return `login`, `name` and `email` in response.</p><p>Then the identifier of FieldMapping will be `login`, display_name will be `name`,</p><p>and email will be `email`.</p><p>reference: https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#get-the-authenticated-user</p>
<table class="field-table">
@@ -6152,25 +6239,31 @@ This is an optional style described in the OAuth2 RFC 6749 section 2.3.1.</p></t
<tbody>
<tr>
- <td>mysql_lower_case_table_names</td>
- <td><a href="#int32">int32</a></td>
+ <td>identifier</td>
+ <td><a href="#string">string</a></td>
<td></td>
- <td><p>The lower_case_table_names config for MySQL instances.
-It is used to determine whether the table names and database names are case sensitive. </p></td>
+ <td><p>Identifier is the field name of the unique identifier in 3rd-party idp user info. Required. </p></td>
</tr>
<tr>
- <td>last_sync_time</td>
- <td><a href="#google.protobuf.Timestamp">google.protobuf.Timestamp</a></td>
+ <td>display_name</td>
+ <td><a href="#string">string</a></td>
<td></td>
- <td><p> </p></td>
+ <td><p>DisplayName is the field name of display name in 3rd-party idp user info. Optional. </p></td>
</tr>
<tr>
- <td>roles</td>
- <td><a href="#bytebase.store.InstanceRole">InstanceRole</a></td>
- <td>repeated</td>
- <td><p> </p></td>
+ <td>email</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>Email is the field name of primary email in 3rd-party idp user info. Optional. </p></td>
+ </tr>
+
+ <tr>
+ <td>phone</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>Phone is the field name of primary phone in 3rd-party idp user info. Optional. </p></td>
</tr>
</tbody>
@@ -6180,8 +6273,8 @@ It is used to determine whether the table names and database names are case sens
- <h3 id="bytebase.store.InstanceOptions">InstanceOptions</h3>
- <p>InstanceOptions is the option for instances.</p>
+ <h3 id="bytebase.store.IdentityProviderConfig">IdentityProviderConfig</h3>
+ <p></p>
<table class="field-table">
@@ -6191,18 +6284,24 @@ It is used to determine whether the table names and database names are case sens
<tbody>
<tr>
- <td>sync_interval</td>
- <td><a href="#google.protobuf.Duration">google.protobuf.Duration</a></td>
+ <td>oauth2_config</td>
+ <td><a href="#bytebase.store.OAuth2IdentityProviderConfig">OAuth2IdentityProviderConfig</a></td>
<td></td>
- <td><p>How often the instance is synced. </p></td>
+ <td><p> </p></td>
</tr>
<tr>
- <td>maximum_connections</td>
- <td><a href="#int32">int32</a></td>
+ <td>oidc_config</td>
+ <td><a href="#bytebase.store.OIDCIdentityProviderConfig">OIDCIdentityProviderConfig</a></td>
<td></td>
- <td><p>The maximum number of connections.
-The default is 10 if the value is unset or zero. </p></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>ldap_config</td>
+ <td><a href="#bytebase.store.LDAPIdentityProviderConfig">LDAPIdentityProviderConfig</a></td>
+ <td></td>
+ <td><p> </p></td>
</tr>
</tbody>
@@ -6212,8 +6311,8 @@ The default is 10 if the value is unset or zero. </p></td>
- <h3 id="bytebase.store.InstanceRole">InstanceRole</h3>
- <p>InstanceRole is the API message for instance role.</p>
+ <h3 id="bytebase.store.IdentityProviderUserInfo">IdentityProviderUserInfo</h3>
+ <p></p>
<table class="field-table">
@@ -6223,33 +6322,31 @@ The default is 10 if the value is unset or zero. </p></td>
<tbody>
<tr>
- <td>name</td>
+ <td>identifier</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p>The role name. </p></td>
+ <td><p>Identifier is the value of the unique identifier in 3rd-party idp user info. </p></td>
</tr>
<tr>
- <td>connection_limit</td>
- <td><a href="#int32">int32</a></td>
- <td>optional</td>
- <td><p>The connection count limit for this role. </p></td>
+ <td>display_name</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>DisplayName is the value of display name in 3rd-party idp user info. </p></td>
</tr>
<tr>
- <td>valid_until</td>
+ <td>email</td>
<td><a href="#string">string</a></td>
- <td>optional</td>
- <td><p>The expiration for the role&#39;s password. </p></td>
+ <td></td>
+ <td><p>Email is the value of primary email in 3rd-party idp user info. </p></td>
</tr>
<tr>
- <td>attribute</td>
+ <td>phone</td>
<td><a href="#string">string</a></td>
- <td>optional</td>
- <td><p>The role attribute.
-For PostgreSQL, it containt 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&#39;s the global privileges as GRANT statements, which means it only contains &#34;GRANT ... ON *.* TO ...&#34;. Docs: https://dev.mysql.com/doc/refman/8.0/en/grant.html </p></td>
+ <td></td>
+ <td><p>Phone is the value of primary phone in 3rd-party idp user info. </p></td>
</tr>
</tbody>
@@ -6259,22 +6356,8 @@ For MySQL, it&#39;s the global privileges as GRANT statements, which means it on
-
-
-
-
-
-
-
-
- <div class="file-heading">
- <h2 id="store/instance_change_history.proto">store/instance_change_history.proto</h2><a href="#title">Top</a>
- </div>
- <p></p>
-
-
- <h3 id="bytebase.store.ChangedResourceDatabase">ChangedResourceDatabase</h3>
- <p></p>
+ <h3 id="bytebase.store.LDAPIdentityProviderConfig">LDAPIdentityProviderConfig</h3>
+ <p>LDAPIdentityProviderConfig is the structure for LDAP identity provider config.</p>
<table class="field-table">
@@ -6284,79 +6367,73 @@ For MySQL, it&#39;s the global privileges as GRANT statements, which means it on
<tbody>
<tr>
- <td>name</td>
+ <td>host</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p> </p></td>
+ <td><p>Host is the hostname or IP address of the LDAP server, e.g.
+&#34;ldap.example.com&#34;. </p></td>
</tr>
<tr>
- <td>schemas</td>
- <td><a href="#bytebase.store.ChangedResourceSchema">ChangedResourceSchema</a></td>
- <td>repeated</td>
- <td><p> </p></td>
+ <td>port</td>
+ <td><a href="#int32">int32</a></td>
+ <td></td>
+ <td><p>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. </p></td>
</tr>
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.store.ChangedResourceFunction">ChangedResourceFunction</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
+ <tr>
+ <td>skip_tls_verify</td>
+ <td><a href="#bool">bool</a></td>
+ <td></td>
+ <td><p>SkipTLSVerify controls whether to skip TLS certificate verification. </p></td>
+ </tr>
<tr>
- <td>name</td>
+ <td>bind_dn</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p> </p></td>
+ <td><p>BindDN is the DN of the user to bind as a service account to perform
+search requests. </p></td>
</tr>
<tr>
- <td>ranges</td>
- <td><a href="#bytebase.store.Range">Range</a></td>
- <td>repeated</td>
- <td><p>The ranges of sub-strings correspond to the statements on the sheet. </p></td>
+ <td>bind_password</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>BindPassword is the password of the user to bind as a service account. </p></td>
</tr>
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.store.ChangedResourceProcedure">ChangedResourceProcedure</h3>
- <p></p>
-
-
- <table class="field-table">
- <thead>
- <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
- </thead>
- <tbody>
+ <tr>
+ <td>base_dn</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>BaseDN is the base DN to search for users, e.g. &#34;ou=users,dc=example,dc=com&#34;. </p></td>
+ </tr>
<tr>
- <td>name</td>
+ <td>user_filter</td>
<td><a href="#string">string</a></td>
<td></td>
- <td><p> </p></td>
+ <td><p>UserFilter is the filter to search for users, e.g. &#34;(uid=%s)&#34;. </p></td>
</tr>
<tr>
- <td>ranges</td>
- <td><a href="#bytebase.store.Range">Range</a></td>
- <td>repeated</td>
- <td><p>The ranges of sub-strings correspond to the statements on the sheet. </p></td>
+ <td>security_protocol</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>SecurityProtocol is the security protocol to be used for establishing
+connections with the LDAP server. It should be either StartTLS or LDAPS, and
+cannot be empty. </p></td>
+ </tr>
+
+ <tr>
+ <td>field_mapping</td>
+ <td><a href="#bytebase.store.FieldMapping">FieldMapping</a></td>
+ <td></td>
+ <td><p>FieldMapping is the mapping of the user attributes returned by the LDAP
+server. </p></td>
</tr>
</tbody>
@@ -6366,8 +6443,8 @@ For MySQL, it&#39;s the global privileges as GRANT statements, which means it on
- <h3 id="bytebase.store.ChangedResourceSchema">ChangedResourceSchema</h3>
- <p></p>
+ <h3 id="bytebase.store.OAuth2IdentityProviderConfig">OAuth2IdentityProviderConfig</h3>
+ <p>OAuth2IdentityProviderConfig is the structure for OAuth2 identity provider config.</p>
<table class="field-table">
@@ -6377,40 +6454,68 @@ For MySQL, it&#39;s the global privileges as GRANT statements, which means it on
<tbody>
<tr>
- <td>name</td>
+ <td>auth_url</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>tables</td>
- <td><a href="#bytebase.store.ChangedResourceTable">ChangedResourceTable</a></td>
- <td>repeated</td>
+ <td>token_url</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>views</td>
- <td><a href="#bytebase.store.ChangedResourceView">ChangedResourceView</a></td>
- <td>repeated</td>
+ <td>user_info_url</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>functions</td>
- <td><a href="#bytebase.store.ChangedResourceFunction">ChangedResourceFunction</a></td>
- <td>repeated</td>
+ <td>client_id</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>procedures</td>
- <td><a href="#bytebase.store.ChangedResourceProcedure">ChangedResourceProcedure</a></td>
+ <td>client_secret</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>scopes</td>
+ <td><a href="#string">string</a></td>
<td>repeated</td>
<td><p> </p></td>
</tr>
+ <tr>
+ <td>field_mapping</td>
+ <td><a href="#bytebase.store.FieldMapping">FieldMapping</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>skip_tls_verify</td>
+ <td><a href="#bool">bool</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>auth_style</td>
+ <td><a href="#bytebase.store.OAuth2AuthStyle">OAuth2AuthStyle</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
</tbody>
</table>
@@ -6418,8 +6523,8 @@ For MySQL, it&#39;s the global privileges as GRANT statements, which means it on
- <h3 id="bytebase.store.ChangedResourceTable">ChangedResourceTable</h3>
- <p></p>
+ <h3 id="bytebase.store.OIDCIdentityProviderConfig">OIDCIdentityProviderConfig</h3>
+ <p>OIDCIdentityProviderConfig is the structure for OIDC identity provider config.</p>
<table class="field-table">
@@ -6429,24 +6534,45 @@ For MySQL, it&#39;s the global privileges as GRANT statements, which means it on
<tbody>
<tr>
- <td>name</td>
+ <td>issuer</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>table_rows</td>
- <td><a href="#int64">int64</a></td>
+ <td>client_id</td>
+ <td><a href="#string">string</a></td>
<td></td>
- <td><p>estimated row count of the table </p></td>
+ <td><p> </p></td>
</tr>
<tr>
- <td>ranges</td>
- <td><a href="#bytebase.store.Range">Range</a></td>
- <td>repeated</td>
- <td><p>The ranges of sub-strings correspond to the statements on the sheet. </p></td>
+ <td>client_secret</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>field_mapping</td>
+ <td><a href="#bytebase.store.FieldMapping">FieldMapping</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>skip_tls_verify</td>
+ <td><a href="#bool">bool</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>auth_style</td>
+ <td><a href="#bytebase.store.OAuth2AuthStyle">OAuth2AuthStyle</a></td>
+ <td></td>
+ <td><p> </p></td>
</tr>
</tbody>
@@ -6456,8 +6582,88 @@ For MySQL, it&#39;s the global privileges as GRANT statements, which means it on
- <h3 id="bytebase.store.ChangedResourceView">ChangedResourceView</h3>
+
+
+ <h3 id="bytebase.store.IdentityProviderType">IdentityProviderType</h3>
+ <p></p>
+ <table class="enum-table">
+ <thead>
+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>IDENTITY_PROVIDER_TYPE_UNSPECIFIED</td>
+ <td>0</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>OAUTH2</td>
+ <td>1</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>OIDC</td>
+ <td>2</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>LDAP</td>
+ <td>3</td>
+ <td><p></p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+ <h3 id="bytebase.store.OAuth2AuthStyle">OAuth2AuthStyle</h3>
<p></p>
+ <table class="enum-table">
+ <thead>
+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>OAUTH2_AUTH_STYLE_UNSPECIFIED</td>
+ <td>0</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>IN_PARAMS</td>
+ <td>1</td>
+ <td><p>IN_PARAMS sends the &#34;client_id&#34; and &#34;client_secret&#34; in the POST body
+as application/x-www-form-urlencoded parameters.</p></td>
+ </tr>
+
+ <tr>
+ <td>IN_HEADER</td>
+ <td>2</td>
+ <td><p>IN_HEADER sends the client_id and client_password using HTTP Basic Authorization.
+This is an optional style described in the OAuth2 RFC 6749 section 2.3.1.</p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+
+
+ <div class="file-heading">
+ <h2 id="store/instance.proto">store/instance.proto</h2><a href="#title">Top</a>
+ </div>
+ <p></p>
+
+
+ <h3 id="bytebase.store.InstanceMetadata">InstanceMetadata</h3>
+ <p>InstanceMetadata is the metadata for instances.</p>
<table class="field-table">
@@ -6467,17 +6673,25 @@ For MySQL, it&#39;s the global privileges as GRANT statements, which means it on
<tbody>
<tr>
- <td>name</td>
- <td><a href="#string">string</a></td>
+ <td>mysql_lower_case_table_names</td>
+ <td><a href="#int32">int32</a></td>
+ <td></td>
+ <td><p>The lower_case_table_names config for MySQL instances.
+It is used to determine whether the table names and database names are case sensitive. </p></td>
+ </tr>
+
+ <tr>
+ <td>last_sync_time</td>
+ <td><a href="#google.protobuf.Timestamp">google.protobuf.Timestamp</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
- <td>ranges</td>
- <td><a href="#bytebase.store.Range">Range</a></td>
+ <td>roles</td>
+ <td><a href="#bytebase.store.InstanceRole">InstanceRole</a></td>
<td>repeated</td>
- <td><p>The ranges of sub-strings correspond to the statements on the sheet. </p></td>
+ <td><p> </p></td>
</tr>
</tbody>
@@ -6487,8 +6701,8 @@ For MySQL, it&#39;s the global privileges as GRANT statements, which means it on
- <h3 id="bytebase.store.ChangedResources">ChangedResources</h3>
- <p></p>
+ <h3 id="bytebase.store.InstanceOptions">InstanceOptions</h3>
+ <p>InstanceOptions is the option for instances.</p>
<table class="field-table">
@@ -6498,10 +6712,18 @@ For MySQL, it&#39;s the global privileges as GRANT statements, which means it on
<tbody>
<tr>
- <td>databases</td>
- <td><a href="#bytebase.store.ChangedResourceDatabase">ChangedResourceDatabase</a></td>
- <td>repeated</td>
- <td><p> </p></td>
+ <td>sync_interval</td>
+ <td><a href="#google.protobuf.Duration">google.protobuf.Duration</a></td>
+ <td></td>
+ <td><p>How often the instance is synced. </p></td>
+ </tr>
+
+ <tr>
+ <td>maximum_connections</td>
+ <td><a href="#int32">int32</a></td>
+ <td></td>
+ <td><p>The maximum number of connections.
+The default is 10 if the value is unset or zero. </p></td>
</tr>
</tbody>
@@ -6511,8 +6733,8 @@ For MySQL, it&#39;s the global privileges as GRANT statements, which means it on
- <h3 id="bytebase.store.InstanceChangeHistoryPayload">InstanceChangeHistoryPayload</h3>
- <p></p>
+ <h3 id="bytebase.store.InstanceRole">InstanceRole</h3>
+ <p>InstanceRole is the API message for instance role.</p>
<table class="field-table">
@@ -6522,10 +6744,33 @@ For MySQL, it&#39;s the global privileges as GRANT statements, which means it on
<tbody>
<tr>
- <td>changed_resources</td>
- <td><a href="#bytebase.store.ChangedResources">ChangedResources</a></td>
+ <td>name</td>
+ <td><a href="#string">string</a></td>
<td></td>
- <td><p> </p></td>
+ <td><p>The role name. </p></td>
+ </tr>
+
+ <tr>
+ <td>connection_limit</td>
+ <td><a href="#int32">int32</a></td>
+ <td>optional</td>
+ <td><p>The connection count limit for this role. </p></td>
+ </tr>
+
+ <tr>
+ <td>valid_until</td>
+ <td><a href="#string">string</a></td>
+ <td>optional</td>
+ <td><p>The expiration for the role&#39;s password. </p></td>
+ </tr>
+
+ <tr>
+ <td>attribute</td>
+ <td><a href="#string">string</a></td>
+ <td>optional</td>
+ <td><p>The role attribute.
+For PostgreSQL, it containt 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&#39;s the global privileges as GRANT statements, which means it only contains &#34;GRANT ... ON *.* TO ...&#34;. Docs: https://dev.mysql.com/doc/refman/8.0/en/grant.html </p></td>
</tr>
</tbody>
diff --git a/proto/generated-go/store/changelog.pb.go b/proto/generated-go/store/changelog.pb.go
new file mode 100644
index 0000000000..d5010b8a65
--- /dev/null
+++ b/proto/generated-go/store/changelog.pb.go
@@ -0,0 +1,452 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.35.1
+// protoc (unknown)
+// source: store/changelog.proto
+
+package store
+
+import (
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ reflect "reflect"
+ sync "sync"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type ChangelogTask_Status int32
+
+const (
+ ChangelogTask_STATUS_UNSPECIFIED ChangelogTask_Status = 0
+ ChangelogTask_PENDING ChangelogTask_Status = 1
+ ChangelogTask_DONE ChangelogTask_Status = 2
+ ChangelogTask_FAILED ChangelogTask_Status = 3
+)
+
+// Enum value maps for ChangelogTask_Status.
+var (
+ ChangelogTask_Status_name = map[int32]string{
+ 0: "STATUS_UNSPECIFIED",
+ 1: "PENDING",
+ 2: "DONE",
+ 3: "FAILED",
+ }
+ ChangelogTask_Status_value = map[string]int32{
+ "STATUS_UNSPECIFIED": 0,
+ "PENDING": 1,
+ "DONE": 2,
+ "FAILED": 3,
+ }
+)
+
+func (x ChangelogTask_Status) Enum() *ChangelogTask_Status {
+ p := new(ChangelogTask_Status)
+ *p = x
+ return p
+}
+
+func (x ChangelogTask_Status) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (ChangelogTask_Status) Descriptor() protoreflect.EnumDescriptor {
+ return file_store_changelog_proto_enumTypes[0].Descriptor()
+}
+
+func (ChangelogTask_Status) Type() protoreflect.EnumType {
+ return &file_store_changelog_proto_enumTypes[0]
+}
+
+func (x ChangelogTask_Status) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use ChangelogTask_Status.Descriptor instead.
+func (ChangelogTask_Status) EnumDescriptor() ([]byte, []int) {
+ return file_store_changelog_proto_rawDescGZIP(), []int{1, 0}
+}
+
+type ChangelogRevision_Op int32
+
+const (
+ ChangelogRevision_OP_UNSPECIFIED ChangelogRevision_Op = 0
+ ChangelogRevision_CREATE ChangelogRevision_Op = 1
+ ChangelogRevision_DELETE ChangelogRevision_Op = 2
+)
+
+// Enum value maps for ChangelogRevision_Op.
+var (
+ ChangelogRevision_Op_name = map[int32]string{
+ 0: "OP_UNSPECIFIED",
+ 1: "CREATE",
+ 2: "DELETE",
+ }
+ ChangelogRevision_Op_value = map[string]int32{
+ "OP_UNSPECIFIED": 0,
+ "CREATE": 1,
+ "DELETE": 2,
+ }
+)
+
+func (x ChangelogRevision_Op) Enum() *ChangelogRevision_Op {
+ p := new(ChangelogRevision_Op)
+ *p = x
+ return p
+}
+
+func (x ChangelogRevision_Op) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (ChangelogRevision_Op) Descriptor() protoreflect.EnumDescriptor {
+ return file_store_changelog_proto_enumTypes[1].Descriptor()
+}
+
+func (ChangelogRevision_Op) Type() protoreflect.EnumType {
+ return &file_store_changelog_proto_enumTypes[1]
+}
+
+func (x ChangelogRevision_Op) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use ChangelogRevision_Op.Descriptor instead.
+func (ChangelogRevision_Op) EnumDescriptor() ([]byte, []int) {
+ return file_store_changelog_proto_rawDescGZIP(), []int{2, 0}
+}
+
+type ChangelogPayload struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Task *ChangelogTask `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"`
+ Revision *ChangelogRevision `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"`
+}
+
+func (x *ChangelogPayload) Reset() {
+ *x = ChangelogPayload{}
+ mi := &file_store_changelog_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *ChangelogPayload) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ChangelogPayload) ProtoMessage() {}
+
+func (x *ChangelogPayload) ProtoReflect() protoreflect.Message {
+ mi := &file_store_changelog_proto_msgTypes[0]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ChangelogPayload.ProtoReflect.Descriptor instead.
+func (*ChangelogPayload) Descriptor() ([]byte, []int) {
+ return file_store_changelog_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *ChangelogPayload) GetTask() *ChangelogTask {
+ if x != nil {
+ return x.Task
+ }
+ return nil
+}
+
+func (x *ChangelogPayload) GetRevision() *ChangelogRevision {
+ if x != nil {
+ return x.Revision
+ }
+ return nil
+}
+
+type ChangelogTask struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ TaskRun string `protobuf:"bytes,1,opt,name=task_run,json=taskRun,proto3" json:"task_run,omitempty"`
+ Issue string `protobuf:"bytes,2,opt,name=issue,proto3" json:"issue,omitempty"`
+ // optional
+ Revision int64 `protobuf:"varint,3,opt,name=revision,proto3" json:"revision,omitempty"`
+ ChangedResources *ChangedResources `protobuf:"bytes,4,opt,name=changed_resources,json=changedResources,proto3" json:"changed_resources,omitempty"`
+ Status ChangelogTask_Status `protobuf:"varint,5,opt,name=status,proto3,enum=bytebase.store.ChangelogTask_Status" json:"status,omitempty"`
+ PrevSyncHistoryId int64 `protobuf:"varint,6,opt,name=prev_sync_history_id,json=prevSyncHistoryId,proto3" json:"prev_sync_history_id,omitempty"`
+ SyncHistoryId int64 `protobuf:"varint,7,opt,name=sync_history_id,json=syncHistoryId,proto3" json:"sync_history_id,omitempty"`
+ // The sheet that holds the content.
+ // Format: projects/{project}/sheets/{sheet}
+ Sheet string `protobuf:"bytes,8,opt,name=sheet,proto3" json:"sheet,omitempty"`
+}
+
+func (x *ChangelogTask) Reset() {
+ *x = ChangelogTask{}
+ mi := &file_store_changelog_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *ChangelogTask) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ChangelogTask) ProtoMessage() {}
+
+func (x *ChangelogTask) ProtoReflect() protoreflect.Message {
+ mi := &file_store_changelog_proto_msgTypes[1]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ChangelogTask.ProtoReflect.Descriptor instead.
+func (*ChangelogTask) Descriptor() ([]byte, []int) {
+ return file_store_changelog_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *ChangelogTask) GetTaskRun() string {
+ if x != nil {
+ return x.TaskRun
+ }
+ return ""
+}
+
+func (x *ChangelogTask) GetIssue() string {
+ if x != nil {
+ return x.Issue
+ }
+ return ""
+}
+
+func (x *ChangelogTask) GetRevision() int64 {
+ if x != nil {
+ return x.Revision
+ }
+ return 0
+}
+
+func (x *ChangelogTask) GetChangedResources() *ChangedResources {
+ if x != nil {
+ return x.ChangedResources
+ }
+ return nil
+}
+
+func (x *ChangelogTask) GetStatus() ChangelogTask_Status {
+ if x != nil {
+ return x.Status
+ }
+ return ChangelogTask_STATUS_UNSPECIFIED
+}
+
+func (x *ChangelogTask) GetPrevSyncHistoryId() int64 {
+ if x != nil {
+ return x.PrevSyncHistoryId
+ }
+ return 0
+}
+
+func (x *ChangelogTask) GetSyncHistoryId() int64 {
+ if x != nil {
+ return x.SyncHistoryId
+ }
+ return 0
+}
+
+func (x *ChangelogTask) GetSheet() string {
+ if x != nil {
+ return x.Sheet
+ }
+ return ""
+}
+
+type ChangelogRevision struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // Marshalled revision for display
+ Revision string `protobuf:"bytes,1,opt,name=revision,proto3" json:"revision,omitempty"`
+ Operation ChangelogRevision_Op `protobuf:"varint,2,opt,name=operation,proto3,enum=bytebase.store.ChangelogRevision_Op" json:"operation,omitempty"`
+}
+
+func (x *ChangelogRevision) Reset() {
+ *x = ChangelogRevision{}
+ mi := &file_store_changelog_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *ChangelogRevision) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ChangelogRevision) ProtoMessage() {}
+
+func (x *ChangelogRevision) ProtoReflect() protoreflect.Message {
+ mi := &file_store_changelog_proto_msgTypes[2]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ChangelogRevision.ProtoReflect.Descriptor instead.
+func (*ChangelogRevision) Descriptor() ([]byte, []int) {
+ return file_store_changelog_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *ChangelogRevision) GetRevision() string {
+ if x != nil {
+ return x.Revision
+ }
+ return ""
+}
+
+func (x *ChangelogRevision) GetOperation() ChangelogRevision_Op {
+ if x != nil {
+ return x.Operation
+ }
+ return ChangelogRevision_OP_UNSPECIFIED
+}
+
+var File_store_changelog_proto protoreflect.FileDescriptor
+
+var file_store_changelog_proto_rawDesc = []byte{
+ 0x0a, 0x15, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f,
+ 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x23, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x69,
+ 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x68,
+ 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x84, 0x01, 0x0a,
+ 0x10, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61,
+ 0x64, 0x12, 0x31, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65,
+ 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x04,
+ 0x74, 0x61, 0x73, 0x6b, 0x12, 0x3d, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f,
+ 0x67, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73,
+ 0x69, 0x6f, 0x6e, 0x22, 0x9d, 0x03, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f,
+ 0x67, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x72, 0x75,
+ 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x75, 0x6e,
+ 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x73, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x05, 0x69, 0x73, 0x73, 0x75, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69,
+ 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69,
+ 0x6f, 0x6e, 0x12, 0x4d, 0x0a, 0x11, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x5f, 0x72, 0x65,
+ 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43,
+ 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52,
+ 0x10, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
+ 0x73, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28,
+ 0x0e, 0x32, 0x24, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,
+ 0x72, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x54, 0x61, 0x73, 0x6b,
+ 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12,
+ 0x2f, 0x0a, 0x14, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x68, 0x69, 0x73,
+ 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x70,
+ 0x72, 0x65, 0x76, 0x53, 0x79, 0x6e, 0x63, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64,
+ 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79,
+ 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x48,
+ 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x65, 0x65,
+ 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x22, 0x43,
+ 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54,
+ 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
+ 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x08, 0x0a,
+ 0x04, 0x44, 0x4f, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45,
+ 0x44, 0x10, 0x03, 0x22, 0xa5, 0x01, 0x0a, 0x11, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f,
+ 0x67, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76,
+ 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x76,
+ 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x42, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65,
+ 0x6c, 0x6f, 0x67, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x70, 0x52, 0x09,
+ 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x30, 0x0a, 0x02, 0x4f, 0x70, 0x12,
+ 0x12, 0x0a, 0x0e, 0x4f, 0x50, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,
+ 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12,
+ 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, 0x42, 0x14, 0x5a, 0x12, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72,
+ 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_store_changelog_proto_rawDescOnce sync.Once
+ file_store_changelog_proto_rawDescData = file_store_changelog_proto_rawDesc
+)
+
+func file_store_changelog_proto_rawDescGZIP() []byte {
+ file_store_changelog_proto_rawDescOnce.Do(func() {
+ file_store_changelog_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_changelog_proto_rawDescData)
+ })
+ return file_store_changelog_proto_rawDescData
+}
+
+var file_store_changelog_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
+var file_store_changelog_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
+var file_store_changelog_proto_goTypes = []any{
+ (ChangelogTask_Status)(0), // 0: bytebase.store.ChangelogTask.Status
+ (ChangelogRevision_Op)(0), // 1: bytebase.store.ChangelogRevision.Op
+ (*ChangelogPayload)(nil), // 2: bytebase.store.ChangelogPayload
+ (*ChangelogTask)(nil), // 3: bytebase.store.ChangelogTask
+ (*ChangelogRevision)(nil), // 4: bytebase.store.ChangelogRevision
+ (*ChangedResources)(nil), // 5: bytebase.store.ChangedResources
+}
+var file_store_changelog_proto_depIdxs = []int32{
+ 3, // 0: bytebase.store.ChangelogPayload.task:type_name -> bytebase.store.ChangelogTask
+ 4, // 1: bytebase.store.ChangelogPayload.revision:type_name -> bytebase.store.ChangelogRevision
+ 5, // 2: bytebase.store.ChangelogTask.changed_resources:type_name -> bytebase.store.ChangedResources
+ 0, // 3: bytebase.store.ChangelogTask.status:type_name -> bytebase.store.ChangelogTask.Status
+ 1, // 4: bytebase.store.ChangelogRevision.operation:type_name -> bytebase.store.ChangelogRevision.Op
+ 5, // [5:5] is the sub-list for method output_type
+ 5, // [5:5] is the sub-list for method input_type
+ 5, // [5:5] is the sub-list for extension type_name
+ 5, // [5:5] is the sub-list for extension extendee
+ 0, // [0:5] is the sub-list for field type_name
+}
+
+func init() { file_store_changelog_proto_init() }
+func file_store_changelog_proto_init() {
+ if File_store_changelog_proto != nil {
+ return
+ }
+ file_store_instance_change_history_proto_init()
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_store_changelog_proto_rawDesc,
+ NumEnums: 2,
+ NumMessages: 3,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_store_changelog_proto_goTypes,
+ DependencyIndexes: file_store_changelog_proto_depIdxs,
+ EnumInfos: file_store_changelog_proto_enumTypes,
+ MessageInfos: file_store_changelog_proto_msgTypes,
+ }.Build()
+ File_store_changelog_proto = out.File
+ file_store_changelog_proto_rawDesc = nil
+ file_store_changelog_proto_goTypes = nil
+ file_store_changelog_proto_depIdxs = nil
+}
diff --git a/proto/store/changelog.proto b/proto/store/changelog.proto
new file mode 100644
index 0000000000..10ea9d2fb2
--- /dev/null
+++ b/proto/store/changelog.proto
@@ -0,0 +1,49 @@
+syntax = "proto3";
+
+package bytebase.store;
+
+import "store/instance_change_history.proto";
+
+option go_package = "generated-go/store";
+
+message ChangelogPayload {
+ ChangelogTask task = 1;
+ ChangelogRevision revision = 2;
+}
+
+message ChangelogTask {
+ string task_run = 1;
+ string issue = 2;
+
+ // optional
+ int64 revision = 3;
+
+ ChangedResources changed_resources = 4;
+
+ enum Status {
+ STATUS_UNSPECIFIED = 0;
+ PENDING = 1;
+ DONE = 2;
+ FAILED = 3;
+ }
+
+ Status status = 5;
+
+ int64 prev_sync_history_id = 6;
+ int64 sync_history_id = 7;
+
+ // The sheet that holds the content.
+ // Format: projects/{project}/sheets/{sheet}
+ string sheet = 8;
+}
+
+message ChangelogRevision {
+ enum Op {
+ OP_UNSPECIFIED = 0;
+ CREATE = 1;
+ DELETE = 2;
+ }
+ // Marshalled revision for display
+ string revision = 1;
+ Op operation = 2;
+}