drizzle-orm 0.38.3 → 0.38.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +13 -1
- package/singlestore-core/columns/all.cjs +2 -0
- package/singlestore-core/columns/all.cjs.map +1 -1
- package/singlestore-core/columns/all.d.cts +2 -0
- package/singlestore-core/columns/all.d.ts +2 -0
- package/singlestore-core/columns/all.js +2 -0
- package/singlestore-core/columns/all.js.map +1 -1
- package/singlestore-core/columns/index.cjs +2 -0
- package/singlestore-core/columns/index.cjs.map +1 -1
- package/singlestore-core/columns/index.d.cts +1 -0
- package/singlestore-core/columns/index.d.ts +1 -0
- package/singlestore-core/columns/index.js +1 -0
- package/singlestore-core/columns/index.js.map +1 -1
- package/singlestore-core/columns/vector.cjs +72 -0
- package/singlestore-core/columns/vector.cjs.map +1 -0
- package/singlestore-core/columns/vector.d.cts +32 -0
- package/singlestore-core/columns/vector.d.ts +32 -0
- package/singlestore-core/columns/vector.js +46 -0
- package/singlestore-core/columns/vector.js.map +1 -0
- package/singlestore-core/expressions.cjs +10 -0
- package/singlestore-core/expressions.cjs.map +1 -1
- package/singlestore-core/expressions.d.cts +2 -0
- package/singlestore-core/expressions.d.ts +2 -0
- package/singlestore-core/expressions.js +8 -0
- package/singlestore-core/expressions.js.map +1 -1
- package/version.cjs +1 -1
- package/version.d.cts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drizzle-orm",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.4",
|
|
4
4
|
"description": "Drizzle ORM package for SQL databases",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -4177,6 +4177,18 @@
|
|
|
4177
4177
|
"types": "./singlestore-core/columns/varchar.d.ts",
|
|
4178
4178
|
"default": "./singlestore-core/columns/varchar.js"
|
|
4179
4179
|
},
|
|
4180
|
+
"./singlestore-core/columns/vector": {
|
|
4181
|
+
"import": {
|
|
4182
|
+
"types": "./singlestore-core/columns/vector.d.ts",
|
|
4183
|
+
"default": "./singlestore-core/columns/vector.js"
|
|
4184
|
+
},
|
|
4185
|
+
"require": {
|
|
4186
|
+
"types": "./singlestore-core/columns/vector.d.cts",
|
|
4187
|
+
"default": "./singlestore-core/columns/vector.cjs"
|
|
4188
|
+
},
|
|
4189
|
+
"types": "./singlestore-core/columns/vector.d.ts",
|
|
4190
|
+
"default": "./singlestore-core/columns/vector.js"
|
|
4191
|
+
},
|
|
4180
4192
|
"./singlestore-core/columns/year": {
|
|
4181
4193
|
"import": {
|
|
4182
4194
|
"types": "./singlestore-core/columns/year.d.ts",
|
|
@@ -44,6 +44,7 @@ var import_timestamp = require("./timestamp.cjs");
|
|
|
44
44
|
var import_tinyint = require("./tinyint.cjs");
|
|
45
45
|
var import_varbinary = require("./varbinary.cjs");
|
|
46
46
|
var import_varchar = require("./varchar.cjs");
|
|
47
|
+
var import_vector = require("./vector.cjs");
|
|
47
48
|
var import_year = require("./year.cjs");
|
|
48
49
|
function getSingleStoreColumnBuilders() {
|
|
49
50
|
return {
|
|
@@ -73,6 +74,7 @@ function getSingleStoreColumnBuilders() {
|
|
|
73
74
|
tinyint: import_tinyint.tinyint,
|
|
74
75
|
varbinary: import_varbinary.varbinary,
|
|
75
76
|
varchar: import_varchar.varchar,
|
|
77
|
+
vector: import_vector.vector,
|
|
76
78
|
year: import_year.year
|
|
77
79
|
};
|
|
78
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/singlestore-core/columns/all.ts"],"sourcesContent":["import { bigint } from './bigint.ts';\nimport { binary } from './binary.ts';\nimport { boolean } from './boolean.ts';\nimport { char } from './char.ts';\nimport { customType } from './custom.ts';\nimport { date } from './date.ts';\nimport { datetime } from './datetime.ts';\nimport { decimal } from './decimal.ts';\nimport { double } from './double.ts';\nimport { singlestoreEnum } from './enum.ts';\nimport { float } from './float.ts';\nimport { int } from './int.ts';\nimport { json } from './json.ts';\nimport { mediumint } from './mediumint.ts';\nimport { real } from './real.ts';\nimport { serial } from './serial.ts';\nimport { smallint } from './smallint.ts';\nimport { longtext, mediumtext, text, tinytext } from './text.ts';\nimport { time } from './time.ts';\nimport { timestamp } from './timestamp.ts';\nimport { tinyint } from './tinyint.ts';\nimport { varbinary } from './varbinary.ts';\nimport { varchar } from './varchar.ts';\nimport { year } from './year.ts';\n\nexport function getSingleStoreColumnBuilders() {\n\treturn {\n\t\tbigint,\n\t\tbinary,\n\t\tboolean,\n\t\tchar,\n\t\tcustomType,\n\t\tdate,\n\t\tdatetime,\n\t\tdecimal,\n\t\tdouble,\n\t\tsinglestoreEnum,\n\t\tfloat,\n\t\tint,\n\t\tjson,\n\t\tmediumint,\n\t\treal,\n\t\tserial,\n\t\tsmallint,\n\t\tlongtext,\n\t\tmediumtext,\n\t\ttext,\n\t\ttinytext,\n\t\ttime,\n\t\ttimestamp,\n\t\ttinyint,\n\t\tvarbinary,\n\t\tvarchar,\n\t\tyear,\n\t};\n}\n\nexport type SingleStoreColumnBuilders = ReturnType<typeof getSingleStoreColumnBuilders>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AACvB,oBAAuB;AACvB,qBAAwB;AACxB,kBAAqB;AACrB,oBAA2B;AAC3B,kBAAqB;AACrB,sBAAyB;AACzB,qBAAwB;AACxB,oBAAuB;AACvB,kBAAgC;AAChC,mBAAsB;AACtB,iBAAoB;AACpB,kBAAqB;AACrB,uBAA0B;AAC1B,kBAAqB;AACrB,oBAAuB;AACvB,sBAAyB;AACzB,kBAAqD;AACrD,kBAAqB;AACrB,uBAA0B;AAC1B,qBAAwB;AACxB,uBAA0B;AAC1B,qBAAwB;AACxB,kBAAqB;AAEd,SAAS,+BAA+B;AAC9C,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/singlestore-core/columns/all.ts"],"sourcesContent":["import { bigint } from './bigint.ts';\nimport { binary } from './binary.ts';\nimport { boolean } from './boolean.ts';\nimport { char } from './char.ts';\nimport { customType } from './custom.ts';\nimport { date } from './date.ts';\nimport { datetime } from './datetime.ts';\nimport { decimal } from './decimal.ts';\nimport { double } from './double.ts';\nimport { singlestoreEnum } from './enum.ts';\nimport { float } from './float.ts';\nimport { int } from './int.ts';\nimport { json } from './json.ts';\nimport { mediumint } from './mediumint.ts';\nimport { real } from './real.ts';\nimport { serial } from './serial.ts';\nimport { smallint } from './smallint.ts';\nimport { longtext, mediumtext, text, tinytext } from './text.ts';\nimport { time } from './time.ts';\nimport { timestamp } from './timestamp.ts';\nimport { tinyint } from './tinyint.ts';\nimport { varbinary } from './varbinary.ts';\nimport { varchar } from './varchar.ts';\nimport { vector } from './vector.ts';\nimport { year } from './year.ts';\n\nexport function getSingleStoreColumnBuilders() {\n\treturn {\n\t\tbigint,\n\t\tbinary,\n\t\tboolean,\n\t\tchar,\n\t\tcustomType,\n\t\tdate,\n\t\tdatetime,\n\t\tdecimal,\n\t\tdouble,\n\t\tsinglestoreEnum,\n\t\tfloat,\n\t\tint,\n\t\tjson,\n\t\tmediumint,\n\t\treal,\n\t\tserial,\n\t\tsmallint,\n\t\tlongtext,\n\t\tmediumtext,\n\t\ttext,\n\t\ttinytext,\n\t\ttime,\n\t\ttimestamp,\n\t\ttinyint,\n\t\tvarbinary,\n\t\tvarchar,\n\t\tvector,\n\t\tyear,\n\t};\n}\n\nexport type SingleStoreColumnBuilders = ReturnType<typeof getSingleStoreColumnBuilders>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AACvB,oBAAuB;AACvB,qBAAwB;AACxB,kBAAqB;AACrB,oBAA2B;AAC3B,kBAAqB;AACrB,sBAAyB;AACzB,qBAAwB;AACxB,oBAAuB;AACvB,kBAAgC;AAChC,mBAAsB;AACtB,iBAAoB;AACpB,kBAAqB;AACrB,uBAA0B;AAC1B,kBAAqB;AACrB,oBAAuB;AACvB,sBAAyB;AACzB,kBAAqD;AACrD,kBAAqB;AACrB,uBAA0B;AAC1B,qBAAwB;AACxB,uBAA0B;AAC1B,qBAAwB;AACxB,oBAAuB;AACvB,kBAAqB;AAEd,SAAS,+BAA+B;AAC9C,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;","names":[]}
|
|
@@ -21,6 +21,7 @@ import { timestamp } from "./timestamp.cjs";
|
|
|
21
21
|
import { tinyint } from "./tinyint.cjs";
|
|
22
22
|
import { varbinary } from "./varbinary.cjs";
|
|
23
23
|
import { varchar } from "./varchar.cjs";
|
|
24
|
+
import { vector } from "./vector.cjs";
|
|
24
25
|
import { year } from "./year.cjs";
|
|
25
26
|
export declare function getSingleStoreColumnBuilders(): {
|
|
26
27
|
bigint: typeof bigint;
|
|
@@ -49,6 +50,7 @@ export declare function getSingleStoreColumnBuilders(): {
|
|
|
49
50
|
tinyint: typeof tinyint;
|
|
50
51
|
varbinary: typeof varbinary;
|
|
51
52
|
varchar: typeof varchar;
|
|
53
|
+
vector: typeof vector;
|
|
52
54
|
year: typeof year;
|
|
53
55
|
};
|
|
54
56
|
export type SingleStoreColumnBuilders = ReturnType<typeof getSingleStoreColumnBuilders>;
|
|
@@ -21,6 +21,7 @@ import { timestamp } from "./timestamp.js";
|
|
|
21
21
|
import { tinyint } from "./tinyint.js";
|
|
22
22
|
import { varbinary } from "./varbinary.js";
|
|
23
23
|
import { varchar } from "./varchar.js";
|
|
24
|
+
import { vector } from "./vector.js";
|
|
24
25
|
import { year } from "./year.js";
|
|
25
26
|
export declare function getSingleStoreColumnBuilders(): {
|
|
26
27
|
bigint: typeof bigint;
|
|
@@ -49,6 +50,7 @@ export declare function getSingleStoreColumnBuilders(): {
|
|
|
49
50
|
tinyint: typeof tinyint;
|
|
50
51
|
varbinary: typeof varbinary;
|
|
51
52
|
varchar: typeof varchar;
|
|
53
|
+
vector: typeof vector;
|
|
52
54
|
year: typeof year;
|
|
53
55
|
};
|
|
54
56
|
export type SingleStoreColumnBuilders = ReturnType<typeof getSingleStoreColumnBuilders>;
|
|
@@ -21,6 +21,7 @@ import { timestamp } from "./timestamp.js";
|
|
|
21
21
|
import { tinyint } from "./tinyint.js";
|
|
22
22
|
import { varbinary } from "./varbinary.js";
|
|
23
23
|
import { varchar } from "./varchar.js";
|
|
24
|
+
import { vector } from "./vector.js";
|
|
24
25
|
import { year } from "./year.js";
|
|
25
26
|
function getSingleStoreColumnBuilders() {
|
|
26
27
|
return {
|
|
@@ -50,6 +51,7 @@ function getSingleStoreColumnBuilders() {
|
|
|
50
51
|
tinyint,
|
|
51
52
|
varbinary,
|
|
52
53
|
varchar,
|
|
54
|
+
vector,
|
|
53
55
|
year
|
|
54
56
|
};
|
|
55
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/singlestore-core/columns/all.ts"],"sourcesContent":["import { bigint } from './bigint.ts';\nimport { binary } from './binary.ts';\nimport { boolean } from './boolean.ts';\nimport { char } from './char.ts';\nimport { customType } from './custom.ts';\nimport { date } from './date.ts';\nimport { datetime } from './datetime.ts';\nimport { decimal } from './decimal.ts';\nimport { double } from './double.ts';\nimport { singlestoreEnum } from './enum.ts';\nimport { float } from './float.ts';\nimport { int } from './int.ts';\nimport { json } from './json.ts';\nimport { mediumint } from './mediumint.ts';\nimport { real } from './real.ts';\nimport { serial } from './serial.ts';\nimport { smallint } from './smallint.ts';\nimport { longtext, mediumtext, text, tinytext } from './text.ts';\nimport { time } from './time.ts';\nimport { timestamp } from './timestamp.ts';\nimport { tinyint } from './tinyint.ts';\nimport { varbinary } from './varbinary.ts';\nimport { varchar } from './varchar.ts';\nimport { year } from './year.ts';\n\nexport function getSingleStoreColumnBuilders() {\n\treturn {\n\t\tbigint,\n\t\tbinary,\n\t\tboolean,\n\t\tchar,\n\t\tcustomType,\n\t\tdate,\n\t\tdatetime,\n\t\tdecimal,\n\t\tdouble,\n\t\tsinglestoreEnum,\n\t\tfloat,\n\t\tint,\n\t\tjson,\n\t\tmediumint,\n\t\treal,\n\t\tserial,\n\t\tsmallint,\n\t\tlongtext,\n\t\tmediumtext,\n\t\ttext,\n\t\ttinytext,\n\t\ttime,\n\t\ttimestamp,\n\t\ttinyint,\n\t\tvarbinary,\n\t\tvarchar,\n\t\tyear,\n\t};\n}\n\nexport type SingleStoreColumnBuilders = ReturnType<typeof getSingleStoreColumnBuilders>;\n"],"mappings":"AAAA,SAAS,cAAc;AACvB,SAAS,cAAc;AACvB,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AACrB,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,SAAS,WAAW;AACpB,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,UAAU,YAAY,MAAM,gBAAgB;AACrD,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AACxB,SAAS,YAAY;AAEd,SAAS,+BAA+B;AAC9C,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/singlestore-core/columns/all.ts"],"sourcesContent":["import { bigint } from './bigint.ts';\nimport { binary } from './binary.ts';\nimport { boolean } from './boolean.ts';\nimport { char } from './char.ts';\nimport { customType } from './custom.ts';\nimport { date } from './date.ts';\nimport { datetime } from './datetime.ts';\nimport { decimal } from './decimal.ts';\nimport { double } from './double.ts';\nimport { singlestoreEnum } from './enum.ts';\nimport { float } from './float.ts';\nimport { int } from './int.ts';\nimport { json } from './json.ts';\nimport { mediumint } from './mediumint.ts';\nimport { real } from './real.ts';\nimport { serial } from './serial.ts';\nimport { smallint } from './smallint.ts';\nimport { longtext, mediumtext, text, tinytext } from './text.ts';\nimport { time } from './time.ts';\nimport { timestamp } from './timestamp.ts';\nimport { tinyint } from './tinyint.ts';\nimport { varbinary } from './varbinary.ts';\nimport { varchar } from './varchar.ts';\nimport { vector } from './vector.ts';\nimport { year } from './year.ts';\n\nexport function getSingleStoreColumnBuilders() {\n\treturn {\n\t\tbigint,\n\t\tbinary,\n\t\tboolean,\n\t\tchar,\n\t\tcustomType,\n\t\tdate,\n\t\tdatetime,\n\t\tdecimal,\n\t\tdouble,\n\t\tsinglestoreEnum,\n\t\tfloat,\n\t\tint,\n\t\tjson,\n\t\tmediumint,\n\t\treal,\n\t\tserial,\n\t\tsmallint,\n\t\tlongtext,\n\t\tmediumtext,\n\t\ttext,\n\t\ttinytext,\n\t\ttime,\n\t\ttimestamp,\n\t\ttinyint,\n\t\tvarbinary,\n\t\tvarchar,\n\t\tvector,\n\t\tyear,\n\t};\n}\n\nexport type SingleStoreColumnBuilders = ReturnType<typeof getSingleStoreColumnBuilders>;\n"],"mappings":"AAAA,SAAS,cAAc;AACvB,SAAS,cAAc;AACvB,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AACrB,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,SAAS,WAAW;AACpB,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,UAAU,YAAY,MAAM,gBAAgB;AACrD,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,YAAY;AAEd,SAAS,+BAA+B;AAC9C,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;","names":[]}
|
|
@@ -39,6 +39,7 @@ __reExport(columns_exports, require("./timestamp.cjs"), module.exports);
|
|
|
39
39
|
__reExport(columns_exports, require("./tinyint.cjs"), module.exports);
|
|
40
40
|
__reExport(columns_exports, require("./varbinary.cjs"), module.exports);
|
|
41
41
|
__reExport(columns_exports, require("./varchar.cjs"), module.exports);
|
|
42
|
+
__reExport(columns_exports, require("./vector.cjs"), module.exports);
|
|
42
43
|
__reExport(columns_exports, require("./year.cjs"), module.exports);
|
|
43
44
|
// Annotate the CommonJS export names for ESM import in node:
|
|
44
45
|
0 && (module.exports = {
|
|
@@ -66,6 +67,7 @@ __reExport(columns_exports, require("./year.cjs"), module.exports);
|
|
|
66
67
|
...require("./tinyint.cjs"),
|
|
67
68
|
...require("./varbinary.cjs"),
|
|
68
69
|
...require("./varchar.cjs"),
|
|
70
|
+
...require("./vector.cjs"),
|
|
69
71
|
...require("./year.cjs")
|
|
70
72
|
});
|
|
71
73
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/singlestore-core/columns/index.ts"],"sourcesContent":["export * from './bigint.ts';\nexport * from './binary.ts';\nexport * from './boolean.ts';\nexport * from './char.ts';\nexport * from './common.ts';\nexport * from './custom.ts';\nexport * from './date.ts';\nexport * from './datetime.ts';\nexport * from './decimal.ts';\nexport * from './double.ts';\nexport * from './enum.ts';\nexport * from './float.ts';\nexport * from './int.ts';\nexport * from './json.ts';\nexport * from './mediumint.ts';\nexport * from './real.ts';\nexport * from './serial.ts';\nexport * from './smallint.ts';\nexport * from './text.ts';\nexport * from './time.ts';\nexport * from './timestamp.ts';\nexport * from './tinyint.ts';\nexport * from './varbinary.ts';\nexport * from './varchar.ts';\nexport * from './year.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,4BAAc,wBAAd;AACA,4BAAc,wBADd;AAEA,4BAAc,yBAFd;AAGA,4BAAc,sBAHd;AAIA,4BAAc,wBAJd;AAKA,4BAAc,wBALd;AAMA,4BAAc,sBANd;AAOA,4BAAc,0BAPd;AAQA,4BAAc,yBARd;AASA,4BAAc,wBATd;AAUA,4BAAc,sBAVd;AAWA,4BAAc,uBAXd;AAYA,4BAAc,qBAZd;AAaA,4BAAc,sBAbd;AAcA,4BAAc,2BAdd;AAeA,4BAAc,sBAfd;AAgBA,4BAAc,wBAhBd;AAiBA,4BAAc,0BAjBd;AAkBA,4BAAc,sBAlBd;AAmBA,4BAAc,sBAnBd;AAoBA,4BAAc,2BApBd;AAqBA,4BAAc,yBArBd;AAsBA,4BAAc,2BAtBd;AAuBA,4BAAc,yBAvBd;AAwBA,4BAAc,
|
|
1
|
+
{"version":3,"sources":["../../../src/singlestore-core/columns/index.ts"],"sourcesContent":["export * from './bigint.ts';\nexport * from './binary.ts';\nexport * from './boolean.ts';\nexport * from './char.ts';\nexport * from './common.ts';\nexport * from './custom.ts';\nexport * from './date.ts';\nexport * from './datetime.ts';\nexport * from './decimal.ts';\nexport * from './double.ts';\nexport * from './enum.ts';\nexport * from './float.ts';\nexport * from './int.ts';\nexport * from './json.ts';\nexport * from './mediumint.ts';\nexport * from './real.ts';\nexport * from './serial.ts';\nexport * from './smallint.ts';\nexport * from './text.ts';\nexport * from './time.ts';\nexport * from './timestamp.ts';\nexport * from './tinyint.ts';\nexport * from './varbinary.ts';\nexport * from './varchar.ts';\nexport * from './vector.ts';\nexport * from './year.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,4BAAc,wBAAd;AACA,4BAAc,wBADd;AAEA,4BAAc,yBAFd;AAGA,4BAAc,sBAHd;AAIA,4BAAc,wBAJd;AAKA,4BAAc,wBALd;AAMA,4BAAc,sBANd;AAOA,4BAAc,0BAPd;AAQA,4BAAc,yBARd;AASA,4BAAc,wBATd;AAUA,4BAAc,sBAVd;AAWA,4BAAc,uBAXd;AAYA,4BAAc,qBAZd;AAaA,4BAAc,sBAbd;AAcA,4BAAc,2BAdd;AAeA,4BAAc,sBAfd;AAgBA,4BAAc,wBAhBd;AAiBA,4BAAc,0BAjBd;AAkBA,4BAAc,sBAlBd;AAmBA,4BAAc,sBAnBd;AAoBA,4BAAc,2BApBd;AAqBA,4BAAc,yBArBd;AAsBA,4BAAc,2BAtBd;AAuBA,4BAAc,yBAvBd;AAwBA,4BAAc,wBAxBd;AAyBA,4BAAc,sBAzBd;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/singlestore-core/columns/index.ts"],"sourcesContent":["export * from './bigint.ts';\nexport * from './binary.ts';\nexport * from './boolean.ts';\nexport * from './char.ts';\nexport * from './common.ts';\nexport * from './custom.ts';\nexport * from './date.ts';\nexport * from './datetime.ts';\nexport * from './decimal.ts';\nexport * from './double.ts';\nexport * from './enum.ts';\nexport * from './float.ts';\nexport * from './int.ts';\nexport * from './json.ts';\nexport * from './mediumint.ts';\nexport * from './real.ts';\nexport * from './serial.ts';\nexport * from './smallint.ts';\nexport * from './text.ts';\nexport * from './time.ts';\nexport * from './timestamp.ts';\nexport * from './tinyint.ts';\nexport * from './varbinary.ts';\nexport * from './varchar.ts';\nexport * from './year.ts';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/singlestore-core/columns/index.ts"],"sourcesContent":["export * from './bigint.ts';\nexport * from './binary.ts';\nexport * from './boolean.ts';\nexport * from './char.ts';\nexport * from './common.ts';\nexport * from './custom.ts';\nexport * from './date.ts';\nexport * from './datetime.ts';\nexport * from './decimal.ts';\nexport * from './double.ts';\nexport * from './enum.ts';\nexport * from './float.ts';\nexport * from './int.ts';\nexport * from './json.ts';\nexport * from './mediumint.ts';\nexport * from './real.ts';\nexport * from './serial.ts';\nexport * from './smallint.ts';\nexport * from './text.ts';\nexport * from './time.ts';\nexport * from './timestamp.ts';\nexport * from './tinyint.ts';\nexport * from './varbinary.ts';\nexport * from './varchar.ts';\nexport * from './vector.ts';\nexport * from './year.ts';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var vector_exports = {};
|
|
20
|
+
__export(vector_exports, {
|
|
21
|
+
SingleStoreVector: () => SingleStoreVector,
|
|
22
|
+
SingleStoreVectorBuilder: () => SingleStoreVectorBuilder,
|
|
23
|
+
vector: () => vector
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(vector_exports);
|
|
26
|
+
var import_entity = require("../../entity.cjs");
|
|
27
|
+
var import_utils = require("../../utils.cjs");
|
|
28
|
+
var import_common = require("./common.cjs");
|
|
29
|
+
class SingleStoreVectorBuilder extends import_common.SingleStoreColumnBuilder {
|
|
30
|
+
static [import_entity.entityKind] = "SingleStoreVectorBuilder";
|
|
31
|
+
constructor(name, config) {
|
|
32
|
+
super(name, "array", "SingleStoreVector");
|
|
33
|
+
this.config.dimensions = config.dimensions;
|
|
34
|
+
this.config.elementType = config.elementType;
|
|
35
|
+
}
|
|
36
|
+
/** @internal */
|
|
37
|
+
build(table) {
|
|
38
|
+
return new SingleStoreVector(
|
|
39
|
+
table,
|
|
40
|
+
this.config
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
/** @internal */
|
|
44
|
+
generatedAlwaysAs(as, config) {
|
|
45
|
+
throw new Error("not implemented");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
class SingleStoreVector extends import_common.SingleStoreColumn {
|
|
49
|
+
static [import_entity.entityKind] = "SingleStoreVector";
|
|
50
|
+
dimensions = this.config.dimensions;
|
|
51
|
+
elementType = this.config.elementType;
|
|
52
|
+
getSQLType() {
|
|
53
|
+
return `vector(${this.dimensions}, ${this.elementType || "F32"})`;
|
|
54
|
+
}
|
|
55
|
+
mapToDriverValue(value) {
|
|
56
|
+
return JSON.stringify(value);
|
|
57
|
+
}
|
|
58
|
+
mapFromDriverValue(value) {
|
|
59
|
+
return JSON.parse(value);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function vector(a, b) {
|
|
63
|
+
const { name, config } = (0, import_utils.getColumnNameAndConfig)(a, b);
|
|
64
|
+
return new SingleStoreVectorBuilder(name, config);
|
|
65
|
+
}
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
SingleStoreVector,
|
|
69
|
+
SingleStoreVectorBuilder,
|
|
70
|
+
vector
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=vector.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/singlestore-core/columns/vector.ts"],"sourcesContent":["import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnySingleStoreTable } from '~/singlestore-core/table.ts';\nimport { SQL } from '~/sql/index.ts';\nimport { getColumnNameAndConfig } from '~/utils.ts';\nimport { SingleStoreColumn, SingleStoreColumnBuilder, SingleStoreGeneratedColumnConfig } from './common.ts';\n\nexport type SingleStoreVectorBuilderInitial<TName extends string> = SingleStoreVectorBuilder<{\n\tname: TName;\n\tdataType: 'array';\n\tcolumnType: 'SingleStoreVector';\n\tdata: Array<number>;\n\tdriverParam: string;\n\tenumValues: undefined;\n}>;\n\nexport class SingleStoreVectorBuilder<T extends ColumnBuilderBaseConfig<'array', 'SingleStoreVector'>>\n\textends SingleStoreColumnBuilder<T, SingleStoreVectorConfig>\n{\n\tstatic override readonly [entityKind]: string = 'SingleStoreVectorBuilder';\n\n\tconstructor(name: T['name'], config: SingleStoreVectorConfig) {\n\t\tsuper(name, 'array', 'SingleStoreVector');\n\t\tthis.config.dimensions = config.dimensions;\n\t\tthis.config.elementType = config.elementType;\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnySingleStoreTable<{ name: TTableName }>,\n\t): SingleStoreVector<MakeColumnConfig<T, TTableName>> {\n\t\treturn new SingleStoreVector<MakeColumnConfig<T, TTableName>>(\n\t\t\ttable,\n\t\t\tthis.config as ColumnBuilderRuntimeConfig<any, any>,\n\t\t);\n\t}\n\n\t/** @internal */\n\toverride generatedAlwaysAs(as: SQL<unknown> | (() => SQL) | T['data'], config?: SingleStoreGeneratedColumnConfig) {\n\t\tthrow new Error('not implemented');\n\t}\n}\n\nexport class SingleStoreVector<T extends ColumnBaseConfig<'array', 'SingleStoreVector'>>\n\textends SingleStoreColumn<T, SingleStoreVectorConfig>\n{\n\tstatic override readonly [entityKind]: string = 'SingleStoreVector';\n\n\tdimensions: number = this.config.dimensions;\n\telementType: ElementType | undefined = this.config.elementType;\n\n\tgetSQLType(): string {\n\t\treturn `vector(${this.dimensions}, ${this.elementType || 'F32'})`;\n\t}\n\n\toverride mapToDriverValue(value: Array<number>) {\n\t\treturn JSON.stringify(value);\n\t}\n\n\toverride mapFromDriverValue(value: string): Array<number> {\n\t\treturn JSON.parse(value);\n\t}\n}\n\ntype ElementType = 'I8' | 'I16' | 'I32' | 'I64' | 'F32' | 'F64';\n\nexport interface SingleStoreVectorConfig {\n\tdimensions: number;\n\telementType?: ElementType;\n}\n\nexport function vector(\n\tconfig: SingleStoreVectorConfig,\n): SingleStoreVectorBuilderInitial<''>;\nexport function vector<TName extends string>(\n\tname: TName,\n\tconfig: SingleStoreVectorConfig,\n): SingleStoreVectorBuilderInitial<TName>;\nexport function vector(a: string | SingleStoreVectorConfig, b?: SingleStoreVectorConfig) {\n\tconst { name, config } = getColumnNameAndConfig<SingleStoreVectorConfig>(a, b);\n\treturn new SingleStoreVectorBuilder(name, config);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA2B;AAG3B,mBAAuC;AACvC,oBAA8F;AAWvF,MAAM,iCACJ,uCACT;AAAA,EACC,QAA0B,wBAAU,IAAY;AAAA,EAEhD,YAAY,MAAiB,QAAiC;AAC7D,UAAM,MAAM,SAAS,mBAAmB;AACxC,SAAK,OAAO,aAAa,OAAO;AAChC,SAAK,OAAO,cAAc,OAAO;AAAA,EAClC;AAAA;AAAA,EAGS,MACR,OACqD;AACrD,WAAO,IAAI;AAAA,MACV;AAAA,MACA,KAAK;AAAA,IACN;AAAA,EACD;AAAA;AAAA,EAGS,kBAAkB,IAA4C,QAA2C;AACjH,UAAM,IAAI,MAAM,iBAAiB;AAAA,EAClC;AACD;AAEO,MAAM,0BACJ,gCACT;AAAA,EACC,QAA0B,wBAAU,IAAY;AAAA,EAEhD,aAAqB,KAAK,OAAO;AAAA,EACjC,cAAuC,KAAK,OAAO;AAAA,EAEnD,aAAqB;AACpB,WAAO,UAAU,KAAK,UAAU,KAAK,KAAK,eAAe,KAAK;AAAA,EAC/D;AAAA,EAES,iBAAiB,OAAsB;AAC/C,WAAO,KAAK,UAAU,KAAK;AAAA,EAC5B;AAAA,EAES,mBAAmB,OAA8B;AACzD,WAAO,KAAK,MAAM,KAAK;AAAA,EACxB;AACD;AAgBO,SAAS,OAAO,GAAqC,GAA6B;AACxF,QAAM,EAAE,MAAM,OAAO,QAAI,qCAAgD,GAAG,CAAC;AAC7E,SAAO,IAAI,yBAAyB,MAAM,MAAM;AACjD;","names":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ColumnBuilderBaseConfig } from "../../column-builder.cjs";
|
|
2
|
+
import type { ColumnBaseConfig } from "../../column.cjs";
|
|
3
|
+
import { entityKind } from "../../entity.cjs";
|
|
4
|
+
import { SingleStoreColumn, SingleStoreColumnBuilder } from "./common.cjs";
|
|
5
|
+
export type SingleStoreVectorBuilderInitial<TName extends string> = SingleStoreVectorBuilder<{
|
|
6
|
+
name: TName;
|
|
7
|
+
dataType: 'array';
|
|
8
|
+
columnType: 'SingleStoreVector';
|
|
9
|
+
data: Array<number>;
|
|
10
|
+
driverParam: string;
|
|
11
|
+
enumValues: undefined;
|
|
12
|
+
}>;
|
|
13
|
+
export declare class SingleStoreVectorBuilder<T extends ColumnBuilderBaseConfig<'array', 'SingleStoreVector'>> extends SingleStoreColumnBuilder<T, SingleStoreVectorConfig> {
|
|
14
|
+
static readonly [entityKind]: string;
|
|
15
|
+
constructor(name: T['name'], config: SingleStoreVectorConfig);
|
|
16
|
+
}
|
|
17
|
+
export declare class SingleStoreVector<T extends ColumnBaseConfig<'array', 'SingleStoreVector'>> extends SingleStoreColumn<T, SingleStoreVectorConfig> {
|
|
18
|
+
static readonly [entityKind]: string;
|
|
19
|
+
dimensions: number;
|
|
20
|
+
elementType: ElementType | undefined;
|
|
21
|
+
getSQLType(): string;
|
|
22
|
+
mapToDriverValue(value: Array<number>): string;
|
|
23
|
+
mapFromDriverValue(value: string): Array<number>;
|
|
24
|
+
}
|
|
25
|
+
type ElementType = 'I8' | 'I16' | 'I32' | 'I64' | 'F32' | 'F64';
|
|
26
|
+
export interface SingleStoreVectorConfig {
|
|
27
|
+
dimensions: number;
|
|
28
|
+
elementType?: ElementType;
|
|
29
|
+
}
|
|
30
|
+
export declare function vector(config: SingleStoreVectorConfig): SingleStoreVectorBuilderInitial<''>;
|
|
31
|
+
export declare function vector<TName extends string>(name: TName, config: SingleStoreVectorConfig): SingleStoreVectorBuilderInitial<TName>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ColumnBuilderBaseConfig } from "../../column-builder.js";
|
|
2
|
+
import type { ColumnBaseConfig } from "../../column.js";
|
|
3
|
+
import { entityKind } from "../../entity.js";
|
|
4
|
+
import { SingleStoreColumn, SingleStoreColumnBuilder } from "./common.js";
|
|
5
|
+
export type SingleStoreVectorBuilderInitial<TName extends string> = SingleStoreVectorBuilder<{
|
|
6
|
+
name: TName;
|
|
7
|
+
dataType: 'array';
|
|
8
|
+
columnType: 'SingleStoreVector';
|
|
9
|
+
data: Array<number>;
|
|
10
|
+
driverParam: string;
|
|
11
|
+
enumValues: undefined;
|
|
12
|
+
}>;
|
|
13
|
+
export declare class SingleStoreVectorBuilder<T extends ColumnBuilderBaseConfig<'array', 'SingleStoreVector'>> extends SingleStoreColumnBuilder<T, SingleStoreVectorConfig> {
|
|
14
|
+
static readonly [entityKind]: string;
|
|
15
|
+
constructor(name: T['name'], config: SingleStoreVectorConfig);
|
|
16
|
+
}
|
|
17
|
+
export declare class SingleStoreVector<T extends ColumnBaseConfig<'array', 'SingleStoreVector'>> extends SingleStoreColumn<T, SingleStoreVectorConfig> {
|
|
18
|
+
static readonly [entityKind]: string;
|
|
19
|
+
dimensions: number;
|
|
20
|
+
elementType: ElementType | undefined;
|
|
21
|
+
getSQLType(): string;
|
|
22
|
+
mapToDriverValue(value: Array<number>): string;
|
|
23
|
+
mapFromDriverValue(value: string): Array<number>;
|
|
24
|
+
}
|
|
25
|
+
type ElementType = 'I8' | 'I16' | 'I32' | 'I64' | 'F32' | 'F64';
|
|
26
|
+
export interface SingleStoreVectorConfig {
|
|
27
|
+
dimensions: number;
|
|
28
|
+
elementType?: ElementType;
|
|
29
|
+
}
|
|
30
|
+
export declare function vector(config: SingleStoreVectorConfig): SingleStoreVectorBuilderInitial<''>;
|
|
31
|
+
export declare function vector<TName extends string>(name: TName, config: SingleStoreVectorConfig): SingleStoreVectorBuilderInitial<TName>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { entityKind } from "../../entity.js";
|
|
2
|
+
import { getColumnNameAndConfig } from "../../utils.js";
|
|
3
|
+
import { SingleStoreColumn, SingleStoreColumnBuilder } from "./common.js";
|
|
4
|
+
class SingleStoreVectorBuilder extends SingleStoreColumnBuilder {
|
|
5
|
+
static [entityKind] = "SingleStoreVectorBuilder";
|
|
6
|
+
constructor(name, config) {
|
|
7
|
+
super(name, "array", "SingleStoreVector");
|
|
8
|
+
this.config.dimensions = config.dimensions;
|
|
9
|
+
this.config.elementType = config.elementType;
|
|
10
|
+
}
|
|
11
|
+
/** @internal */
|
|
12
|
+
build(table) {
|
|
13
|
+
return new SingleStoreVector(
|
|
14
|
+
table,
|
|
15
|
+
this.config
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
/** @internal */
|
|
19
|
+
generatedAlwaysAs(as, config) {
|
|
20
|
+
throw new Error("not implemented");
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
class SingleStoreVector extends SingleStoreColumn {
|
|
24
|
+
static [entityKind] = "SingleStoreVector";
|
|
25
|
+
dimensions = this.config.dimensions;
|
|
26
|
+
elementType = this.config.elementType;
|
|
27
|
+
getSQLType() {
|
|
28
|
+
return `vector(${this.dimensions}, ${this.elementType || "F32"})`;
|
|
29
|
+
}
|
|
30
|
+
mapToDriverValue(value) {
|
|
31
|
+
return JSON.stringify(value);
|
|
32
|
+
}
|
|
33
|
+
mapFromDriverValue(value) {
|
|
34
|
+
return JSON.parse(value);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function vector(a, b) {
|
|
38
|
+
const { name, config } = getColumnNameAndConfig(a, b);
|
|
39
|
+
return new SingleStoreVectorBuilder(name, config);
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
SingleStoreVector,
|
|
43
|
+
SingleStoreVectorBuilder,
|
|
44
|
+
vector
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=vector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/singlestore-core/columns/vector.ts"],"sourcesContent":["import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnySingleStoreTable } from '~/singlestore-core/table.ts';\nimport { SQL } from '~/sql/index.ts';\nimport { getColumnNameAndConfig } from '~/utils.ts';\nimport { SingleStoreColumn, SingleStoreColumnBuilder, SingleStoreGeneratedColumnConfig } from './common.ts';\n\nexport type SingleStoreVectorBuilderInitial<TName extends string> = SingleStoreVectorBuilder<{\n\tname: TName;\n\tdataType: 'array';\n\tcolumnType: 'SingleStoreVector';\n\tdata: Array<number>;\n\tdriverParam: string;\n\tenumValues: undefined;\n}>;\n\nexport class SingleStoreVectorBuilder<T extends ColumnBuilderBaseConfig<'array', 'SingleStoreVector'>>\n\textends SingleStoreColumnBuilder<T, SingleStoreVectorConfig>\n{\n\tstatic override readonly [entityKind]: string = 'SingleStoreVectorBuilder';\n\n\tconstructor(name: T['name'], config: SingleStoreVectorConfig) {\n\t\tsuper(name, 'array', 'SingleStoreVector');\n\t\tthis.config.dimensions = config.dimensions;\n\t\tthis.config.elementType = config.elementType;\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnySingleStoreTable<{ name: TTableName }>,\n\t): SingleStoreVector<MakeColumnConfig<T, TTableName>> {\n\t\treturn new SingleStoreVector<MakeColumnConfig<T, TTableName>>(\n\t\t\ttable,\n\t\t\tthis.config as ColumnBuilderRuntimeConfig<any, any>,\n\t\t);\n\t}\n\n\t/** @internal */\n\toverride generatedAlwaysAs(as: SQL<unknown> | (() => SQL) | T['data'], config?: SingleStoreGeneratedColumnConfig) {\n\t\tthrow new Error('not implemented');\n\t}\n}\n\nexport class SingleStoreVector<T extends ColumnBaseConfig<'array', 'SingleStoreVector'>>\n\textends SingleStoreColumn<T, SingleStoreVectorConfig>\n{\n\tstatic override readonly [entityKind]: string = 'SingleStoreVector';\n\n\tdimensions: number = this.config.dimensions;\n\telementType: ElementType | undefined = this.config.elementType;\n\n\tgetSQLType(): string {\n\t\treturn `vector(${this.dimensions}, ${this.elementType || 'F32'})`;\n\t}\n\n\toverride mapToDriverValue(value: Array<number>) {\n\t\treturn JSON.stringify(value);\n\t}\n\n\toverride mapFromDriverValue(value: string): Array<number> {\n\t\treturn JSON.parse(value);\n\t}\n}\n\ntype ElementType = 'I8' | 'I16' | 'I32' | 'I64' | 'F32' | 'F64';\n\nexport interface SingleStoreVectorConfig {\n\tdimensions: number;\n\telementType?: ElementType;\n}\n\nexport function vector(\n\tconfig: SingleStoreVectorConfig,\n): SingleStoreVectorBuilderInitial<''>;\nexport function vector<TName extends string>(\n\tname: TName,\n\tconfig: SingleStoreVectorConfig,\n): SingleStoreVectorBuilderInitial<TName>;\nexport function vector(a: string | SingleStoreVectorConfig, b?: SingleStoreVectorConfig) {\n\tconst { name, config } = getColumnNameAndConfig<SingleStoreVectorConfig>(a, b);\n\treturn new SingleStoreVectorBuilder(name, config);\n}\n"],"mappings":"AAEA,SAAS,kBAAkB;AAG3B,SAAS,8BAA8B;AACvC,SAAS,mBAAmB,gCAAkE;AAWvF,MAAM,iCACJ,yBACT;AAAA,EACC,QAA0B,UAAU,IAAY;AAAA,EAEhD,YAAY,MAAiB,QAAiC;AAC7D,UAAM,MAAM,SAAS,mBAAmB;AACxC,SAAK,OAAO,aAAa,OAAO;AAChC,SAAK,OAAO,cAAc,OAAO;AAAA,EAClC;AAAA;AAAA,EAGS,MACR,OACqD;AACrD,WAAO,IAAI;AAAA,MACV;AAAA,MACA,KAAK;AAAA,IACN;AAAA,EACD;AAAA;AAAA,EAGS,kBAAkB,IAA4C,QAA2C;AACjH,UAAM,IAAI,MAAM,iBAAiB;AAAA,EAClC;AACD;AAEO,MAAM,0BACJ,kBACT;AAAA,EACC,QAA0B,UAAU,IAAY;AAAA,EAEhD,aAAqB,KAAK,OAAO;AAAA,EACjC,cAAuC,KAAK,OAAO;AAAA,EAEnD,aAAqB;AACpB,WAAO,UAAU,KAAK,UAAU,KAAK,KAAK,eAAe,KAAK;AAAA,EAC/D;AAAA,EAES,iBAAiB,OAAsB;AAC/C,WAAO,KAAK,UAAU,KAAK;AAAA,EAC5B;AAAA,EAES,mBAAmB,OAA8B;AACzD,WAAO,KAAK,MAAM,KAAK;AAAA,EACxB;AACD;AAgBO,SAAS,OAAO,GAAqC,GAA6B;AACxF,QAAM,EAAE,MAAM,OAAO,IAAI,uBAAgD,GAAG,CAAC;AAC7E,SAAO,IAAI,yBAAyB,MAAM,MAAM;AACjD;","names":[]}
|
|
@@ -20,6 +20,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
var expressions_exports = {};
|
|
21
21
|
__export(expressions_exports, {
|
|
22
22
|
concat: () => concat,
|
|
23
|
+
dotProduct: () => dotProduct,
|
|
24
|
+
euclideanDistance: () => euclideanDistance,
|
|
23
25
|
substring: () => substring
|
|
24
26
|
});
|
|
25
27
|
module.exports = __toCommonJS(expressions_exports);
|
|
@@ -40,9 +42,17 @@ function substring(column, { from, for: _for }) {
|
|
|
40
42
|
chunks.push(import_sql.sql`)`);
|
|
41
43
|
return import_sql.sql.join(chunks);
|
|
42
44
|
}
|
|
45
|
+
function dotProduct(column, value) {
|
|
46
|
+
return import_sql.sql`${column} <*> ${JSON.stringify(value)}`;
|
|
47
|
+
}
|
|
48
|
+
function euclideanDistance(column, value) {
|
|
49
|
+
return import_sql.sql`${column} <-> ${JSON.stringify(value)}`;
|
|
50
|
+
}
|
|
43
51
|
// Annotate the CommonJS export names for ESM import in node:
|
|
44
52
|
0 && (module.exports = {
|
|
45
53
|
concat,
|
|
54
|
+
dotProduct,
|
|
55
|
+
euclideanDistance,
|
|
46
56
|
substring,
|
|
47
57
|
...require("../expressions.cjs")
|
|
48
58
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/singlestore-core/expressions.ts"],"sourcesContent":["import { bindIfParam } from '~/expressions.ts';\nimport type { Placeholder, SQL, SQLChunk, SQLWrapper } from '~/sql/sql.ts';\nimport { sql } from '~/sql/sql.ts';\nimport type { SingleStoreColumn } from './columns/index.ts';\n\nexport * from '~/expressions.ts';\n\nexport function concat(column: SingleStoreColumn | SQL.Aliased, value: string | Placeholder | SQLWrapper): SQL {\n\treturn sql`${column} || ${bindIfParam(value, column)}`;\n}\n\nexport function substring(\n\tcolumn: SingleStoreColumn | SQL.Aliased,\n\t{ from, for: _for }: { from?: number | Placeholder | SQLWrapper; for?: number | Placeholder | SQLWrapper },\n): SQL {\n\tconst chunks: SQLChunk[] = [sql`substring(`, column];\n\tif (from !== undefined) {\n\t\tchunks.push(sql` from `, bindIfParam(from, column));\n\t}\n\tif (_for !== undefined) {\n\t\tchunks.push(sql` for `, bindIfParam(_for, column));\n\t}\n\tchunks.push(sql`)`);\n\treturn sql.join(chunks);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;AAE5B,iBAAoB;AAGpB,gCAAc,6BALd;AAOO,SAAS,OAAO,QAAyC,OAA+C;AAC9G,SAAO,iBAAM,MAAM,WAAO,gCAAY,OAAO,MAAM,CAAC;AACrD;AAEO,SAAS,UACf,QACA,EAAE,MAAM,KAAK,KAAK,GACZ;AACN,QAAM,SAAqB,CAAC,4BAAiB,MAAM;AACnD,MAAI,SAAS,QAAW;AACvB,WAAO,KAAK,4BAAa,gCAAY,MAAM,MAAM,CAAC;AAAA,EACnD;AACA,MAAI,SAAS,QAAW;AACvB,WAAO,KAAK,2BAAY,gCAAY,MAAM,MAAM,CAAC;AAAA,EAClD;AACA,SAAO,KAAK,iBAAM;AAClB,SAAO,eAAI,KAAK,MAAM;AACvB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/singlestore-core/expressions.ts"],"sourcesContent":["import { bindIfParam } from '~/expressions.ts';\nimport type { Placeholder, SQL, SQLChunk, SQLWrapper } from '~/sql/sql.ts';\nimport { sql } from '~/sql/sql.ts';\nimport type { SingleStoreColumn } from './columns/index.ts';\n\nexport * from '~/expressions.ts';\n\nexport function concat(column: SingleStoreColumn | SQL.Aliased, value: string | Placeholder | SQLWrapper): SQL {\n\treturn sql`${column} || ${bindIfParam(value, column)}`;\n}\n\nexport function substring(\n\tcolumn: SingleStoreColumn | SQL.Aliased,\n\t{ from, for: _for }: { from?: number | Placeholder | SQLWrapper; for?: number | Placeholder | SQLWrapper },\n): SQL {\n\tconst chunks: SQLChunk[] = [sql`substring(`, column];\n\tif (from !== undefined) {\n\t\tchunks.push(sql` from `, bindIfParam(from, column));\n\t}\n\tif (_for !== undefined) {\n\t\tchunks.push(sql` for `, bindIfParam(_for, column));\n\t}\n\tchunks.push(sql`)`);\n\treturn sql.join(chunks);\n}\n\n// Vectors\nexport function dotProduct(column: SingleStoreColumn | SQL.Aliased, value: Array<number>): SQL {\n\treturn sql`${column} <*> ${JSON.stringify(value)}`;\n}\n\nexport function euclideanDistance(column: SingleStoreColumn | SQL.Aliased, value: Array<number>): SQL {\n\treturn sql`${column} <-> ${JSON.stringify(value)}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;AAE5B,iBAAoB;AAGpB,gCAAc,6BALd;AAOO,SAAS,OAAO,QAAyC,OAA+C;AAC9G,SAAO,iBAAM,MAAM,WAAO,gCAAY,OAAO,MAAM,CAAC;AACrD;AAEO,SAAS,UACf,QACA,EAAE,MAAM,KAAK,KAAK,GACZ;AACN,QAAM,SAAqB,CAAC,4BAAiB,MAAM;AACnD,MAAI,SAAS,QAAW;AACvB,WAAO,KAAK,4BAAa,gCAAY,MAAM,MAAM,CAAC;AAAA,EACnD;AACA,MAAI,SAAS,QAAW;AACvB,WAAO,KAAK,2BAAY,gCAAY,MAAM,MAAM,CAAC;AAAA,EAClD;AACA,SAAO,KAAK,iBAAM;AAClB,SAAO,eAAI,KAAK,MAAM;AACvB;AAGO,SAAS,WAAW,QAAyC,OAA2B;AAC9F,SAAO,iBAAM,MAAM,QAAQ,KAAK,UAAU,KAAK,CAAC;AACjD;AAEO,SAAS,kBAAkB,QAAyC,OAA2B;AACrG,SAAO,iBAAM,MAAM,QAAQ,KAAK,UAAU,KAAK,CAAC;AACjD;","names":[]}
|
|
@@ -6,3 +6,5 @@ export declare function substring(column: SingleStoreColumn | SQL.Aliased, { fro
|
|
|
6
6
|
from?: number | Placeholder | SQLWrapper;
|
|
7
7
|
for?: number | Placeholder | SQLWrapper;
|
|
8
8
|
}): SQL;
|
|
9
|
+
export declare function dotProduct(column: SingleStoreColumn | SQL.Aliased, value: Array<number>): SQL;
|
|
10
|
+
export declare function euclideanDistance(column: SingleStoreColumn | SQL.Aliased, value: Array<number>): SQL;
|
|
@@ -6,3 +6,5 @@ export declare function substring(column: SingleStoreColumn | SQL.Aliased, { fro
|
|
|
6
6
|
from?: number | Placeholder | SQLWrapper;
|
|
7
7
|
for?: number | Placeholder | SQLWrapper;
|
|
8
8
|
}): SQL;
|
|
9
|
+
export declare function dotProduct(column: SingleStoreColumn | SQL.Aliased, value: Array<number>): SQL;
|
|
10
|
+
export declare function euclideanDistance(column: SingleStoreColumn | SQL.Aliased, value: Array<number>): SQL;
|
|
@@ -15,8 +15,16 @@ function substring(column, { from, for: _for }) {
|
|
|
15
15
|
chunks.push(sql`)`);
|
|
16
16
|
return sql.join(chunks);
|
|
17
17
|
}
|
|
18
|
+
function dotProduct(column, value) {
|
|
19
|
+
return sql`${column} <*> ${JSON.stringify(value)}`;
|
|
20
|
+
}
|
|
21
|
+
function euclideanDistance(column, value) {
|
|
22
|
+
return sql`${column} <-> ${JSON.stringify(value)}`;
|
|
23
|
+
}
|
|
18
24
|
export {
|
|
19
25
|
concat,
|
|
26
|
+
dotProduct,
|
|
27
|
+
euclideanDistance,
|
|
20
28
|
substring
|
|
21
29
|
};
|
|
22
30
|
//# sourceMappingURL=expressions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/singlestore-core/expressions.ts"],"sourcesContent":["import { bindIfParam } from '~/expressions.ts';\nimport type { Placeholder, SQL, SQLChunk, SQLWrapper } from '~/sql/sql.ts';\nimport { sql } from '~/sql/sql.ts';\nimport type { SingleStoreColumn } from './columns/index.ts';\n\nexport * from '~/expressions.ts';\n\nexport function concat(column: SingleStoreColumn | SQL.Aliased, value: string | Placeholder | SQLWrapper): SQL {\n\treturn sql`${column} || ${bindIfParam(value, column)}`;\n}\n\nexport function substring(\n\tcolumn: SingleStoreColumn | SQL.Aliased,\n\t{ from, for: _for }: { from?: number | Placeholder | SQLWrapper; for?: number | Placeholder | SQLWrapper },\n): SQL {\n\tconst chunks: SQLChunk[] = [sql`substring(`, column];\n\tif (from !== undefined) {\n\t\tchunks.push(sql` from `, bindIfParam(from, column));\n\t}\n\tif (_for !== undefined) {\n\t\tchunks.push(sql` for `, bindIfParam(_for, column));\n\t}\n\tchunks.push(sql`)`);\n\treturn sql.join(chunks);\n}\n"],"mappings":"AAAA,SAAS,mBAAmB;AAE5B,SAAS,WAAW;AAGpB,cAAc;AAEP,SAAS,OAAO,QAAyC,OAA+C;AAC9G,SAAO,MAAM,MAAM,OAAO,YAAY,OAAO,MAAM,CAAC;AACrD;AAEO,SAAS,UACf,QACA,EAAE,MAAM,KAAK,KAAK,GACZ;AACN,QAAM,SAAqB,CAAC,iBAAiB,MAAM;AACnD,MAAI,SAAS,QAAW;AACvB,WAAO,KAAK,aAAa,YAAY,MAAM,MAAM,CAAC;AAAA,EACnD;AACA,MAAI,SAAS,QAAW;AACvB,WAAO,KAAK,YAAY,YAAY,MAAM,MAAM,CAAC;AAAA,EAClD;AACA,SAAO,KAAK,MAAM;AAClB,SAAO,IAAI,KAAK,MAAM;AACvB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/singlestore-core/expressions.ts"],"sourcesContent":["import { bindIfParam } from '~/expressions.ts';\nimport type { Placeholder, SQL, SQLChunk, SQLWrapper } from '~/sql/sql.ts';\nimport { sql } from '~/sql/sql.ts';\nimport type { SingleStoreColumn } from './columns/index.ts';\n\nexport * from '~/expressions.ts';\n\nexport function concat(column: SingleStoreColumn | SQL.Aliased, value: string | Placeholder | SQLWrapper): SQL {\n\treturn sql`${column} || ${bindIfParam(value, column)}`;\n}\n\nexport function substring(\n\tcolumn: SingleStoreColumn | SQL.Aliased,\n\t{ from, for: _for }: { from?: number | Placeholder | SQLWrapper; for?: number | Placeholder | SQLWrapper },\n): SQL {\n\tconst chunks: SQLChunk[] = [sql`substring(`, column];\n\tif (from !== undefined) {\n\t\tchunks.push(sql` from `, bindIfParam(from, column));\n\t}\n\tif (_for !== undefined) {\n\t\tchunks.push(sql` for `, bindIfParam(_for, column));\n\t}\n\tchunks.push(sql`)`);\n\treturn sql.join(chunks);\n}\n\n// Vectors\nexport function dotProduct(column: SingleStoreColumn | SQL.Aliased, value: Array<number>): SQL {\n\treturn sql`${column} <*> ${JSON.stringify(value)}`;\n}\n\nexport function euclideanDistance(column: SingleStoreColumn | SQL.Aliased, value: Array<number>): SQL {\n\treturn sql`${column} <-> ${JSON.stringify(value)}`;\n}\n"],"mappings":"AAAA,SAAS,mBAAmB;AAE5B,SAAS,WAAW;AAGpB,cAAc;AAEP,SAAS,OAAO,QAAyC,OAA+C;AAC9G,SAAO,MAAM,MAAM,OAAO,YAAY,OAAO,MAAM,CAAC;AACrD;AAEO,SAAS,UACf,QACA,EAAE,MAAM,KAAK,KAAK,GACZ;AACN,QAAM,SAAqB,CAAC,iBAAiB,MAAM;AACnD,MAAI,SAAS,QAAW;AACvB,WAAO,KAAK,aAAa,YAAY,MAAM,MAAM,CAAC;AAAA,EACnD;AACA,MAAI,SAAS,QAAW;AACvB,WAAO,KAAK,YAAY,YAAY,MAAM,MAAM,CAAC;AAAA,EAClD;AACA,SAAO,KAAK,MAAM;AAClB,SAAO,IAAI,KAAK,MAAM;AACvB;AAGO,SAAS,WAAW,QAAyC,OAA2B;AAC9F,SAAO,MAAM,MAAM,QAAQ,KAAK,UAAU,KAAK,CAAC;AACjD;AAEO,SAAS,kBAAkB,QAAyC,OAA2B;AACrG,SAAO,MAAM,MAAM,QAAQ,KAAK,UAAU,KAAK,CAAC;AACjD;","names":[]}
|
package/version.cjs
CHANGED
package/version.d.cts
CHANGED
package/version.d.ts
CHANGED
package/version.js
CHANGED