Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix(sql-editor): allow store the blank statement (#518)
Yunwei Xiao241d13470ce5
diff --git a/server/sheet.go b/server/sheet.goindex 376bb24e6d..44b9a5699e 100644--- a/server/sheet.go+++ b/server/sheet.go@@ -23,9 +23,6 @@ func (s *Server) registerSheetRoutes(g *echo.Group) {if sheetCreate.Name == "" {return echo.NewHTTPError(http.StatusBadRequest, "Malformatted sheet request, missing name")}- if sheetCreate.Statement == "" {- return echo.NewHTTPError(http.StatusBadRequest, "Malformatted sheet request, missing statement")- }sheetCreate.CreatorID = c.Get(getPrincipalIDContextKey()).(int)diff --git a/store/sheet.go b/store/sheet.goindex 7ccb5dd635..bc98793fe9 100644--- a/store/sheet.go+++ b/store/sheet.go@@ -172,6 +172,11 @@ func createSheet(ctx context.Context, tx *Tx, create *api.SheetCreate) (*api.Shereturn nil, FormatError(err)}+ if databaseID.Valid {+ value := int(databaseID.Int32)+ sheet.DatabaseID = &value+ }+return &sheet, nil}@@ -222,6 +227,11 @@ func patchSheet(ctx context.Context, tx *Tx, patch *api.SheetPatch) (*api.Sheet,return nil, FormatError(err)}+ if databaseID.Valid {+ value := int(databaseID.Int32)+ sheet.DatabaseID = &value+ }+return &sheet, nil}@@ -299,6 +309,11 @@ func findSheetList(ctx context.Context, tx *Tx, find *api.SheetFind) (_ []*api.Sreturn nil, FormatError(err)}+ if databaseID.Valid {+ value := int(databaseID.Int32)+ sheet.DatabaseID = &value+ }+list = append(list, &sheet)}if err := rows.Err(); err != nil {