@@ -20,47 +20,46 @@ import (
2020 "github.com/dolthub/doltgresql/core/id"
2121)
2222
23- // NewAnonymousRecordType creates a new type for an anonymous record, whose fields have the types
24- // specified in |fieldTypes|.
25- func NewAnonymousRecordType (fieldTypes []sql.Type ) * DoltgresType {
26- return & DoltgresType {
27- ID : toInternal ("record" ),
28- TypLength : - 1 ,
29- PassedByVal : false ,
30- FieldTypes : fieldTypes ,
31- TypType : TypeType_Pseudo ,
32- TypCategory : TypeCategory_PseudoTypes ,
33- IsPreferred : false ,
34- IsDefined : true ,
35- Delimiter : "," ,
36- RelID : id .Null ,
37- SubscriptFunc : toFuncID ("-" ),
38- Elem : id .NullType ,
39- Array : toInternal ("_record" ),
40- InputFunc : toFuncID ("record_in" , toInternal ("cstring" ), toInternal ("oid" ), toInternal ("int4" )),
41- OutputFunc : toFuncID ("record_out" , toInternal ("record" )),
42- ReceiveFunc : toFuncID ("record_recv" , toInternal ("internal" ), toInternal ("oid" ), toInternal ("int4" )),
43- SendFunc : toFuncID ("record_send" , toInternal ("record" )),
44- ModInFunc : toFuncID ("-" ),
45- ModOutFunc : toFuncID ("-" ),
46- AnalyzeFunc : toFuncID ("-" ),
47- Align : TypeAlignment_Double ,
48- Storage : TypeStorage_Extended ,
49- NotNull : false ,
50- BaseTypeID : id .NullType ,
51- TypMod : - 1 ,
52- NDims : 0 ,
53- TypCollation : id .NullCollation ,
54- DefaulBin : "" ,
55- Default : "" ,
56- Acl : nil ,
57- Checks : nil ,
58- attTypMod : - 1 ,
59- CompareFunc : toFuncID ("btrecordcmp" , toInternal ("record" ), toInternal ("record" )),
60- }
61- }
62-
6323// Record is a generic, anonymous record type, without field type information supplied yet. When used with RecordExpr,
6424// the field type information will be created once the field expressions are analyzed and type information is available,
6525// and a new DoltgresType instance will be created with the field type information populated.
66- var Record = NewAnonymousRecordType (nil )
26+ var Record = & DoltgresType {
27+ ID : toInternal ("record" ),
28+ TypLength : - 1 ,
29+ PassedByVal : false ,
30+ TypType : TypeType_Pseudo ,
31+ TypCategory : TypeCategory_PseudoTypes ,
32+ IsPreferred : false ,
33+ IsDefined : true ,
34+ Delimiter : "," ,
35+ RelID : id .Null ,
36+ SubscriptFunc : toFuncID ("-" ),
37+ Elem : id .NullType ,
38+ Array : toInternal ("_record" ),
39+ InputFunc : toFuncID ("record_in" , toInternal ("cstring" ), toInternal ("oid" ), toInternal ("int4" )),
40+ OutputFunc : toFuncID ("record_out" , toInternal ("record" )),
41+ ReceiveFunc : toFuncID ("record_recv" , toInternal ("internal" ), toInternal ("oid" ), toInternal ("int4" )),
42+ SendFunc : toFuncID ("record_send" , toInternal ("record" )),
43+ ModInFunc : toFuncID ("-" ),
44+ ModOutFunc : toFuncID ("-" ),
45+ AnalyzeFunc : toFuncID ("-" ),
46+ Align : TypeAlignment_Double ,
47+ Storage : TypeStorage_Extended ,
48+ NotNull : false ,
49+ BaseTypeID : id .NullType ,
50+ TypMod : - 1 ,
51+ NDims : 0 ,
52+ TypCollation : id .NullCollation ,
53+ DefaulBin : "" ,
54+ Default : "" ,
55+ Acl : nil ,
56+ Checks : nil ,
57+ attTypMod : - 1 ,
58+ }
59+
60+ // RecordValue holds the value of a single field in a record, including type information for the
61+ // field value.
62+ type RecordValue struct {
63+ Value any
64+ Type sql.Type
65+ }
0 commit comments