From e4840a923dc064214475bad280f110ea5113b302 Mon Sep 17 00:00:00 2001 From: Nick Tobey Date: Tue, 18 Feb 2025 14:09:38 -0800 Subject: [PATCH] Add context parameter to ExtendedType interface. --- sql/types/extended.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sql/types/extended.go b/sql/types/extended.go index 4335a5a3d3..fc0dc592d8 100644 --- a/sql/types/extended.go +++ b/sql/types/extended.go @@ -15,6 +15,7 @@ package types import ( + "context" "encoding/hex" "errors" @@ -26,11 +27,11 @@ type ExtendedType interface { sql.Type // SerializedCompare compares two byte slices that each represent a serialized value, without first deserializing // the value. This should return the same result as the Compare function. - SerializedCompare(v1 []byte, v2 []byte) (int, error) + SerializedCompare(ctx context.Context, v1 []byte, v2 []byte) (int, error) // SerializeValue converts the given value into a binary representation. - SerializeValue(val any) ([]byte, error) + SerializeValue(ctx context.Context, val any) ([]byte, error) // DeserializeValue converts a binary representation of a value into its canonical type. - DeserializeValue(val []byte) (any, error) + DeserializeValue(ctx context.Context, val []byte) (any, error) // FormatValue returns a string version of the value. Primarily intended for display. FormatValue(val any) (string, error) // MaxSerializedWidth returns the maximum size that the serialized value may represent.