Skip to content

Commit 3659488

Browse files
authored
Add basic vector type (#2866)
This adds the new MySQL 9.0 vector type. It can still be handled like a binary blob for now I think. Maybe it's worth in the future to directly decode / parse it into an array of floats here? Signed-off-by: Dirkjan Bussink <[email protected]>
1 parent 3d1d8cd commit 3659488

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

lib/constants/types.js

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ module.exports.YEAR = 0x0d; // aka YEAR, 1 byte (don't ask)
5151
module.exports.NEWDATE = 0x0e; // aka ?
5252
module.exports.VARCHAR = 0x0f; // aka VARCHAR (?)
5353
module.exports.BIT = 0x10; // aka BIT, 1-8 byte
54+
module.exports.VECTOR = 0xf2;
5455
module.exports.JSON = 0xf5;
5556
module.exports.NEWDECIMAL = 0xf6; // aka DECIMAL
5657
module.exports.ENUM = 0xf7; // aka ENUM

typings/mysql/lib/constants/Types.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ interface Types {
1616
0x0e: string;
1717
0x0f: string;
1818
0x10: string;
19+
0xf2: string;
1920
0xf5: string;
2021
0xf6: string;
2122
0xf7: string;
@@ -45,6 +46,7 @@ interface Types {
4546
NEWDATE: number;
4647
VARCHAR: number;
4748
BIT: number;
49+
VECTOR: number;
4850
JSON: number;
4951
NEWDECIMAL: number;
5052
ENUM: number;

typings/mysql/lib/parsers/typeCast.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export type Type = {
2525
| 'NEWDATE'
2626
| 'VARCHAR'
2727
| 'BIT'
28+
| 'VECTOR'
2829
| 'JSON'
2930
| 'NEWDECIMAL'
3031
| 'ENUM'

0 commit comments

Comments
 (0)