Skip to content

Commit

Permalink
Add basic vector type (#2866)
Browse files Browse the repository at this point in the history
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 <d.bussink@gmail.com>
  • Loading branch information
dbussink authored Jul 24, 2024
1 parent 3d1d8cd commit 3659488
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/constants/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ module.exports.YEAR = 0x0d; // aka YEAR, 1 byte (don't ask)
module.exports.NEWDATE = 0x0e; // aka ?
module.exports.VARCHAR = 0x0f; // aka VARCHAR (?)
module.exports.BIT = 0x10; // aka BIT, 1-8 byte
module.exports.VECTOR = 0xf2;
module.exports.JSON = 0xf5;
module.exports.NEWDECIMAL = 0xf6; // aka DECIMAL
module.exports.ENUM = 0xf7; // aka ENUM
Expand Down
2 changes: 2 additions & 0 deletions typings/mysql/lib/constants/Types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ interface Types {
0x0e: string;
0x0f: string;
0x10: string;
0xf2: string;
0xf5: string;
0xf6: string;
0xf7: string;
Expand Down Expand Up @@ -45,6 +46,7 @@ interface Types {
NEWDATE: number;
VARCHAR: number;
BIT: number;
VECTOR: number;
JSON: number;
NEWDECIMAL: number;
ENUM: number;
Expand Down
1 change: 1 addition & 0 deletions typings/mysql/lib/parsers/typeCast.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export type Type = {
| 'NEWDATE'
| 'VARCHAR'
| 'BIT'
| 'VECTOR'
| 'JSON'
| 'NEWDECIMAL'
| 'ENUM'
Expand Down

0 comments on commit 3659488

Please sign in to comment.