Skip to content
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/PuerkitoBio/goquery v1.8.1
github.com/cockroachdb/apd/v2 v2.0.3-0.20200518165714-d020e156310a
github.com/cockroachdb/errors v1.7.5
github.com/dolthub/dolt/go v0.40.5-0.20260205001014-db7263eb669c
github.com/dolthub/dolt/go v0.40.5-0.20260205190625-38d74885c6f4
github.com/dolthub/eventsapi_schema v0.0.0-20250915094920-eadfd39051ca
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2
github.com/dolthub/go-mysql-server v0.20.1-0.20260204193159-86990113e4cc
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ github.com/dolthub/aws-sdk-go-ini-parser v0.0.0-20250305001723-2821c37f6c12 h1:I
github.com/dolthub/aws-sdk-go-ini-parser v0.0.0-20250305001723-2821c37f6c12/go.mod h1:rN7X8BHwkjPcfMQQ2QTAq/xM3leUSGLfb+1Js7Y6TVo=
github.com/dolthub/dolt-mcp v0.2.2 h1:bpROmam74n95uU4EA3BpOIVlTDT0pzeFMBwe/YRq2mI=
github.com/dolthub/dolt-mcp v0.2.2/go.mod h1:S++DJ4QWTAXq+0TNzFa7Oq3IhoT456DJHwAINFAHgDQ=
github.com/dolthub/dolt/go v0.40.5-0.20260205001014-db7263eb669c h1:lrTKtYUO5T5ka0/rgOx9TnSIFuzUv6R86wx7cRDVuUU=
github.com/dolthub/dolt/go v0.40.5-0.20260205001014-db7263eb669c/go.mod h1:GTxR5JEXqpGgYHQc6nBnu/m+TgEC/LP9IPB+b3tIrvc=
github.com/dolthub/dolt/go v0.40.5-0.20260205190625-38d74885c6f4 h1:RiRxt09K8viSZwl4f72KTLZQ228y59tPgdPJXSKvNnA=
github.com/dolthub/dolt/go v0.40.5-0.20260205190625-38d74885c6f4/go.mod h1:GTxR5JEXqpGgYHQc6nBnu/m+TgEC/LP9IPB+b3tIrvc=
github.com/dolthub/eventsapi_schema v0.0.0-20250915094920-eadfd39051ca h1:BGFz/0OlKIuC6qHIZQbvPapFvdAJkeEyGXWVgL5clmE=
github.com/dolthub/eventsapi_schema v0.0.0-20250915094920-eadfd39051ca/go.mod h1:CoDLfgPqHyBtth0Cp+fi/CmC4R81zJNX4wPjShdZ+Bw=
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 h1:u3PMzfF8RkKd3lB9pZ2bfn0qEG+1Gms9599cr0REMww=
Expand Down
2 changes: 1 addition & 1 deletion server/hook/delete_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (

// BeforeTableDeletion performs all validation necessary to ensure that table deletion does not leave the database in an
// invalid state.
func BeforeTableDeletion(ctx *sql.Context, runner sql.StatementRunner, nodeInterface sql.Node) (sql.Node, error) {
func BeforeTableDeletion(ctx *sql.Context, _ sql.StatementRunner, nodeInterface sql.Node) (sql.Node, error) {
n, ok := nodeInterface.(*plan.DropTable)
if !ok {
return nil, errors.Newf("DROP TABLE pre-hook expected `*plan.DropTable` but received `%T`", nodeInterface)
Expand Down
28 changes: 28 additions & 0 deletions server/types/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"time"

"github.com/cockroachdb/errors"
"github.com/dolthub/dolt/go/store/val"
"github.com/dolthub/go-mysql-server/sql"
"github.com/dolthub/go-mysql-server/sql/types"
"github.com/dolthub/vitess/go/sqltypes"
Expand Down Expand Up @@ -93,6 +94,7 @@ var _ sql.ExtendedType = &DoltgresType{}
var _ sql.NullType = &DoltgresType{}
var _ sql.StringType = &DoltgresType{}
var _ sql.NumberType = &DoltgresType{}
var _ val.TupleTypeHandler = &DoltgresType{}

// NewUnresolvedDoltgresType returns a DoltgresType that is not resolved.
// The type will have the schema and name defined with given values, with IsUnresolved == true.
Expand Down Expand Up @@ -1045,6 +1047,32 @@ func (t *DoltgresType) DeserializeValue(ctx context.Context, val []byte) (any, e
}
}

// SerializationCompatible implements the val.TupleTypeHandler interface.
func (t *DoltgresType) SerializationCompatible(other val.TupleTypeHandler) bool {
ot, ok := other.(*DoltgresType)
return ok && t.Equals(ot)
}

// ConvertSerialized implements the val.TupleTypeHandler interface.
func (t *DoltgresType) ConvertSerialized(ctx context.Context, other val.TupleTypeHandler, val []byte) ([]byte, error) {
ot, ok := other.(*DoltgresType)
if !ok {
return nil, errors.Errorf("expected DoltgresType, got %T", other)
}

value, err := ot.DeserializeValue(ctx, val)
if err != nil {
return nil, err
}

toValue, _, err := t.ConvertToType(nil, ot, value)
if err != nil {
return nil, err
}

return t.SerializeValue(ctx, toValue)
}

// TypeCastFunction is a function that takes a value of a particular kind of type, and returns it as another kind of type.
// The targetType given should match the "To" type used to obtain the cast.
type TypeCastFunction func(ctx *sql.Context, val any, targetType *DoltgresType) (any, error)
3 changes: 2 additions & 1 deletion servercfg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ import (
"github.com/dolthub/go-mysql-server/sql"
"gopkg.in/yaml.v2"

"github.com/dolthub/doltgresql/server/hook"

pgsql "github.com/dolthub/doltgresql/postgres/parser/parser/sql"
"github.com/dolthub/doltgresql/server/analyzer"
"github.com/dolthub/doltgresql/server/expression"
"github.com/dolthub/doltgresql/server/hook"
"github.com/dolthub/doltgresql/servercfg/cfgdetails"
)

Expand Down
Loading