Skip to content

Commit a7ca32b

Browse files
committed
Need to add bit types to global registry
1 parent 99511c3 commit a7ca32b

5 files changed

Lines changed: 41 additions & 5 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ func NewBitType(width int32) (*DoltgresType, error) {
6161
if err != nil {
6262
return nil, err
6363
}
64-
newType := *VarBit.WithAttTypMod(typmod)
64+
newType := *Bit.WithAttTypMod(typmod)
6565
return &newType, nil
6666
}

server/types/bit_array.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2025 Dolthub, Inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package types
16+
17+
// BitArray is the array variant of VarBit.
18+
var BitArray = CreateArrayTypeFromBaseType(Bit)

server/types/globals.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func GetAllBuitInTypes() []*DoltgresType {
112112
var IDToBuiltInDoltgresType = map[id.Type]*DoltgresType{
113113
toInternal("_abstime"): Unknown,
114114
toInternal("_aclitem"): Unknown,
115-
toInternal("_bit"): Unknown,
115+
toInternal("_bit"): BitArray,
116116
toInternal("_bool"): BoolArray,
117117
toInternal("_box"): Unknown,
118118
toInternal("_bpchar"): BpCharArray,
@@ -176,7 +176,7 @@ var IDToBuiltInDoltgresType = map[id.Type]*DoltgresType{
176176
toInternal("_tsvector"): Unknown,
177177
toInternal("_txid_snapshot"): Unknown,
178178
toInternal("_uuid"): UuidArray,
179-
toInternal("_varbit"): Unknown,
179+
toInternal("_varbit"): VarBitArray,
180180
toInternal("_varchar"): VarCharArray,
181181
toInternal("_xid"): XidArray,
182182
toInternal("_xml"): Unknown,
@@ -188,7 +188,7 @@ var IDToBuiltInDoltgresType = map[id.Type]*DoltgresType{
188188
toInternal("anyenum"): AnyEnum,
189189
toInternal("anynonarray"): AnyNonArray,
190190
toInternal("anyrange"): Unknown,
191-
toInternal("bit"): Unknown,
191+
toInternal("bit"): Bit,
192192
toInternal("bool"): Bool,
193193
toInternal("box"): Unknown,
194194
toInternal("bpchar"): BpChar,
@@ -272,7 +272,7 @@ var IDToBuiltInDoltgresType = map[id.Type]*DoltgresType{
272272
toInternal("txid_snapshot"): Unknown,
273273
toInternal("unknown"): Unknown,
274274
toInternal("uuid"): Uuid,
275-
toInternal("varbit"): Unknown,
275+
toInternal("varbit"): VarBit,
276276
toInternal("varchar"): VarChar,
277277
toInternal("void"): Void,
278278
toInternal("xid"): Xid,

server/types/varbit_array.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2025 Dolthub, Inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package types
16+
17+
// VarBitArray is the array variant of VarBit.
18+
var VarBitArray = CreateArrayTypeFromBaseType(VarBit)

0 commit comments

Comments
 (0)