Skip to content

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

feat: use sheet_blob and remove sheet.database (#14399)

p0nyfc9e8e4f3bee
diff --git a/backend/api/v1/database_service_revision.go b/backend/api/v1/database_service_revision.go
index beda905885..11042990c1 100644
--- a/backend/api/v1/database_service_revision.go
+++ b/backend/api/v1/database_service_revision.go
@@ -287,7 +287,7 @@ func convertRevision(revision *v1pb.Revision, database *store.DatabaseMessage, s
File: revision.File,
Version: revision.Version,
Sheet: revision.Sheet,
- SheetSha256: sheet.Sha256,
+ SheetSha256: sheet.GetSha256Hex(),
TaskRun: revision.TaskRun,
},
}
diff --git a/backend/api/v1/release_service.go b/backend/api/v1/release_service.go
index d3a5252d17..f668a643e4 100644
--- a/backend/api/v1/release_service.go
+++ b/backend/api/v1/release_service.go
@@ -344,7 +344,7 @@ func convertReleaseFiles(ctx context.Context, s *store.Store, files []*v1pb.Rele
Id: f.Id,
Path: f.Path,
Sheet: f.Sheet,
- SheetSha256: sheet.Sha256,
+ SheetSha256: sheet.GetSha256Hex(),
Type: storepb.ReleaseFileType(f.Type),
Version: f.Version,
})
diff --git a/backend/api/v1/rollout_service_task.go b/backend/api/v1/rollout_service_task.go
index 3db04db8f5..17369620fb 100644
--- a/backend/api/v1/rollout_service_task.go
+++ b/backend/api/v1/rollout_service_task.go
@@ -208,7 +208,6 @@ func getTaskCreatesFromCreateDatabaseConfig(ctx context.Context, s *store.Store,
ProjectUID: project.UID,
Title: fmt.Sprintf("Sheet for creating database %v", databaseName),
Statement: statement,
-
Payload: &storepb.SheetPayload{
Engine: instance.Engine,
},
diff --git a/backend/api/v1/sheet_service.go b/backend/api/v1/sheet_service.go
index 1e78b01f19..37534fdfaf 100644
--- a/backend/api/v1/sheet_service.go
+++ b/backend/api/v1/sheet_service.go
@@ -66,38 +66,7 @@ func (s *SheetService) CreateSheet(ctx context.Context, request *v1pb.CreateShee
return nil, status.Errorf(codes.NotFound, "project with resource id %q had deleted", projectResourceID)
}
- var databaseUID *int
- if request.Sheet.Database != "" {
- instanceResourceID, databaseName, err := common.GetInstanceDatabaseID(request.Sheet.Database)
- if err != nil {
- return nil, status.Error(codes.InvalidArgument, err.Error())
- }
- instance, err := s.store.GetInstanceV2(ctx, &store.FindInstanceMessage{
- ResourceID: &instanceResourceID,
- })
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to get instance with resource id %q, err: %v", instanceResourceID, err)
- }
- if instance == nil {
- return nil, status.Errorf(codes.NotFound, "instance with resource id %q not found", instanceResourceID)
- }
-
- find := &store.FindDatabaseMessage{
- ProjectID: &projectResourceID,
- InstanceID: &instanceResourceID,
- DatabaseName: &databaseName,
- IgnoreCaseSensitive: store.IgnoreDatabaseAndTableCaseSensitive(instance),
- }
- database, err := s.store.GetDatabaseV2(ctx, find)
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to get database with name %q, err: %s", databaseName, err)
- }
- if database == nil {
- return nil, status.Errorf(codes.NotFound, "database with name %q not found in project %q instance %q", databaseName, projectResourceID, instanceResourceID)
- }
- databaseUID = &database.UID
- }
- storeSheetCreate, err := convertToStoreSheetMessage(ctx, project.UID, databaseUID, principalID, request.Sheet)
+ storeSheetCreate, err := convertToStoreSheetMessage(ctx, project.UID, principalID, request.Sheet)
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, "failed to convert sheet: %v", err)
}
@@ -144,38 +113,7 @@ func (s *SheetService) BatchCreateSheet(ctx context.Context, request *v1pb.Batch
return nil, status.Errorf(codes.InvalidArgument, "Sheet Parent %q does not match BatchCreateSheetRequest.Parent %q", r.Parent, request.Parent)
}
- var databaseUID *int
- if r.Sheet.Database != "" {
- instanceResourceID, databaseName, err := common.GetInstanceDatabaseID(r.Sheet.Database)
- if err != nil {
- return nil, status.Error(codes.InvalidArgument, err.Error())
- }
- instance, err := s.store.GetInstanceV2(ctx, &store.FindInstanceMessage{
- ResourceID: &instanceResourceID,
- })
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to get instance with resource id %q, err: %v", instanceResourceID, err)
- }
- if instance == nil {
- return nil, status.Errorf(codes.NotFound, "instance with resource id %q not found", instanceResourceID)
- }
-
- find := &store.FindDatabaseMessage{
- ProjectID: &projectResourceID,
- InstanceID: &instanceResourceID,
- DatabaseName: &databaseName,
- IgnoreCaseSensitive: store.IgnoreDatabaseAndTableCaseSensitive(instance),
- }
- database, err := s.store.GetDatabaseV2(ctx, find)
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to get database with name %q, err: %s", databaseName, err)
- }
- if database == nil {
- return nil, status.Errorf(codes.NotFound, "database with name %q not found in project %q instance %q", databaseName, projectResourceID, instanceResourceID)
- }
- databaseUID = &database.UID
- }
- storeSheetCreate, err := convertToStoreSheetMessage(ctx, project.UID, databaseUID, user.ID, r.Sheet)
+ storeSheetCreate, err := convertToStoreSheetMessage(ctx, project.UID, user.ID, r.Sheet)
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, "failed to convert sheet: %v", err)
}
@@ -324,20 +262,6 @@ func (s *SheetService) findSheet(ctx context.Context, find *store.FindSheetMessa
}
func (s *SheetService) convertToAPISheetMessage(ctx context.Context, sheet *store.SheetMessage) (*v1pb.Sheet, error) {
- databaseParent := ""
- if sheet.DatabaseUID != nil {
- database, err := s.store.GetDatabaseV2(ctx, &store.FindDatabaseMessage{
- UID: sheet.DatabaseUID,
- })
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to get database: %v", err)
- }
- if database == nil {
- return nil, status.Errorf(codes.NotFound, "database with id %d not found", *sheet.DatabaseUID)
- }
- databaseParent = fmt.Sprintf("%s%s/%s%s", common.InstanceNamePrefix, database.InstanceID, common.DatabaseIDPrefix, database.DatabaseName)
- }
-
creator, err := s.store.GetUserByID(ctx, sheet.CreatorID)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get creator: %v", err)
@@ -369,7 +293,6 @@ func (s *SheetService) convertToAPISheetMessage(ctx context.Context, sheet *stor
return &v1pb.Sheet{
Name: fmt.Sprintf("%s%s/%s%d", common.ProjectNamePrefix, project.ResourceID, common.SheetIDPrefix, sheet.UID),
- Database: databaseParent,
Title: sheet.Title,
Creator: fmt.Sprintf("users/%s", creator.Email),
CreateTime: timestamppb.New(sheet.CreatedTime),
@@ -381,14 +304,13 @@ func (s *SheetService) convertToAPISheetMessage(ctx context.Context, sheet *stor
}, nil
}
-func convertToStoreSheetMessage(ctx context.Context, projectUID int, databaseUID *int, creatorID int, sheet *v1pb.Sheet) (*store.SheetMessage, error) {
+func convertToStoreSheetMessage(ctx context.Context, projectUID int, creatorID int, sheet *v1pb.Sheet) (*store.SheetMessage, error) {
sheetMessage := &store.SheetMessage{
- ProjectUID: projectUID,
- DatabaseUID: databaseUID,
- CreatorID: creatorID,
- Title: sheet.Title,
- Statement: string(sheet.Content),
- Payload: &storepb.SheetPayload{},
+ ProjectUID: projectUID,
+ CreatorID: creatorID,
+ Title: sheet.Title,
+ Statement: string(sheet.Content),
+ Payload: &storepb.SheetPayload{},
}
sheetMessage.Payload.Engine = convertEngine(sheet.Engine)
if sheet.Payload != nil {
diff --git a/backend/migrator/migration/prod/3.1/0000##sheet_blob.sql b/backend/migrator/migration/prod/3.1/0000##sheet_blob.sql
new file mode 100644
index 0000000000..ca859dc9b0
--- /dev/null
+++ b/backend/migrator/migration/prod/3.1/0000##sheet_blob.sql
@@ -0,0 +1,23 @@
+ALTER TABLE sheet ADD COLUMN IF NOT EXISTS sha256 BYTEA;
+
+UPDATE sheet
+SET sha256 = sha256(convert_to(sheet.statement, 'utf8'));
+
+ALTER TABLE sheet ALTER COLUMN sha256 SET NOT NULL;
+
+CREATE TABLE IF NOT EXISTS sheet_blob (
+ sha256 BYTEA NOT NULL PRIMARY KEY,
+ content TEXT NOT NULL
+);
+
+INSERT INTO sheet_blob (
+ sha256,
+ content
+) SELECT
+ sheet.sha256,
+ sheet.statement
+FROM sheet
+ON CONFLICT DO NOTHING;
+
+ALTER TABLE sheet DROP COLUMN IF EXISTS statement;
+ALTER TABLE sheet DROP COLUMN IF EXISTS database_id;
diff --git a/backend/migrator/migration/prod/LATEST.sql b/backend/migrator/migration/prod/LATEST.sql
index e8ccd2e92e..105ebfcbd5 100644
--- a/backend/migrator/migration/prod/LATEST.sql
+++ b/backend/migrator/migration/prod/LATEST.sql
@@ -336,6 +336,11 @@ CREATE UNIQUE INDEX idx_data_source_unique_instance_id_name ON data_source(insta
ALTER SEQUENCE data_source_id_seq RESTART WITH 101;
+CREATE TABLE sheet_blob (
+ sha256 BYTEA NOT NULL PRIMARY KEY,
+ content TEXT NOT NULL
+);
+
-- sheet table stores general statements.
CREATE TABLE sheet (
id SERIAL PRIMARY KEY,
@@ -345,9 +350,8 @@ CREATE TABLE sheet (
updater_id INTEGER NOT NULL REFERENCES principal (id),
updated_ts BIGINT NOT NULL DEFAULT extract(epoch from now()),
project_id INTEGER NOT NULL REFERENCES project (id),
- database_id INTEGER NULL REFERENCES db (id),
name TEXT NOT NULL,
- statement TEXT NOT NULL,
+ sha256 BYTEA NOT NULL,
payload JSONB NOT NULL DEFAULT '{}'
);
@@ -359,8 +363,6 @@ CREATE INDEX idx_sheet_name ON sheet(name);
CREATE INDEX idx_sheet_project_id_row_status ON sheet(project_id, row_status);
-CREATE INDEX idx_sheet_database_id_row_status ON sheet(database_id, row_status);
-
ALTER SEQUENCE sheet_id_seq RESTART WITH 101;
-----------------------
diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.go
index 781d5229c5..882f5fe39d 100644
--- a/backend/migrator/migrator_test.go
+++ b/backend/migrator/migrator_test.go
@@ -231,5 +231,5 @@ func TestMigrationCompatibility(t *testing.T) {
func TestGetCutoffVersion(t *testing.T) {
releaseVersion, err := getProdCutoffVersion()
require.NoError(t, err)
- require.Equal(t, semver.MustParse("3.0.1"), releaseVersion)
+ require.Equal(t, semver.MustParse("3.1.0"), releaseVersion)
}
diff --git a/backend/runner/taskrun/executor.go b/backend/runner/taskrun/executor.go
index c88e3090c7..11b7283b11 100644
--- a/backend/runner/taskrun/executor.go
+++ b/backend/runner/taskrun/executor.go
@@ -631,7 +631,7 @@ func endMigration(ctx context.Context, storeInstance *store.Store, startedNs int
}
if mc.sheet != nil {
r.Payload.Sheet = mc.sheetName
- r.Payload.SheetSha256 = mc.sheet.Sha256
+ r.Payload.SheetSha256 = mc.sheet.GetSha256Hex()
}
revision, err := storeInstance.CreateRevision(ctx, r, mc.task.CreatorID)
diff --git a/backend/server/onboard.go b/backend/server/onboard.go
index 69055f28ff..8d8939ded7 100644
--- a/backend/server/onboard.go
+++ b/backend/server/onboard.go
@@ -209,8 +209,7 @@ func (s *Server) generateOnboardingData(ctx context.Context, user *store.UserMes
testSheet, err := s.sheetManager.CreateSheet(ctx, &store.SheetMessage{
CreatorID: api.SystemBotID,
- ProjectUID: project.UID,
- DatabaseUID: &testDatabase.UID,
+ ProjectUID: project.UID,
Title: "Alter table to test sample instance for sample issue",
Statement: "ALTER TABLE employee ADD COLUMN IF NOT EXISTS email TEXT DEFAULT '';",
@@ -226,8 +225,7 @@ func (s *Server) generateOnboardingData(ctx context.Context, user *store.UserMes
prodSheet, err := s.sheetManager.CreateSheet(ctx, &store.SheetMessage{
CreatorID: api.SystemBotID,
- ProjectUID: project.UID,
- DatabaseUID: &prodDatabase.UID,
+ ProjectUID: project.UID,
Title: "Alter table to prod sample instance for sample issue",
Statement: "ALTER TABLE employee ADD COLUMN IF NOT EXISTS email TEXT DEFAULT '';",
diff --git a/backend/store/instance_change_history.go b/backend/store/instance_change_history.go
index 5a80bc150b..7096f8c218 100644
--- a/backend/store/instance_change_history.go
+++ b/backend/store/instance_change_history.go
@@ -501,7 +501,7 @@ func (s *Store) ListInstanceChangeHistory(ctx context.Context, find *FindInstanc
where = append(where, fmt.Sprintf("instance_change_history.type IN (%s)", strings.Join(changeTypes, ",")))
}
- statementField := "COALESCE(sheet.statement, instance_change_history.statement)"
+ statementField := "COALESCE(sheet_blob.content, instance_change_history.statement)"
if !find.ShowFull {
statementField = fmt.Sprintf("LEFT(%s, %d)", statementField, find.TruncateSize)
}
@@ -533,7 +533,7 @@ func (s *Store) ListInstanceChangeHistory(ctx context.Context, find *FindInstanc
instance_change_history.version,
instance_change_history.description,
%s,
- OCTET_LENGTH(COALESCE(sheet.statement, instance_change_history.statement)),
+ OCTET_LENGTH(COALESCE(sheet_blob.content, instance_change_history.statement)),
%s,
OCTET_LENGTH(instance_change_history.schema),
%s,
@@ -545,6 +545,7 @@ func (s *Store) ListInstanceChangeHistory(ctx context.Context, find *FindInstanc
COALESCE(db.name, '')
FROM instance_change_history
LEFT JOIN sheet ON sheet.id = instance_change_history.sheet_id
+ LEFT JOIN sheet_blob ON sheet.sha256 = sheet_blob.sha256
LEFT JOIN instance on instance.id = instance_change_history.instance_id
LEFT JOIN db on db.id = instance_change_history.database_id
WHERE `+strings.Join(where, " AND ")+` ORDER BY instance_change_history.instance_id, instance_change_history.database_id, instance_change_history.sequence DESC`,
diff --git a/backend/store/sheet.go b/backend/store/sheet.go
index 9b13e94ba5..0c14ce07d3 100644
--- a/backend/store/sheet.go
+++ b/backend/store/sheet.go
@@ -2,7 +2,9 @@ package store
import (
"context"
+ "crypto/sha256"
"database/sql"
+ "encoding/hex"
"fmt"
"strings"
"time"
@@ -17,10 +19,6 @@ import (
// SheetMessage is the message for a sheet.
type SheetMessage struct {
ProjectUID int
- // The DatabaseUID is optional.
- // If not NULL, the sheet ProjectID should always be equal to the id of the database related project.
- // A project must remove all linked sheets for a particular database before that database can be transferred to a different project.
- DatabaseUID *int
CreatorID int
UpdaterID int
@@ -29,10 +27,8 @@ type SheetMessage struct {
Statement string
Payload *storepb.SheetPayload
- // Sha256 is the Sha256 hash of the statement in hexadecimal format.
- // This field is available in dev.
- // TODO(p0ny): move to prod and backfill.
- Sha256 string
+ // Sha256 is the Sha256 hash of the statement.
+ Sha256 []byte
// Output only fields
UID int
@@ -45,6 +41,10 @@ type SheetMessage struct {
updatedTs int64
}
+func (s *SheetMessage) GetSha256Hex() string {
+ return hex.EncodeToString(s.Sha256)
+}
+
// FindSheetMessage is the API message for finding sheets.
type FindSheetMessage struct {
UID *int
@@ -133,14 +133,9 @@ func (s *Store) listSheets(ctx context.Context, find *FindSheetMessage) ([]*Shee
}
// Domain fields
- statementField := fmt.Sprintf("LEFT(sheet.statement, %d)", common.MaxSheetSize)
+ statementField := fmt.Sprintf("LEFT(sheet_blob.content, %d)", common.MaxSheetSize)
if find.LoadFull {
- statementField = "sheet.statement"
- }
-
- sha256Field := "''"
- if common.IsDev() {
- sha256Field = "encode(sha256(convert_to(sheet.statement, 'UTF8')), 'hex')"
+ statementField = "sheet_blob.content"
}
tx, err := s.db.BeginTx(ctx, &sql.TxOptions{ReadOnly: true})
@@ -157,14 +152,14 @@ func (s *Store) listSheets(ctx context.Context, find *FindSheetMessage) ([]*Shee
sheet.updater_id,
sheet.updated_ts,
sheet.project_id,
- sheet.database_id,
sheet.name,
%s,
- %s,
+ sheet.sha256,
sheet.payload,
- OCTET_LENGTH(sheet.statement)
+ OCTET_LENGTH(sheet_blob.content)
FROM sheet
- WHERE %s`, statementField, sha256Field, strings.Join(where, " AND ")),
+ LEFT JOIN sheet_blob ON sheet.sha256 = sheet_blob.sha256
+ WHERE %s`, statementField, strings.Join(where, " AND ")),
args...,
)
if err != nil {
@@ -183,7 +178,6 @@ func (s *Store) listSheets(ctx context.Context, find *FindSheetMessage) ([]*Shee
&sheet.UpdaterID,
&sheet.updatedTs,
&sheet.ProjectUID,
- &sheet.DatabaseUID,
&sheet.Title,
&sheet.Statement,
&sheet.Sha256,
@@ -227,18 +221,24 @@ func (s *Store) CreateSheet(ctx context.Context, create *SheetMessage) (*SheetMe
return nil, err
}
+ h := sha256.Sum256([]byte(create.Statement))
+ create.Sha256 = h[:]
+
+ if err := s.BatchCreateSheetBlob(ctx, [][]byte{create.Sha256}, []string{create.Statement}); err != nil {
+ return nil, errors.Wrapf(err, "failed to create sheet blobs")
+ }
+
query := `
INSERT INTO sheet (
creator_id,
updater_id,
project_id,
- database_id,
name,
- statement,
+ sha256,
payload
)
- VALUES ($1, $2, $3, $4, $5, $6, $7)
- RETURNING id, created_ts, updated_ts, OCTET_LENGTH(statement), encode(sha256(convert_to(sheet.statement, 'UTF8')), 'hex')
+ VALUES ($1, $2, $3, $4, $5, $6)
+ RETURNING id, created_ts, updated_ts
`
tx, err := s.db.BeginTx(ctx, nil)
@@ -251,16 +251,13 @@ func (s *Store) CreateSheet(ctx context.Context, create *SheetMessage) (*SheetMe
create.CreatorID,
create.CreatorID,
create.ProjectUID,
- create.DatabaseUID,
create.Title,
- create.Statement,
+ create.Sha256,
payload,
).Scan(
&create.UID,
&create.createdTs,
&create.updatedTs,
- &create.Size,
- &create.Sha256,
); err != nil {
if err == sql.ErrNoRows {
return nil, common.FormatDBErrorEmptyRowWithQuery(query)
@@ -271,6 +268,7 @@ func (s *Store) CreateSheet(ctx context.Context, create *SheetMessage) (*SheetMe
return nil, errors.Wrapf(err, "failed to commit transaction")
}
+ create.Size = int64(len(create.Statement))
create.CreatedTime = time.Unix(create.createdTs, 0)
create.UpdatedTime = time.Unix(create.updatedTs, 0)
@@ -281,15 +279,17 @@ func (s *Store) CreateSheet(ctx context.Context, create *SheetMessage) (*SheetMe
// You should not use this function directly to create sheets.
// Use BatchCreateSheet in component/sheet instead.
func (s *Store) BatchCreateSheet(ctx context.Context, projectUID int, creates []*SheetMessage, creatorUID int) ([]*SheetMessage, error) {
- var databaseIDs []*int
var names []string
var statements []string
+ var sha256s [][]byte
var payloads [][]byte
for _, c := range creates {
- databaseIDs = append(databaseIDs, c.DatabaseUID)
names = append(names, c.Title)
statements = append(statements, c.Statement)
+ h := sha256.Sum256([]byte(c.Statement))
+ c.Sha256 = h[:]
+ sha256s = append(sha256s, c.Sha256)
if c.Payload == nil {
c.Payload = &storepb.SheetPayload{}
}
@@ -300,24 +300,26 @@ func (s *Store) BatchCreateSheet(ctx context.Context, projectUID int, creates []
payloads = append(payloads, payload)
}
+ if err := s.BatchCreateSheetBlob(ctx, sha256s, statements); err != nil {
+ return nil, errors.Wrapf(err, "failed to create sheet blobs")
+ }
+
query := `
INSERT INTO sheet (
creator_id,
updater_id,
project_id,
- database_id,
name,
- statement,
+ sha256,
payload
) SELECT
$1,
$2,
$3,
- unnest(CAST($4 AS INTEGER[])),
- unnest(CAST($5 AS TEXT[])),
- unnest(CAST($6 AS TEXT[])),
- unnest(CAST($7 AS JSONB[]))
- RETURNING id, created_ts, updated_ts, OCTET_LENGTH(statement), encode(sha256(convert_to(sheet.statement, 'UTF8')), 'hex')
+ unnest(CAST($4 AS TEXT[])),
+ unnest(CAST($5 AS BYTEA[])),
+ unnest(CAST($6 AS JSONB[]))
+ RETURNING id, created_ts, updated_ts
`
tx, err := s.db.BeginTx(ctx, nil)
@@ -326,7 +328,7 @@ func (s *Store) BatchCreateSheet(ctx context.Context, projectUID int, creates []
}
defer tx.Rollback()
- rows, err := tx.QueryContext(ctx, query, creatorUID, creatorUID, projectUID, databaseIDs, names, statements, payloads)
+ rows, err := tx.QueryContext(ctx, query, creatorUID, creatorUID, projectUID, names, sha256s, payloads)
if err != nil {
return nil, errors.Wrapf(err, "failed to query")
}
@@ -340,12 +342,11 @@ func (s *Store) BatchCreateSheet(ctx context.Context, projectUID int, creates []
&creates[i].UID,
&creates[i].createdTs,
&creates[i].updatedTs,
- &creates[i].Size,
- &creates[i].Sha256,
); err != nil {
return nil, errors.Wrapf(err, "failed to scan")
}
+ creates[i].Size = int64(len(creates[i].Statement))
creates[i].CreatedTime = time.Unix(creates[i].createdTs, 0)
creates[i].UpdatedTime = time.Unix(creates[i].updatedTs, 0)
}
@@ -361,79 +362,61 @@ func (s *Store) BatchCreateSheet(ctx context.Context, projectUID int, creates []
return creates, nil
}
-// PatchSheet updates a sheet.
-func (s *Store) PatchSheet(ctx context.Context, patch *PatchSheetMessage) (*SheetMessage, error) {
- tx, err := s.db.BeginTx(ctx, nil)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to begin transaction")
- }
-
- sheet, err := patchSheetImpl(ctx, tx, patch)
- if err != nil {
- return nil, err
- }
+func (s *Store) BatchCreateSheetBlob(ctx context.Context, sha256s [][]byte, contents []string) error {
+ query := `
+ INSERT INTO sheet_blob (
+ sha256,
+ content
+ ) SELECT
+ unnest(CAST($1 AS BYTEA[])),
+ unnest(CAST($2 AS TEXT[]))
+ ON CONFLICT DO NOTHING
+ `
- if err := tx.Commit(); err != nil {
- return nil, errors.Wrapf(err, "failed to commit transaction")
- }
- if v := patch.Statement; v != nil {
- s.sheetStatementCache.Add(patch.UID, *v)
+ if _, err := s.db.db.ExecContext(ctx, query, sha256s, contents); err != nil {
+ return errors.Wrapf(err, "failed to exec")
}
- s.sheetCache.Remove(patch.UID)
- return sheet, nil
+ return nil
}
-// patchSheetImpl updates a sheet's name/statement/payload/database_id/project_id.
-func patchSheetImpl(ctx context.Context, tx *Tx, patch *PatchSheetMessage) (*SheetMessage, error) {
- set, args := []string{"updater_id = $1", "updated_ts = $2"}, []any{patch.UpdaterID, time.Now().Unix()}
- if v := patch.Statement; v != nil {
- set, args = append(set, fmt.Sprintf("statement = $%d", len(args)+1)), append(args, *v)
+// PatchSheet updates a sheet.
+func (s *Store) PatchSheet(ctx context.Context, patch *PatchSheetMessage) (*SheetMessage, error) {
+ if patch.Statement == nil {
+ return s.GetSheet(ctx, &FindSheetMessage{UID: &patch.UID})
}
- args = append(args, patch.UID)
+ h := sha256.Sum256([]byte(*patch.Statement))
- var sheet SheetMessage
- var payload []byte
- databaseID := sql.NullInt32{}
+ if err := s.BatchCreateSheetBlob(ctx, [][]byte{h[:]}, []string{*patch.Statement}); err != nil {
+ return nil, errors.Wrapf(err, "failed to create sheet blobs")
+ }
- if err := tx.QueryRowContext(ctx, fmt.Sprintf(`
+ var uid int
+ if err := s.db.db.QueryRowContext(ctx, `
UPDATE sheet
- SET `+strings.Join(set, ", ")+`
- WHERE id = $%d
- RETURNING id, creator_id, created_ts, updater_id, updated_ts, project_id, database_id, name, LEFT(statement, %d), payload, OCTET_LENGTH(statement)
- `, len(args), common.MaxSheetSize),
- args...,
+ SET
+ updater_id = $1,
+ updated_ts = $2,
+ sha256 = $3
+ WHERE id = $4
+ RETURNING id
+ `,
+ patch.UpdaterID,
+ time.Now().Unix(),
+ h[:],
+ patch.UID,
).Scan(
- &sheet.UID,
- &sheet.CreatorID,
- &sheet.createdTs,
- &sheet.UpdaterID,
- &sheet.updatedTs,
- &sheet.ProjectUID,
- &databaseID,
- &sheet.Title,
- &sheet.Statement,
- &payload,
- &sheet.Size,
+ &uid,
); err != nil {
if err == sql.ErrNoRows {
return nil, &common.Error{Code: common.NotFound, Err: errors.Errorf("sheet ID not found: %d", patch.UID)}
}
- return nil, err
+ return nil, errors.Wrapf(err, "failed to update sheet")
}
- sheetPayload := &storepb.SheetPayload{}
- if err := common.ProtojsonUnmarshaler.Unmarshal(payload, sheetPayload); err != nil {
- return nil, err
- }
- sheet.Payload = sheetPayload
- if databaseID.Valid {
- value := int(databaseID.Int32)
- sheet.DatabaseUID = &value
- }
- sheet.CreatedTime = time.Unix(sheet.createdTs, 0)
- sheet.UpdatedTime = time.Unix(sheet.updatedTs, 0)
+ s.sheetStatementCache.Add(patch.UID, *patch.Statement)
+ s.sheetCache.Remove(patch.UID)
- return &sheet, nil
+ return s.GetSheet(ctx, &FindSheetMessage{UID: &patch.UID})
}
diff --git a/frontend/src/components/Branch/BranchRolloutView/BranchRolloutView.vue b/frontend/src/components/Branch/BranchRolloutView/BranchRolloutView.vue
index ed70df8e66..7003abd15c 100644
--- a/frontend/src/components/Branch/BranchRolloutView/BranchRolloutView.vue
+++ b/frontend/src/components/Branch/BranchRolloutView/BranchRolloutView.vue
@@ -350,7 +350,6 @@ const handlePreviewIssue = async () => {
}
}
const sheet = Sheet.fromPartial({
- database: db.name,
engine: db.instanceResource.engine,
payload: {
type: SheetPayload_Type.SCHEMA_DESIGN,
diff --git a/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue b/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue
index eeef132a8e..3787ccce94 100644
--- a/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue
+++ b/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue
@@ -61,7 +61,6 @@ import type { Plan_ExportDataConfig } from "@/types/proto/v1/plan_service";
import { type Plan_ChangeDatabaseConfig } from "@/types/proto/v1/plan_service";
import type { Sheet } from "@/types/proto/v1/sheet_service";
import {
- extractDatabaseGroupName,
extractIssueUID,
extractProjectResourceName,
extractSheetUID,
@@ -203,7 +202,6 @@ const createSheets = async () => {
if (uid.startsWith("-")) {
// The sheet is pending create
const sheet = getLocalSheetByName(config.sheet);
- sheet.database = config.target;
const engine = await databaseEngineForSpec(
issue.value.projectEntity,
spec
@@ -211,18 +209,13 @@ const createSheets = async () => {
sheet.engine = engine;
pendingCreateSheetMap.set(sheet.name, sheet);
- await maybeFormatSQL(sheet, sheet.database);
+ await maybeFormatSQL(sheet, config.target);
}
}
const pendingCreateSheetList = Array.from(pendingCreateSheetMap.values());
const sheetNameMap = new Map<string, string>();
for (let i = 0; i < pendingCreateSheetList.length; i++) {
const sheet = pendingCreateSheetList[i];
- if (extractDatabaseGroupName(sheet.database)) {
- // If a sheet's target is a db group, it should be unset
- // since it actually doesn't belongs to any exact database.
- sheet.database = "";
- }
sheet.title = issue.value.title;
const createdSheet = await sheetStore.createSheet(
issue.value.project,
diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateButton.vue b/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateButton.vue
index 762c4b24f6..afaa46125d 100644
--- a/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateButton.vue
+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateButton.vue
@@ -140,7 +140,6 @@ const createSheets = async () => {
if (uid.startsWith("-")) {
// The sheet is pending create
const sheet = getLocalSheetByName(config.sheet);
- sheet.database = config.target;
const engine = await databaseEngineForSpec(
plan.value.projectEntity,
spec
@@ -148,7 +147,7 @@ const createSheets = async () => {
sheet.engine = engine;
pendingCreateSheetMap.set(sheet.name, sheet);
- await maybeFormatSQL(sheet, sheet.database);
+ await maybeFormatSQL(sheet, config.target);
}
}
const pendingCreateSheetList = Array.from(pendingCreateSheetMap.values());
diff --git a/frontend/src/types/proto/v1/sheet_service.ts b/frontend/src/types/proto/v1/sheet_service.ts
index 42246c02c3..53696bf821 100644
--- a/frontend/src/types/proto/v1/sheet_service.ts
+++ b/frontend/src/types/proto/v1/sheet_service.ts
@@ -75,12 +75,6 @@ export interface Sheet {
* Format: projects/{project}/sheets/{sheet}
*/
name: string;
- /**
- * The database resource name.
- * Format: instances/{instance}/databases/{database}
- * If the database parent doesn't exist, the database field is empty.
- */
- database: string;
/** The title of the sheet. */
title: string;
/**
@@ -534,7 +528,6 @@ export const UpdateSheetRequest: MessageFns<UpdateSheetRequest> = {
function createBaseSheet(): Sheet {
return {
name: "",
- database: "",
title: "",
creator: "",
createTime: undefined,
@@ -551,9 +544,6 @@ export const Sheet: MessageFns<Sheet> = {
if (message.name !== "") {
writer.uint32(10).string(message.name);
}
- if (message.database !== "") {
- writer.uint32(18).string(message.database);
- }
if (message.title !== "") {
writer.uint32(26).string(message.title);
}
@@ -595,13 +585,6 @@ export const Sheet: MessageFns<Sheet> = {
message.name = reader.string();
continue;
- case 2:
- if (tag !== 18) {
- break;
- }
-
- message.database = reader.string();
- continue;
case 3:
if (tag !== 26) {
break;
@@ -670,7 +653,6 @@ export const Sheet: MessageFns<Sheet> = {
fromJSON(object: any): Sheet {
return {
name: isSet(object.name) ? globalThis.String(object.name) : "",
- database: isSet(object.database) ? globalThis.String(object.database) : "",
title: isSet(object.title) ? globalThis.String(object.title) : "",
creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
@@ -687,9 +669,6 @@ export const Sheet: MessageFns<Sheet> = {
if (message.name !== "") {
obj.name = message.name;
}
- if (message.database !== "") {
- obj.database = message.database;
- }
if (message.title !== "") {
obj.title = message.title;
}
@@ -723,7 +702,6 @@ export const Sheet: MessageFns<Sheet> = {
fromPartial(object: DeepPartial<Sheet>): Sheet {
const message = createBaseSheet();
message.name = object.name ?? "";
- message.database = object.database ?? "";
message.title = object.title ?? "";
message.creator = object.creator ?? "";
message.createTime = (object.createTime !== undefined && object.createTime !== null)
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index a80e9938d9..ad1561bca2 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -14029,12 +14029,6 @@ components:
The name of the sheet resource, generated by the server.
Canonical parent is project.
Format: projects/{project}/sheets/{sheet}
- database:
- type: string
- description: |-
- The database resource name.
- Format: instances/{instance}/databases/{database}
- If the database parent doesn't exist, the database field is empty.
title:
type: string
description: The title of the sheet.
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index f107376efd..bac310f9e6 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -10700,7 +10700,6 @@ Read from `pg_stat_activity`
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| name | [string](#string) | | The name of the sheet resource, generated by the server. Canonical parent is project. Format: projects/{project}/sheets/{sheet} |
-| database | [string](#string) | | The database resource name. Format: instances/{instance}/databases/{database} If the database parent doesn&#39;t exist, the database field is empty. |
| title | [string](#string) | | The title of the sheet. |
| creator | [string](#string) | | The creator of the Sheet. Format: users/{email} |
| create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | The create time of the sheet. |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 7eb0c6f35b..4699487bad 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -29354,15 +29354,6 @@ Canonical parent is project.
Format: projects/{project}/sheets/{sheet} </p></td>
</tr>
- <tr>
- <td>database</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The database resource name.
-Format: instances/{instance}/databases/{database}
-If the database parent doesn&#39;t exist, the database field is empty. </p></td>
- </tr>
-
<tr>
<td>title</td>
<td><a href="#string">string</a></td>
diff --git a/proto/generated-go/v1/sheet_service.pb.go b/proto/generated-go/v1/sheet_service.pb.go
index 033a5d6ee7..16ecdd17fb 100644
--- a/proto/generated-go/v1/sheet_service.pb.go
+++ b/proto/generated-go/v1/sheet_service.pb.go
@@ -354,10 +354,6 @@ type Sheet struct {
// Canonical parent is project.
// Format: projects/{project}/sheets/{sheet}
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // The database resource name.
- // Format: instances/{instance}/databases/{database}
- // If the database parent doesn't exist, the database field is empty.
- Database string `protobuf:"bytes,2,opt,name=database,proto3" json:"database,omitempty"`
// The title of the sheet.
Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
// The creator of the Sheet.
@@ -415,13 +411,6 @@ func (x *Sheet) GetName() string {
return ""
}
-func (x *Sheet) GetDatabase() string {
- if x != nil {
- return x.Database
- }
- return ""
-}
-
func (x *Sheet) GetTitle() string {
if x != nil {
return x.Title
@@ -659,104 +648,102 @@ var file_v1_sheet_service_proto_rawDesc = []byte{
0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c,
0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73,
- 0x6b, 0x22, 0xed, 0x03, 0x0a, 0x05, 0x53, 0x68, 0x65, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x04, 0x6e,
+ 0x6b, 0x22, 0xd1, 0x03, 0x0a, 0x05, 0x53, 0x68, 0x65, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x05, 0xe2, 0x41, 0x02, 0x02, 0x05,
- 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
- 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
- 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
- 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1e,
- 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42,
- 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x41,
- 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42,
- 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d,
- 0x65, 0x12, 0x41, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65,
- 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
- 0x6d, 0x70, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
- 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18,
- 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x07, 0x63, 0x6f, 0x6e,
- 0x74, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f,
- 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03,
- 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x33, 0x0a,
- 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x65,
- 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f,
- 0x61, 0x64, 0x12, 0x31, 0x0a, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x0e, 0x20, 0x01,
- 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x06, 0x65,
- 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x3a, 0x3a, 0xea, 0x41, 0x37, 0x0a, 0x12, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x68, 0x65, 0x65, 0x74, 0x12, 0x21,
- 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
- 0x74, 0x7d, 0x2f, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x73, 0x68, 0x65, 0x65, 0x74,
- 0x7d, 0x22, 0xc7, 0x02, 0x0a, 0x0c, 0x53, 0x68, 0x65, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f,
- 0x61, 0x64, 0x12, 0x32, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
- 0x32, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53,
- 0x68, 0x65, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x54, 0x79, 0x70, 0x65,
- 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x44, 0x0a, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
- 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x1b, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x61,
- 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0e, 0x64, 0x61,
- 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x55, 0x0a, 0x18,
- 0x62, 0x61, 0x73, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
- 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74,
- 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x16, 0x62, 0x61, 0x73,
- 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e,
- 0x66, 0x69, 0x67, 0x12, 0x35, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18,
- 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64,
- 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x22, 0x2f, 0x0a, 0x04, 0x54, 0x79,
- 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45,
- 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x43, 0x48, 0x45,
- 0x4d, 0x41, 0x5f, 0x44, 0x45, 0x53, 0x49, 0x47, 0x4e, 0x10, 0x01, 0x22, 0x36, 0x0a, 0x0c, 0x53,
- 0x68, 0x65, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73,
- 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72,
- 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03,
- 0x65, 0x6e, 0x64, 0x32, 0x83, 0x05, 0x0a, 0x0c, 0x53, 0x68, 0x65, 0x65, 0x74, 0x53, 0x65, 0x72,
- 0x76, 0x69, 0x63, 0x65, 0x12, 0x98, 0x01, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53,
- 0x68, 0x65, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x22, 0x54, 0xda, 0x41, 0x0c, 0x70, 0x61,
- 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x73, 0x68, 0x65, 0x65, 0x74, 0x8a, 0xea, 0x30, 0x10, 0x62, 0x62,
- 0x2e, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x90, 0xea,
- 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x3a, 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x22,
- 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f,
- 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x12,
- 0xae, 0x01, 0x0a, 0x10, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53,
- 0x68, 0x65, 0x65, 0x74, 0x12, 0x24, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x68,
- 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x62, 0x79, 0x74,
- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72,
- 0x65, 0x61, 0x74, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
- 0x65, 0x22, 0x4d, 0x8a, 0xea, 0x30, 0x10, 0x62, 0x62, 0x2e, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73,
- 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02,
- 0x2f, 0x3a, 0x01, 0x2a, 0x22, 0x2a, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e,
- 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x68,
- 0x65, 0x65, 0x74, 0x73, 0x3a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
- 0x12, 0x80, 0x01, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x53, 0x68, 0x65, 0x65, 0x74, 0x12, 0x1c, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53,
- 0x68, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x22,
- 0x42, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xea, 0x30, 0x0d, 0x62, 0x62, 0x2e, 0x73,
- 0x68, 0x65, 0x65, 0x74, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4,
- 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70,
- 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73,
- 0x2f, 0x2a, 0x7d, 0x12, 0xa3, 0x01, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x68,
- 0x65, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71,
- 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x22, 0x5f, 0xda, 0x41, 0x11, 0x73, 0x68, 0x65,
- 0x65, 0x74, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x8a, 0xea,
- 0x30, 0x10, 0x62, 0x62, 0x2e, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61,
- 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x05, 0x73, 0x68,
- 0x65, 0x65, 0x74, 0x32, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x2e,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f,
- 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e,
- 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x33,
+ 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18,
+ 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x05, 0x74, 0x69, 0x74,
+ 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20,
+ 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74,
+ 0x6f, 0x72, 0x12, 0x41, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d,
+ 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74,
+ 0x61, 0x6d, 0x70, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74,
+ 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f,
+ 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d,
+ 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0a, 0x75, 0x70,
+ 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74,
+ 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52,
+ 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74,
+ 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x42, 0x04,
+ 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x7a,
+ 0x65, 0x12, 0x33, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x0d, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
+ 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x07, 0x70,
+ 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x31, 0x0a, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65,
+ 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x42, 0x04, 0xe2, 0x41, 0x01,
+ 0x02, 0x52, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x3a, 0x3a, 0xea, 0x41, 0x37, 0x0a, 0x12,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x68, 0x65,
+ 0x65, 0x74, 0x12, 0x21, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72,
+ 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x73,
+ 0x68, 0x65, 0x65, 0x74, 0x7d, 0x22, 0xc7, 0x02, 0x0a, 0x0c, 0x53, 0x68, 0x65, 0x65, 0x74, 0x50,
+ 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x32, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e,
+ 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x44, 0x0a, 0x0f, 0x64, 0x61,
+ 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x52, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x12, 0x55, 0x0a, 0x18, 0x62, 0x61, 0x73, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x64, 0x61, 0x74,
+ 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
+ 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52,
+ 0x16, 0x62, 0x61, 0x73, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
+ 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x35, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61,
+ 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x43, 0x6f, 0x6d,
+ 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x22, 0x2f,
+ 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55,
+ 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d,
+ 0x53, 0x43, 0x48, 0x45, 0x4d, 0x41, 0x5f, 0x44, 0x45, 0x53, 0x49, 0x47, 0x4e, 0x10, 0x01, 0x22,
+ 0x36, 0x0a, 0x0c, 0x53, 0x68, 0x65, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12,
+ 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
+ 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01,
+ 0x28, 0x05, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x32, 0x83, 0x05, 0x0a, 0x0c, 0x53, 0x68, 0x65, 0x65,
+ 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x98, 0x01, 0x0a, 0x0b, 0x43, 0x72, 0x65,
+ 0x61, 0x74, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x68, 0x65,
+ 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x22, 0x54, 0xda,
+ 0x41, 0x0c, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x73, 0x68, 0x65, 0x65, 0x74, 0x8a, 0xea,
+ 0x30, 0x10, 0x62, 0x62, 0x2e, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61,
+ 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x3a, 0x05, 0x73, 0x68,
+ 0x65, 0x65, 0x74, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
+ 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x68, 0x65,
+ 0x65, 0x74, 0x73, 0x12, 0xae, 0x01, 0x0a, 0x10, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65,
+ 0x61, 0x74, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x12, 0x24, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72, 0x65, 0x61,
+ 0x74, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x74,
+ 0x63, 0x68, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, 0x8a, 0xea, 0x30, 0x10, 0x62, 0x62, 0x2e, 0x73, 0x68,
+ 0x65, 0x65, 0x74, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82,
+ 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x3a, 0x01, 0x2a, 0x22, 0x2a, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70,
+ 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a,
+ 0x7d, 0x2f, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x3a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x43, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x12, 0x80, 0x01, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x53, 0x68, 0x65, 0x65,
+ 0x74, 0x12, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x47, 0x65, 0x74, 0x53, 0x68, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
+ 0x12, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68,
+ 0x65, 0x65, 0x74, 0x22, 0x42, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xea, 0x30, 0x0d,
+ 0x62, 0x62, 0x2e, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x90, 0xea, 0x30,
+ 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x68,
+ 0x65, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xa3, 0x01, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61,
+ 0x74, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x68, 0x65, 0x65,
+ 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x22, 0x5f, 0xda, 0x41,
+ 0x11, 0x73, 0x68, 0x65, 0x65, 0x74, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61,
+ 0x73, 0x6b, 0x8a, 0xea, 0x30, 0x10, 0x62, 0x62, 0x2e, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x2e,
+ 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d,
+ 0x3a, 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x32, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x73, 0x68,
+ 0x65, 0x65, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
+ 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0x11, 0x5a,
+ 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31,
+ 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
diff --git a/proto/v1/sheet_service.proto b/proto/v1/sheet_service.proto
index ef5fb62ad4..b1973c2b0d 100644
--- a/proto/v1/sheet_service.proto
+++ b/proto/v1/sheet_service.proto
@@ -121,11 +121,6 @@ message Sheet {
(google.api.field_behavior) = IMMUTABLE
];
- // The database resource name.
- // Format: instances/{instance}/databases/{database}
- // If the database parent doesn't exist, the database field is empty.
- string database = 2;
-
// The title of the sheet.
string title = 3 [(google.api.field_behavior) = REQUIRED];