Skip to content

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

chore: single pg (#12563)

p0nyacadfb17624e
diff --git a/backend/component/sheet/sheet.go b/backend/component/sheet/sheet.go
index b6ba122f06..2157e8f251 100644
--- a/backend/component/sheet/sheet.go
+++ b/backend/component/sheet/sheet.go
@@ -101,7 +101,8 @@ func getSheetCommandsGeneral(engine storepb.Engine, statement string) []*storepb
}
return nil
}
- if len(singleSQLs) > common.MaximumCommands {
+ // HACK(p0ny): always split for pg
+ if len(singleSQLs) > common.MaximumCommands && engine != storepb.Engine_POSTGRES {
return nil
}
diff --git a/backend/plugin/db/pg/pg.go b/backend/plugin/db/pg/pg.go
index 00149e83b6..ff02ffb942 100644
--- a/backend/plugin/db/pg/pg.go
+++ b/backend/plugin/db/pg/pg.go
@@ -368,7 +368,9 @@ func (driver *Driver) Execute(ctx context.Context, statement string, opts db.Exe
var originalIndex []int32
var isPlsql bool
oneshot := true
- if len(statement) <= common.MaxSheetCheckSize {
+ // HACK(p0ny): always split for pg
+ //nolint
+ if true || len(statement) <= common.MaxSheetCheckSize {
singleSQLs, err := pgparser.SplitSQL(statement)
if err != nil {
return 0, err
@@ -382,11 +384,15 @@ func (driver *Driver) Execute(ctx context.Context, statement string, opts db.Exe
if len(singleSQLs) == 1 && isPlSQLBlock(singleSQLs[0].Text) {
isPlsql = true
}
- if len(commands) <= common.MaximumCommands {
+ // HACK(p0ny): always split for pg
+ //nolint
+ if false && len(commands) <= common.MaximumCommands {
oneshot = false
}
}
- if oneshot {
+ // HACK(p0ny): always split for pg
+ //nolint
+ if false && oneshot {
commands = []base.SingleSQL{
{
Text: statement,