Skip to content

Commit

Permalink
Merge pull request #627 from tablelandnetwork/bcalza/remove-constraints
Browse files Browse the repository at this point in the history
updates parser that removes some constraints
  • Loading branch information
brunocalza authored Aug 22, 2024
2 parents 15ff8d6 + 4c71da6 commit 6d27a47
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/sethvargo/go-limiter v0.7.2
github.com/spf13/cobra v1.7.0
github.com/stretchr/testify v1.8.2
github.com/tablelandnetwork/sqlparser v0.0.0-20240529190608-e3776575020d
github.com/tablelandnetwork/sqlparser v0.0.0-20240816204758-a982c05b74be
github.com/textileio/cli v1.0.2
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.37.0
go.opentelemetry.io/otel v1.14.0
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1299,6 +1299,10 @@ github.com/tablelandnetwork/sqlparser v0.0.0-20240523182602-af3edf08e3db h1:4/eO
github.com/tablelandnetwork/sqlparser v0.0.0-20240523182602-af3edf08e3db/go.mod h1:S+M/v3Q8X+236kQxMQziFcLId2Cscb1LzW06IUVhljE=
github.com/tablelandnetwork/sqlparser v0.0.0-20240529190608-e3776575020d h1:Xhc6wudmyItX8Pvr+Z2SCzOmrf/zda5sX1jCgUySNRg=
github.com/tablelandnetwork/sqlparser v0.0.0-20240529190608-e3776575020d/go.mod h1:S+M/v3Q8X+236kQxMQziFcLId2Cscb1LzW06IUVhljE=
github.com/tablelandnetwork/sqlparser v0.0.0-20240816141915-b33ac93c827a h1:Laz5yY58N2hUxDdVSejR3mIg0fGAjpD4JktMkgY6dDk=
github.com/tablelandnetwork/sqlparser v0.0.0-20240816141915-b33ac93c827a/go.mod h1:S+M/v3Q8X+236kQxMQziFcLId2Cscb1LzW06IUVhljE=
github.com/tablelandnetwork/sqlparser v0.0.0-20240816204758-a982c05b74be h1:g4/tys/pCKgqUUFg/zsvmS1GxoaEJjDFW4bNVLwbWx8=
github.com/tablelandnetwork/sqlparser v0.0.0-20240816204758-a982c05b74be/go.mod h1:S+M/v3Q8X+236kQxMQziFcLId2Cscb1LzW06IUVhljE=
github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I=
github.com/textileio/cli v1.0.2 h1:qSp/x4d/9SZ93TxhgZnE5okRKqzqHqrzAwKAPjuPw50=
github.com/textileio/cli v1.0.2/go.mod h1:vTlCvvVyOmXXLwddCcBg3PDavfUsCkRBZoyr6Nu1lkc=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestReplayProductionHistory(t *testing.T) {
69: "b1136bd05118349be32372509f05c240180a93d3",
137: "12b3d0aa62b4e61b10ea81c16bf050f8c27b1dca",
420: "058bd19e7874fa3c9436b0cebbcf5846f7c347f3",
80001: "92e3252755054c969a1e1118a8e3743b2b1768a7",
80001: "afa4cd0ec2c097a013b4d258ce8bb65b67b8fe85",
421613: "18ae0ef43cdedc548706c61dccae533411f9d514",
}

Expand Down
15 changes: 0 additions & 15 deletions pkg/parsing/impl/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,16 +337,6 @@ func TestWriteQuery(t *testing.T) {
query: "update foo set a=1 from bar",
expErrType: ptr2ErrInvalidSyntax(),
},
{
name: "update where subquery",
query: "update foo set a=1 where a=(select a from bar limit 1) and b=1",
expErrType: ptr2ErrSubquery(),
},
{
name: "delete where subquery",
query: "delete from foo where a=(select a from bar limit 1)",
expErrType: ptr2ErrSubquery(),
},

// Disallow RETURNING clauses
{
Expand Down Expand Up @@ -994,11 +984,6 @@ func ptr2ErrKeywordIsNotAllowed() **sqlparser.ErrKeywordIsNotAllowed {
return &e
}

func ptr2ErrSubquery() **sqlparser.ErrStatementContainsSubquery {
var e *sqlparser.ErrStatementContainsSubquery
return &e
}

func ptr2ErrNoTopLevelCreate() **parsing.ErrNoTopLevelCreate {
var e *parsing.ErrNoTopLevelCreate
return &e
Expand Down

0 comments on commit 6d27a47

Please sign in to comment.