@haybarn/node-api 1.5.5-rc1 → 2.0.0-rc3

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.
Files changed (285) hide show
  1. package/README.md +315 -20
  2. package/lib/DuckDBAppender.d.ts +8 -2
  3. package/lib/DuckDBAppender.js +19 -1
  4. package/lib/DuckDBConnection.d.ts +2 -0
  5. package/lib/DuckDBConnection.js +4 -1
  6. package/lib/DuckDBDataChunk.d.ts +30 -0
  7. package/lib/DuckDBDataChunk.js +94 -1
  8. package/lib/DuckDBDataChunkWriter.d.ts +74 -0
  9. package/lib/DuckDBDataChunkWriter.js +109 -0
  10. package/lib/DuckDBLogicalType.d.ts +5 -1
  11. package/lib/DuckDBLogicalType.js +18 -1
  12. package/lib/DuckDBMaterializedResult.d.ts +8 -1
  13. package/lib/DuckDBMaterializedResult.js +22 -2
  14. package/lib/DuckDBPendingResult.d.ts +16 -1
  15. package/lib/DuckDBPendingResult.js +19 -2
  16. package/lib/DuckDBPreparedStatement.d.ts +4 -1
  17. package/lib/DuckDBPreparedStatement.js +17 -4
  18. package/lib/DuckDBResult.d.ts +21 -1
  19. package/lib/DuckDBResult.js +87 -5
  20. package/lib/DuckDBResultReader.d.ts +5 -0
  21. package/lib/DuckDBResultReader.js +9 -2
  22. package/lib/DuckDBScalarFunction.d.ts +9 -5
  23. package/lib/DuckDBScalarFunction.js +14 -5
  24. package/lib/DuckDBScalarFunctionBindInfo.d.ts +16 -0
  25. package/lib/{DuckDBBindInfo.js → DuckDBScalarFunctionBindInfo.js} +5 -3
  26. package/lib/DuckDBScalarFunctionInfo.d.ts +16 -0
  27. package/lib/{DuckDBFunctionInfo.js → DuckDBScalarFunctionInfo.js} +11 -3
  28. package/lib/{DuckDBBindInfo.d.ts → DuckDBScalarFunctionInitInfo.d.ts} +6 -4
  29. package/lib/DuckDBScalarFunctionInitInfo.js +39 -0
  30. package/lib/DuckDBTableFunction.d.ts +41 -0
  31. package/lib/DuckDBTableFunction.js +83 -0
  32. package/lib/DuckDBTableFunctionBindInfo.d.ts +21 -0
  33. package/lib/DuckDBTableFunctionBindInfo.js +54 -0
  34. package/lib/DuckDBTableFunctionInfo.d.ts +15 -0
  35. package/lib/DuckDBTableFunctionInfo.js +42 -0
  36. package/lib/DuckDBTableFunctionInitInfo.d.ts +22 -0
  37. package/lib/DuckDBTableFunctionInitInfo.js +58 -0
  38. package/lib/DuckDBType.d.ts +1 -373
  39. package/lib/DuckDBType.js +14 -927
  40. package/lib/DuckDBTypeId.d.ts +4 -1
  41. package/lib/DuckDBTypeId.js +3 -0
  42. package/lib/DuckDBValueConverter.d.ts +10 -0
  43. package/lib/DuckDBValueConverters.d.ts +27 -0
  44. package/lib/DuckDBValueConverters.js +128 -1
  45. package/lib/DuckDBVector.d.ts +1 -596
  46. package/lib/DuckDBVector.js +14 -2522
  47. package/lib/JSDuckDBValueConverter.d.ts +1 -2
  48. package/lib/JSDuckDBValueConverter.js +5 -2
  49. package/lib/JSInputTypeForTypeId.d.ts +104 -0
  50. package/lib/JSInputTypeForTypeId.js +3 -0
  51. package/lib/JSToDuckDBValueConverter.d.ts +30 -0
  52. package/lib/JSToDuckDBValueConverter.js +83 -0
  53. package/lib/JSTypeForTypeId.d.ts +91 -0
  54. package/lib/JSTypeForTypeId.js +3 -0
  55. package/lib/JsonDuckDBValueConverter.d.ts +1 -2
  56. package/lib/JsonDuckDBValueConverter.js +4 -1
  57. package/lib/JsonTypeForTypeId.d.ts +96 -0
  58. package/lib/JsonTypeForTypeId.js +3 -0
  59. package/lib/ToDuckDBValueConverter.d.ts +41 -0
  60. package/lib/ToDuckDBValueConverter.js +27 -0
  61. package/lib/ToDuckDBValueConverters.d.ts +54 -0
  62. package/lib/ToDuckDBValueConverters.js +199 -0
  63. package/lib/conversion/dateTimeStringConversion.d.ts +2 -2
  64. package/lib/conversion/dateTimeStringConversion.js +20 -7
  65. package/lib/conversion/varintDecode.d.ts +18 -0
  66. package/lib/conversion/varintDecode.js +42 -0
  67. package/lib/convertColumnsFromChunks.d.ts +1 -1
  68. package/lib/convertColumnsFromChunks.js +2 -2
  69. package/lib/createResult.d.ts +2 -1
  70. package/lib/createResult.js +3 -3
  71. package/lib/createValue.js +63 -5
  72. package/lib/duckdb.d.ts +15 -2
  73. package/lib/duckdb.js +15 -2
  74. package/lib/getColumnsFromChunks.d.ts +1 -1
  75. package/lib/getColumnsFromChunks.js +2 -2
  76. package/lib/getColumnsObjectFromChunks.js +3 -0
  77. package/lib/readValue.d.ts +22 -0
  78. package/lib/readValue.js +35 -0
  79. package/lib/typeForValue.js +21 -2
  80. package/lib/types/BaseDuckDBType.d.ts +11 -0
  81. package/lib/types/BaseDuckDBType.js +34 -0
  82. package/lib/types/DuckDBAnyType.d.ts +8 -0
  83. package/lib/types/DuckDBAnyType.js +16 -0
  84. package/lib/types/DuckDBArrayType.d.ts +14 -0
  85. package/lib/types/DuckDBArrayType.js +38 -0
  86. package/lib/types/DuckDBBigIntType.d.ts +12 -0
  87. package/lib/types/DuckDBBigIntType.js +24 -0
  88. package/lib/types/DuckDBBigNumType.d.ts +12 -0
  89. package/lib/types/DuckDBBigNumType.js +24 -0
  90. package/lib/types/DuckDBBitType.d.ts +8 -0
  91. package/lib/types/DuckDBBitType.js +16 -0
  92. package/lib/types/DuckDBBlobType.d.ts +8 -0
  93. package/lib/types/DuckDBBlobType.js +16 -0
  94. package/lib/types/DuckDBBooleanType.d.ts +8 -0
  95. package/lib/types/DuckDBBooleanType.js +16 -0
  96. package/lib/types/DuckDBDateType.d.ts +14 -0
  97. package/lib/types/DuckDBDateType.js +32 -0
  98. package/lib/types/DuckDBDecimalType.d.ts +14 -0
  99. package/lib/types/DuckDBDecimalType.js +45 -0
  100. package/lib/types/DuckDBDoubleType.d.ts +12 -0
  101. package/lib/types/DuckDBDoubleType.js +24 -0
  102. package/lib/types/DuckDBEnumType.d.ts +29 -0
  103. package/lib/types/DuckDBEnumType.js +100 -0
  104. package/lib/types/DuckDBFloatType.d.ts +12 -0
  105. package/lib/types/DuckDBFloatType.js +24 -0
  106. package/lib/types/DuckDBGeometryType.d.ts +19 -0
  107. package/lib/types/DuckDBGeometryType.js +38 -0
  108. package/lib/types/DuckDBHugeIntType.d.ts +12 -0
  109. package/lib/types/DuckDBHugeIntType.js +24 -0
  110. package/lib/types/DuckDBIntegerLiteralType.d.ts +8 -0
  111. package/lib/types/DuckDBIntegerLiteralType.js +16 -0
  112. package/lib/types/DuckDBIntegerType.d.ts +12 -0
  113. package/lib/types/DuckDBIntegerType.js +24 -0
  114. package/lib/types/DuckDBIntervalType.d.ts +8 -0
  115. package/lib/types/DuckDBIntervalType.js +16 -0
  116. package/lib/types/DuckDBListType.d.ts +13 -0
  117. package/lib/types/DuckDBListType.js +35 -0
  118. package/lib/types/DuckDBMapType.d.ts +14 -0
  119. package/lib/types/DuckDBMapType.js +38 -0
  120. package/lib/types/DuckDBSQLNullType.d.ts +10 -0
  121. package/lib/types/DuckDBSQLNullType.js +20 -0
  122. package/lib/types/DuckDBSmallIntType.d.ts +12 -0
  123. package/lib/types/DuckDBSmallIntType.js +24 -0
  124. package/lib/types/DuckDBStringLiteralType.d.ts +8 -0
  125. package/lib/types/DuckDBStringLiteralType.js +16 -0
  126. package/lib/types/DuckDBStructType.d.ts +29 -0
  127. package/lib/types/DuckDBStructType.js +86 -0
  128. package/lib/types/DuckDBTimeNSType.d.ts +11 -0
  129. package/lib/types/DuckDBTimeNSType.js +23 -0
  130. package/lib/types/DuckDBTimeTZType.d.ts +12 -0
  131. package/lib/types/DuckDBTimeTZType.js +26 -0
  132. package/lib/types/DuckDBTimeType.d.ts +11 -0
  133. package/lib/types/DuckDBTimeType.js +23 -0
  134. package/lib/types/DuckDBTimestampMillisecondsType.d.ts +14 -0
  135. package/lib/types/DuckDBTimestampMillisecondsType.js +32 -0
  136. package/lib/types/DuckDBTimestampNanosecondsType.d.ts +14 -0
  137. package/lib/types/DuckDBTimestampNanosecondsType.js +32 -0
  138. package/lib/types/DuckDBTimestampSecondsType.d.ts +14 -0
  139. package/lib/types/DuckDBTimestampSecondsType.js +32 -0
  140. package/lib/types/DuckDBTimestampTZNanosecondsType.d.ts +15 -0
  141. package/lib/types/DuckDBTimestampTZNanosecondsType.js +35 -0
  142. package/lib/types/DuckDBTimestampTZType.d.ts +15 -0
  143. package/lib/types/DuckDBTimestampTZType.js +35 -0
  144. package/lib/types/DuckDBTimestampType.d.ts +16 -0
  145. package/lib/types/DuckDBTimestampType.js +33 -0
  146. package/lib/types/DuckDBTinyIntType.d.ts +12 -0
  147. package/lib/types/DuckDBTinyIntType.js +24 -0
  148. package/lib/types/DuckDBType.d.ts +43 -0
  149. package/lib/types/DuckDBType.js +2 -0
  150. package/lib/types/DuckDBUBigIntType.d.ts +12 -0
  151. package/lib/types/DuckDBUBigIntType.js +24 -0
  152. package/lib/types/DuckDBUHugeIntType.d.ts +12 -0
  153. package/lib/types/DuckDBUHugeIntType.js +24 -0
  154. package/lib/types/DuckDBUIntegerType.d.ts +12 -0
  155. package/lib/types/DuckDBUIntegerType.js +24 -0
  156. package/lib/types/DuckDBUSmallIntType.d.ts +12 -0
  157. package/lib/types/DuckDBUSmallIntType.js +24 -0
  158. package/lib/types/DuckDBUTinyIntType.d.ts +12 -0
  159. package/lib/types/DuckDBUTinyIntType.js +24 -0
  160. package/lib/types/DuckDBUUIDType.d.ts +11 -0
  161. package/lib/types/DuckDBUUIDType.js +23 -0
  162. package/lib/types/DuckDBUnionType.d.ts +18 -0
  163. package/lib/types/DuckDBUnionType.js +64 -0
  164. package/lib/types/DuckDBVarCharType.d.ts +8 -0
  165. package/lib/types/DuckDBVarCharType.js +16 -0
  166. package/lib/types/DuckDBVariantType.d.ts +8 -0
  167. package/lib/types/DuckDBVariantType.js +16 -0
  168. package/lib/types/index.d.ts +44 -0
  169. package/lib/types/index.js +60 -0
  170. package/lib/values/DuckDBGeometryValue.d.ts +12 -0
  171. package/lib/values/DuckDBGeometryValue.js +30 -0
  172. package/lib/values/DuckDBTimestampTZNanosecondsValue.d.ts +14 -0
  173. package/lib/values/DuckDBTimestampTZNanosecondsValue.js +33 -0
  174. package/lib/values/DuckDBTupleValue.d.ts +11 -0
  175. package/lib/values/DuckDBTupleValue.js +22 -0
  176. package/lib/values/DuckDBUUIDValue.js +5 -1
  177. package/lib/values/DuckDBValue.d.ts +5 -1
  178. package/lib/values/DuckDBVariantValue.d.ts +19 -0
  179. package/lib/values/DuckDBVariantValue.js +30 -0
  180. package/lib/values/index.d.ts +4 -0
  181. package/lib/values/index.js +4 -0
  182. package/lib/vectors/DuckDBArrayVector.d.ts +21 -0
  183. package/lib/vectors/DuckDBArrayVector.js +79 -0
  184. package/lib/vectors/DuckDBBigIntVector.d.ts +17 -0
  185. package/lib/vectors/DuckDBBigIntVector.js +58 -0
  186. package/lib/vectors/DuckDBBigNumVector.d.ts +21 -0
  187. package/lib/vectors/DuckDBBigNumVector.js +70 -0
  188. package/lib/vectors/DuckDBBitVector.d.ts +22 -0
  189. package/lib/vectors/DuckDBBitVector.js +74 -0
  190. package/lib/vectors/DuckDBBlobVector.d.ts +32 -0
  191. package/lib/vectors/DuckDBBlobVector.js +83 -0
  192. package/lib/vectors/DuckDBBooleanVector.d.ts +18 -0
  193. package/lib/vectors/DuckDBBooleanVector.js +58 -0
  194. package/lib/vectors/DuckDBDateVector.d.ts +18 -0
  195. package/lib/vectors/DuckDBDateVector.js +64 -0
  196. package/lib/vectors/DuckDBDecimal128Vector.d.ts +21 -0
  197. package/lib/vectors/DuckDBDecimal128Vector.js +64 -0
  198. package/lib/vectors/DuckDBDecimal16Vector.d.ts +21 -0
  199. package/lib/vectors/DuckDBDecimal16Vector.js +64 -0
  200. package/lib/vectors/DuckDBDecimal32Vector.d.ts +21 -0
  201. package/lib/vectors/DuckDBDecimal32Vector.js +64 -0
  202. package/lib/vectors/DuckDBDecimal64Vector.d.ts +21 -0
  203. package/lib/vectors/DuckDBDecimal64Vector.js +64 -0
  204. package/lib/vectors/DuckDBDoubleVector.d.ts +17 -0
  205. package/lib/vectors/DuckDBDoubleVector.js +54 -0
  206. package/lib/vectors/DuckDBEnum16Vector.d.ts +18 -0
  207. package/lib/vectors/DuckDBEnum16Vector.js +57 -0
  208. package/lib/vectors/DuckDBEnum32Vector.d.ts +18 -0
  209. package/lib/vectors/DuckDBEnum32Vector.js +57 -0
  210. package/lib/vectors/DuckDBEnum8Vector.d.ts +18 -0
  211. package/lib/vectors/DuckDBEnum8Vector.js +57 -0
  212. package/lib/vectors/DuckDBFloatVector.d.ts +17 -0
  213. package/lib/vectors/DuckDBFloatVector.js +54 -0
  214. package/lib/vectors/DuckDBGeometryVector.d.ts +22 -0
  215. package/lib/vectors/DuckDBGeometryVector.js +69 -0
  216. package/lib/vectors/DuckDBHugeIntVector.d.ts +19 -0
  217. package/lib/vectors/DuckDBHugeIntVector.js +63 -0
  218. package/lib/vectors/DuckDBIntegerVector.d.ts +17 -0
  219. package/lib/vectors/DuckDBIntegerVector.js +61 -0
  220. package/lib/vectors/DuckDBIntervalVector.d.ts +19 -0
  221. package/lib/vectors/DuckDBIntervalVector.js +67 -0
  222. package/lib/vectors/DuckDBListVector.d.ts +35 -0
  223. package/lib/vectors/DuckDBListVector.js +151 -0
  224. package/lib/vectors/DuckDBMapVector.d.ts +17 -0
  225. package/lib/vectors/DuckDBMapVector.js +60 -0
  226. package/lib/vectors/DuckDBSQLNullVector.d.ts +18 -0
  227. package/lib/vectors/DuckDBSQLNullVector.js +44 -0
  228. package/lib/vectors/DuckDBSmallIntVector.d.ts +17 -0
  229. package/lib/vectors/DuckDBSmallIntVector.js +61 -0
  230. package/lib/vectors/DuckDBStructVector.d.ts +35 -0
  231. package/lib/vectors/DuckDBStructVector.js +105 -0
  232. package/lib/vectors/DuckDBTimeNSVector.d.ts +18 -0
  233. package/lib/vectors/DuckDBTimeNSVector.js +61 -0
  234. package/lib/vectors/DuckDBTimeTZVector.d.ts +18 -0
  235. package/lib/vectors/DuckDBTimeTZVector.js +61 -0
  236. package/lib/vectors/DuckDBTimeVector.d.ts +18 -0
  237. package/lib/vectors/DuckDBTimeVector.js +61 -0
  238. package/lib/vectors/DuckDBTimestampMillisecondsVector.d.ts +18 -0
  239. package/lib/vectors/DuckDBTimestampMillisecondsVector.js +61 -0
  240. package/lib/vectors/DuckDBTimestampNanosecondsVector.d.ts +18 -0
  241. package/lib/vectors/DuckDBTimestampNanosecondsVector.js +61 -0
  242. package/lib/vectors/DuckDBTimestampSecondsVector.d.ts +18 -0
  243. package/lib/vectors/DuckDBTimestampSecondsVector.js +61 -0
  244. package/lib/vectors/DuckDBTimestampTZNanosecondsVector.d.ts +18 -0
  245. package/lib/vectors/DuckDBTimestampTZNanosecondsVector.js +61 -0
  246. package/lib/vectors/DuckDBTimestampTZVector.d.ts +18 -0
  247. package/lib/vectors/DuckDBTimestampTZVector.js +61 -0
  248. package/lib/vectors/DuckDBTimestampVector.d.ts +18 -0
  249. package/lib/vectors/DuckDBTimestampVector.js +61 -0
  250. package/lib/vectors/DuckDBTinyIntVector.d.ts +17 -0
  251. package/lib/vectors/DuckDBTinyIntVector.js +61 -0
  252. package/lib/vectors/DuckDBTupleVector.d.ts +26 -0
  253. package/lib/vectors/DuckDBTupleVector.js +91 -0
  254. package/lib/vectors/DuckDBUBigIntVector.d.ts +17 -0
  255. package/lib/vectors/DuckDBUBigIntVector.js +58 -0
  256. package/lib/vectors/DuckDBUHugeIntVector.d.ts +19 -0
  257. package/lib/vectors/DuckDBUHugeIntVector.js +63 -0
  258. package/lib/vectors/DuckDBUIntegerVector.d.ts +17 -0
  259. package/lib/vectors/DuckDBUIntegerVector.js +61 -0
  260. package/lib/vectors/DuckDBUSmallIntVector.d.ts +17 -0
  261. package/lib/vectors/DuckDBUSmallIntVector.js +61 -0
  262. package/lib/vectors/DuckDBUTinyIntVector.d.ts +17 -0
  263. package/lib/vectors/DuckDBUTinyIntVector.js +61 -0
  264. package/lib/vectors/DuckDBUUIDVector.d.ts +19 -0
  265. package/lib/vectors/DuckDBUUIDVector.js +59 -0
  266. package/lib/vectors/DuckDBUnionVector.d.ts +17 -0
  267. package/lib/vectors/DuckDBUnionVector.js +70 -0
  268. package/lib/vectors/DuckDBValidity.d.ts +12 -0
  269. package/lib/vectors/DuckDBValidity.js +91 -0
  270. package/lib/vectors/DuckDBVarCharVector.d.ts +21 -0
  271. package/lib/vectors/DuckDBVarCharVector.js +74 -0
  272. package/lib/vectors/DuckDBVariantVector.d.ts +42 -0
  273. package/lib/vectors/DuckDBVariantVector.js +461 -0
  274. package/lib/vectors/DuckDBVector.d.ts +14 -0
  275. package/lib/vectors/DuckDBVector.js +27 -0
  276. package/lib/vectors/createVector.d.ts +1 -0
  277. package/lib/vectors/createVector.js +201 -0
  278. package/lib/vectors/dataAccessors.d.ts +45 -0
  279. package/lib/vectors/dataAccessors.js +344 -0
  280. package/lib/vectors/index.d.ts +47 -0
  281. package/lib/vectors/index.js +65 -0
  282. package/lib/vectors/vectorRegistry.d.ts +20 -0
  283. package/lib/vectors/vectorRegistry.js +16 -0
  284. package/package.json +3 -2
  285. package/lib/DuckDBFunctionInfo.d.ts +0 -10
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DuckDBTableFunctionInfo = void 0;
7
+ const node_bindings_1 = __importDefault(require("@haybarn/node-bindings"));
8
+ class DuckDBTableFunctionInfo {
9
+ function_info;
10
+ constructor(function_info) {
11
+ this.function_info = function_info;
12
+ }
13
+ get extraInfo() {
14
+ return this.getExtraInfo();
15
+ }
16
+ getExtraInfo() {
17
+ return node_bindings_1.default.function_get_extra_info(this.function_info);
18
+ }
19
+ get bindData() {
20
+ return this.getBindData();
21
+ }
22
+ getBindData() {
23
+ return node_bindings_1.default.function_get_bind_data(this.function_info);
24
+ }
25
+ get initData() {
26
+ return this.getInitData();
27
+ }
28
+ getInitData() {
29
+ return node_bindings_1.default.function_get_init_data(this.function_info);
30
+ }
31
+ /** The init data set by the local init function, which is per scanning thread. */
32
+ get localInitData() {
33
+ return this.getLocalInitData();
34
+ }
35
+ getLocalInitData() {
36
+ return node_bindings_1.default.function_get_local_init_data(this.function_info);
37
+ }
38
+ setError(error) {
39
+ node_bindings_1.default.function_set_error(this.function_info, error);
40
+ }
41
+ }
42
+ exports.DuckDBTableFunctionInfo = DuckDBTableFunctionInfo;
@@ -0,0 +1,22 @@
1
+ import duckdb from '@haybarn/node-bindings';
2
+ export declare class DuckDBTableFunctionInitInfo {
3
+ private readonly init_info;
4
+ constructor(init_info: duckdb.TableFunctionInitInfo);
5
+ get extraInfo(): object | undefined;
6
+ getExtraInfo(): object | undefined;
7
+ get bindData(): object | undefined;
8
+ getBindData(): object | undefined;
9
+ /**
10
+ * The number of columns the scan has been asked for, which is all of them
11
+ * unless the function opted into projection pushdown.
12
+ */
13
+ get columnCount(): number;
14
+ getColumnCount(): number;
15
+ /** The index, among the bound result columns, of the given projected column. */
16
+ getColumnIndex(columnIndex: number): number;
17
+ /** All projected column indexes, in order. */
18
+ getColumnIndexes(): number[];
19
+ setInitData(initData: object): void;
20
+ setMaxThreads(maxThreads: number): void;
21
+ setError(error: string): void;
22
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DuckDBTableFunctionInitInfo = void 0;
7
+ const node_bindings_1 = __importDefault(require("@haybarn/node-bindings"));
8
+ class DuckDBTableFunctionInitInfo {
9
+ init_info;
10
+ constructor(init_info) {
11
+ this.init_info = init_info;
12
+ }
13
+ get extraInfo() {
14
+ return this.getExtraInfo();
15
+ }
16
+ getExtraInfo() {
17
+ return node_bindings_1.default.init_get_extra_info(this.init_info);
18
+ }
19
+ get bindData() {
20
+ return this.getBindData();
21
+ }
22
+ getBindData() {
23
+ return node_bindings_1.default.init_get_bind_data(this.init_info);
24
+ }
25
+ /**
26
+ * The number of columns the scan has been asked for, which is all of them
27
+ * unless the function opted into projection pushdown.
28
+ */
29
+ get columnCount() {
30
+ return this.getColumnCount();
31
+ }
32
+ getColumnCount() {
33
+ return node_bindings_1.default.init_get_column_count(this.init_info);
34
+ }
35
+ /** The index, among the bound result columns, of the given projected column. */
36
+ getColumnIndex(columnIndex) {
37
+ return node_bindings_1.default.init_get_column_index(this.init_info, columnIndex);
38
+ }
39
+ /** All projected column indexes, in order. */
40
+ getColumnIndexes() {
41
+ const count = this.getColumnCount();
42
+ const indexes = [];
43
+ for (let i = 0; i < count; i++) {
44
+ indexes.push(this.getColumnIndex(i));
45
+ }
46
+ return indexes;
47
+ }
48
+ setInitData(initData) {
49
+ node_bindings_1.default.init_set_init_data(this.init_info, initData);
50
+ }
51
+ setMaxThreads(maxThreads) {
52
+ node_bindings_1.default.init_set_max_threads(this.init_info, maxThreads);
53
+ }
54
+ setError(error) {
55
+ node_bindings_1.default.init_set_error(this.init_info, error);
56
+ }
57
+ }
58
+ exports.DuckDBTableFunctionInitInfo = DuckDBTableFunctionInitInfo;
@@ -1,373 +1 @@
1
- import { DuckDBLogicalType } from './DuckDBLogicalType';
2
- import { DuckDBTypeId } from './DuckDBTypeId';
3
- import { Json } from './Json';
4
- import { DuckDBDateValue, DuckDBTimestampMillisecondsValue, DuckDBTimestampNanosecondsValue, DuckDBTimestampSecondsValue, DuckDBTimestampTZValue, DuckDBTimestampValue, DuckDBTimeTZValue, DuckDBTimeValue, DuckDBUUIDValue } from './values';
5
- export declare abstract class BaseDuckDBType<T extends DuckDBTypeId> {
6
- readonly typeId: T;
7
- readonly alias?: string;
8
- protected constructor(typeId: T, alias?: string);
9
- toString(): string;
10
- toLogicalType(): DuckDBLogicalType;
11
- toJson(): Json;
12
- }
13
- export declare class DuckDBBooleanType extends BaseDuckDBType<DuckDBTypeId.BOOLEAN> {
14
- constructor(alias?: string);
15
- static readonly instance: DuckDBBooleanType;
16
- static create(alias?: string): DuckDBBooleanType;
17
- }
18
- export declare const BOOLEAN: DuckDBBooleanType;
19
- export declare class DuckDBTinyIntType extends BaseDuckDBType<DuckDBTypeId.TINYINT> {
20
- constructor(alias?: string);
21
- static readonly instance: DuckDBTinyIntType;
22
- static create(alias?: string): DuckDBTinyIntType;
23
- static readonly Max: number;
24
- static readonly Min: number;
25
- get max(): number;
26
- get min(): number;
27
- }
28
- export declare const TINYINT: DuckDBTinyIntType;
29
- export declare class DuckDBSmallIntType extends BaseDuckDBType<DuckDBTypeId.SMALLINT> {
30
- constructor(alias?: string);
31
- static readonly instance: DuckDBSmallIntType;
32
- static create(alias?: string): DuckDBSmallIntType;
33
- static readonly Max: number;
34
- static readonly Min: number;
35
- get max(): number;
36
- get min(): number;
37
- }
38
- export declare const SMALLINT: DuckDBSmallIntType;
39
- export declare class DuckDBIntegerType extends BaseDuckDBType<DuckDBTypeId.INTEGER> {
40
- constructor(alias?: string);
41
- static readonly instance: DuckDBIntegerType;
42
- static create(alias?: string): DuckDBIntegerType;
43
- static readonly Max: number;
44
- static readonly Min: number;
45
- get max(): number;
46
- get min(): number;
47
- }
48
- export declare const INTEGER: DuckDBIntegerType;
49
- export declare class DuckDBBigIntType extends BaseDuckDBType<DuckDBTypeId.BIGINT> {
50
- constructor(alias?: string);
51
- static readonly instance: DuckDBBigIntType;
52
- static create(alias?: string): DuckDBBigIntType;
53
- static readonly Max: bigint;
54
- static readonly Min: bigint;
55
- get max(): bigint;
56
- get min(): bigint;
57
- }
58
- export declare const BIGINT: DuckDBBigIntType;
59
- export declare class DuckDBUTinyIntType extends BaseDuckDBType<DuckDBTypeId.UTINYINT> {
60
- constructor(alias?: string);
61
- static readonly instance: DuckDBUTinyIntType;
62
- static create(alias?: string): DuckDBUTinyIntType;
63
- static readonly Max: number;
64
- static readonly Min = 0;
65
- get max(): number;
66
- get min(): number;
67
- }
68
- export declare const UTINYINT: DuckDBUTinyIntType;
69
- export declare class DuckDBUSmallIntType extends BaseDuckDBType<DuckDBTypeId.USMALLINT> {
70
- constructor(alias?: string);
71
- static readonly instance: DuckDBUSmallIntType;
72
- static create(alias?: string): DuckDBUSmallIntType;
73
- static readonly Max: number;
74
- static readonly Min = 0;
75
- get max(): number;
76
- get min(): number;
77
- }
78
- export declare const USMALLINT: DuckDBUSmallIntType;
79
- export declare class DuckDBUIntegerType extends BaseDuckDBType<DuckDBTypeId.UINTEGER> {
80
- constructor(alias?: string);
81
- static readonly instance: DuckDBUIntegerType;
82
- static create(alias?: string): DuckDBUIntegerType;
83
- static readonly Max: number;
84
- static readonly Min = 0;
85
- get max(): number;
86
- get min(): number;
87
- }
88
- export declare const UINTEGER: DuckDBUIntegerType;
89
- export declare class DuckDBUBigIntType extends BaseDuckDBType<DuckDBTypeId.UBIGINT> {
90
- constructor(alias?: string);
91
- static readonly instance: DuckDBUBigIntType;
92
- static create(alias?: string): DuckDBUBigIntType;
93
- static readonly Max: bigint;
94
- static readonly Min: bigint;
95
- get max(): bigint;
96
- get min(): bigint;
97
- }
98
- export declare const UBIGINT: DuckDBUBigIntType;
99
- export declare class DuckDBFloatType extends BaseDuckDBType<DuckDBTypeId.FLOAT> {
100
- constructor(alias?: string);
101
- static readonly instance: DuckDBFloatType;
102
- static create(alias?: string): DuckDBFloatType;
103
- static readonly Max: number;
104
- static readonly Min: number;
105
- get max(): number;
106
- get min(): number;
107
- }
108
- export declare const FLOAT: DuckDBFloatType;
109
- export declare class DuckDBDoubleType extends BaseDuckDBType<DuckDBTypeId.DOUBLE> {
110
- constructor(alias?: string);
111
- static readonly instance: DuckDBDoubleType;
112
- static create(alias?: string): DuckDBDoubleType;
113
- static readonly Max: number;
114
- static readonly Min: number;
115
- get max(): number;
116
- get min(): number;
117
- }
118
- export declare const DOUBLE: DuckDBDoubleType;
119
- export declare class DuckDBTimestampType extends BaseDuckDBType<DuckDBTypeId.TIMESTAMP> {
120
- constructor(alias?: string);
121
- static readonly instance: DuckDBTimestampType;
122
- static create(alias?: string): DuckDBTimestampType;
123
- get epoch(): DuckDBTimestampValue;
124
- get max(): DuckDBTimestampValue;
125
- get min(): DuckDBTimestampValue;
126
- get posInf(): DuckDBTimestampValue;
127
- get negInf(): DuckDBTimestampValue;
128
- }
129
- export declare const TIMESTAMP: DuckDBTimestampType;
130
- export type DuckDBTimestampMicrosecondsType = DuckDBTimestampType;
131
- export declare const DuckDBTimestampMicrosecondsType: typeof DuckDBTimestampType;
132
- export declare class DuckDBDateType extends BaseDuckDBType<DuckDBTypeId.DATE> {
133
- constructor(alias?: string);
134
- static readonly instance: DuckDBDateType;
135
- static create(alias?: string): DuckDBDateType;
136
- get epoch(): DuckDBDateValue;
137
- get max(): DuckDBDateValue;
138
- get min(): DuckDBDateValue;
139
- get posInf(): DuckDBDateValue;
140
- get negInf(): DuckDBDateValue;
141
- }
142
- export declare const DATE: DuckDBDateType;
143
- export declare class DuckDBTimeType extends BaseDuckDBType<DuckDBTypeId.TIME> {
144
- constructor(alias?: string);
145
- static readonly instance: DuckDBTimeType;
146
- static create(alias?: string): DuckDBTimeType;
147
- get max(): DuckDBTimeValue;
148
- get min(): DuckDBTimeValue;
149
- }
150
- export declare const TIME: DuckDBTimeType;
151
- export declare class DuckDBIntervalType extends BaseDuckDBType<DuckDBTypeId.INTERVAL> {
152
- constructor(alias?: string);
153
- static readonly instance: DuckDBIntervalType;
154
- static create(alias?: string): DuckDBIntervalType;
155
- }
156
- export declare const INTERVAL: DuckDBIntervalType;
157
- export declare class DuckDBHugeIntType extends BaseDuckDBType<DuckDBTypeId.HUGEINT> {
158
- constructor(alias?: string);
159
- static readonly instance: DuckDBHugeIntType;
160
- static create(alias?: string): DuckDBHugeIntType;
161
- static readonly Max: bigint;
162
- static readonly Min: bigint;
163
- get max(): bigint;
164
- get min(): bigint;
165
- }
166
- export declare const HUGEINT: DuckDBHugeIntType;
167
- export declare class DuckDBUHugeIntType extends BaseDuckDBType<DuckDBTypeId.UHUGEINT> {
168
- constructor(alias?: string);
169
- static readonly instance: DuckDBUHugeIntType;
170
- static create(alias?: string): DuckDBUHugeIntType;
171
- static readonly Max: bigint;
172
- static readonly Min: bigint;
173
- get max(): bigint;
174
- get min(): bigint;
175
- }
176
- export declare const UHUGEINT: DuckDBUHugeIntType;
177
- export declare class DuckDBVarCharType extends BaseDuckDBType<DuckDBTypeId.VARCHAR> {
178
- constructor(alias?: string);
179
- static readonly instance: DuckDBVarCharType;
180
- static create(alias?: string): DuckDBVarCharType;
181
- }
182
- export declare const VARCHAR: DuckDBVarCharType;
183
- export declare class DuckDBBlobType extends BaseDuckDBType<DuckDBTypeId.BLOB> {
184
- constructor(alias?: string);
185
- static readonly instance: DuckDBBlobType;
186
- static create(alias?: string): DuckDBBlobType;
187
- }
188
- export declare const BLOB: DuckDBBlobType;
189
- export declare class DuckDBDecimalType extends BaseDuckDBType<DuckDBTypeId.DECIMAL> {
190
- readonly width: number;
191
- readonly scale: number;
192
- constructor(width: number, scale: number, alias?: string);
193
- toString(): string;
194
- toLogicalType(): DuckDBLogicalType;
195
- toJson(): Json;
196
- static readonly default: DuckDBDecimalType;
197
- }
198
- export declare function DECIMAL(width?: number, scale?: number, alias?: string): DuckDBDecimalType;
199
- export declare class DuckDBTimestampSecondsType extends BaseDuckDBType<DuckDBTypeId.TIMESTAMP_S> {
200
- constructor(alias?: string);
201
- static readonly instance: DuckDBTimestampSecondsType;
202
- static create(alias?: string): DuckDBTimestampSecondsType;
203
- get epoch(): DuckDBTimestampSecondsValue;
204
- get max(): DuckDBTimestampSecondsValue;
205
- get min(): DuckDBTimestampSecondsValue;
206
- get posInf(): DuckDBTimestampSecondsValue;
207
- get negInf(): DuckDBTimestampSecondsValue;
208
- }
209
- export declare const TIMESTAMP_S: DuckDBTimestampSecondsType;
210
- export declare class DuckDBTimestampMillisecondsType extends BaseDuckDBType<DuckDBTypeId.TIMESTAMP_MS> {
211
- constructor(alias?: string);
212
- static readonly instance: DuckDBTimestampMillisecondsType;
213
- static create(alias?: string): DuckDBTimestampMillisecondsType;
214
- get epoch(): DuckDBTimestampMillisecondsValue;
215
- get max(): DuckDBTimestampMillisecondsValue;
216
- get min(): DuckDBTimestampMillisecondsValue;
217
- get posInf(): DuckDBTimestampMillisecondsValue;
218
- get negInf(): DuckDBTimestampMillisecondsValue;
219
- }
220
- export declare const TIMESTAMP_MS: DuckDBTimestampMillisecondsType;
221
- export declare class DuckDBTimestampNanosecondsType extends BaseDuckDBType<DuckDBTypeId.TIMESTAMP_NS> {
222
- constructor(alias?: string);
223
- static readonly instance: DuckDBTimestampNanosecondsType;
224
- static create(alias?: string): DuckDBTimestampNanosecondsType;
225
- get epoch(): DuckDBTimestampNanosecondsValue;
226
- get max(): DuckDBTimestampNanosecondsValue;
227
- get min(): DuckDBTimestampNanosecondsValue;
228
- get posInf(): DuckDBTimestampNanosecondsValue;
229
- get negInf(): DuckDBTimestampNanosecondsValue;
230
- }
231
- export declare const TIMESTAMP_NS: DuckDBTimestampNanosecondsType;
232
- export declare class DuckDBEnumType extends BaseDuckDBType<DuckDBTypeId.ENUM> {
233
- readonly values: readonly string[];
234
- readonly valueIndexes: Readonly<Record<string, number>>;
235
- readonly internalTypeId: DuckDBTypeId;
236
- constructor(values: readonly string[], internalTypeId: DuckDBTypeId, alias?: string);
237
- indexForValue(value: string): number;
238
- toString(): string;
239
- toLogicalType(): DuckDBLogicalType;
240
- toJson(): Json;
241
- }
242
- export declare function ENUM8(values: readonly string[], alias?: string): DuckDBEnumType;
243
- export declare function ENUM16(values: readonly string[], alias?: string): DuckDBEnumType;
244
- export declare function ENUM32(values: readonly string[], alias?: string): DuckDBEnumType;
245
- export declare function ENUM(values: readonly string[], alias?: string): DuckDBEnumType;
246
- export declare class DuckDBListType extends BaseDuckDBType<DuckDBTypeId.LIST> {
247
- readonly valueType: DuckDBType;
248
- constructor(valueType: DuckDBType, alias?: string);
249
- toString(): string;
250
- toLogicalType(): DuckDBLogicalType;
251
- toJson(): Json;
252
- }
253
- export declare function LIST(valueType: DuckDBType, alias?: string): DuckDBListType;
254
- export declare class DuckDBStructType extends BaseDuckDBType<DuckDBTypeId.STRUCT> {
255
- readonly entryNames: readonly string[];
256
- readonly entryTypes: readonly DuckDBType[];
257
- readonly entryIndexes: Readonly<Record<string, number>>;
258
- constructor(entryNames: readonly string[], entryTypes: readonly DuckDBType[], alias?: string);
259
- get entryCount(): number;
260
- indexForEntry(entryName: string): number;
261
- typeForEntry(entryName: string): DuckDBType;
262
- toString(): string;
263
- toLogicalType(): DuckDBLogicalType;
264
- toJson(): Json;
265
- }
266
- export declare function STRUCT(entries: Record<string, DuckDBType>, alias?: string): DuckDBStructType;
267
- export declare class DuckDBMapType extends BaseDuckDBType<DuckDBTypeId.MAP> {
268
- readonly keyType: DuckDBType;
269
- readonly valueType: DuckDBType;
270
- constructor(keyType: DuckDBType, valueType: DuckDBType, alias?: string);
271
- toString(): string;
272
- toLogicalType(): DuckDBLogicalType;
273
- toJson(): Json;
274
- }
275
- export declare function MAP(keyType: DuckDBType, valueType: DuckDBType, alias?: string): DuckDBMapType;
276
- export declare class DuckDBArrayType extends BaseDuckDBType<DuckDBTypeId.ARRAY> {
277
- readonly valueType: DuckDBType;
278
- readonly length: number;
279
- constructor(valueType: DuckDBType, length: number, alias?: string);
280
- toString(): string;
281
- toLogicalType(): DuckDBLogicalType;
282
- toJson(): Json;
283
- }
284
- export declare function ARRAY(valueType: DuckDBType, length: number, alias?: string): DuckDBArrayType;
285
- export declare class DuckDBUUIDType extends BaseDuckDBType<DuckDBTypeId.UUID> {
286
- constructor(alias?: string);
287
- static readonly instance: DuckDBUUIDType;
288
- static create(alias?: string): DuckDBUUIDType;
289
- get max(): DuckDBUUIDValue;
290
- get min(): DuckDBUUIDValue;
291
- }
292
- export declare const UUID: DuckDBUUIDType;
293
- export declare class DuckDBUnionType extends BaseDuckDBType<DuckDBTypeId.UNION> {
294
- readonly memberTags: readonly string[];
295
- readonly tagMemberIndexes: Readonly<Record<string, number>>;
296
- readonly memberTypes: readonly DuckDBType[];
297
- constructor(memberTags: readonly string[], memberTypes: readonly DuckDBType[], alias?: string);
298
- memberIndexForTag(tag: string): number;
299
- memberTypeForTag(tag: string): DuckDBType;
300
- get memberCount(): number;
301
- toString(): string;
302
- toLogicalType(): DuckDBLogicalType;
303
- toJson(): Json;
304
- }
305
- export declare function UNION(members: Record<string, DuckDBType>, alias?: string): DuckDBUnionType;
306
- export declare class DuckDBBitType extends BaseDuckDBType<DuckDBTypeId.BIT> {
307
- constructor(alias?: string);
308
- static readonly instance: DuckDBBitType;
309
- static create(alias?: string): DuckDBBitType;
310
- }
311
- export declare const BIT: DuckDBBitType;
312
- export declare class DuckDBTimeTZType extends BaseDuckDBType<DuckDBTypeId.TIME_TZ> {
313
- constructor(alias?: string);
314
- toString(): string;
315
- static readonly instance: DuckDBTimeTZType;
316
- static create(alias?: string): DuckDBTimeTZType;
317
- get max(): DuckDBTimeTZValue;
318
- get min(): DuckDBTimeTZValue;
319
- }
320
- export declare const TIMETZ: DuckDBTimeTZType;
321
- export declare class DuckDBTimestampTZType extends BaseDuckDBType<DuckDBTypeId.TIMESTAMP_TZ> {
322
- constructor(alias?: string);
323
- toString(): string;
324
- static readonly instance: DuckDBTimestampTZType;
325
- static create(alias?: string): DuckDBTimestampTZType;
326
- get epoch(): DuckDBTimestampTZValue;
327
- get max(): DuckDBTimestampTZValue;
328
- get min(): DuckDBTimestampTZValue;
329
- get posInf(): DuckDBTimestampTZValue;
330
- get negInf(): DuckDBTimestampTZValue;
331
- }
332
- export declare const TIMESTAMPTZ: DuckDBTimestampTZType;
333
- export declare class DuckDBAnyType extends BaseDuckDBType<DuckDBTypeId.ANY> {
334
- constructor(alias?: string);
335
- static readonly instance: DuckDBAnyType;
336
- static create(alias?: string): DuckDBAnyType;
337
- }
338
- export declare const ANY: DuckDBAnyType;
339
- export declare class DuckDBBigNumType extends BaseDuckDBType<DuckDBTypeId.BIGNUM> {
340
- constructor(alias?: string);
341
- static readonly instance: DuckDBBigNumType;
342
- static create(alias?: string): DuckDBBigNumType;
343
- static readonly Max: bigint;
344
- static readonly Min: bigint;
345
- get max(): bigint;
346
- get min(): bigint;
347
- }
348
- export declare const BIGNUM: DuckDBBigNumType;
349
- export declare class DuckDBSQLNullType extends BaseDuckDBType<DuckDBTypeId.SQLNULL> {
350
- constructor(alias?: string);
351
- static readonly instance: DuckDBSQLNullType;
352
- static create(alias?: string): DuckDBSQLNullType;
353
- }
354
- export declare const SQLNULL: DuckDBSQLNullType;
355
- export declare class DuckDBStringLiteralType extends BaseDuckDBType<DuckDBTypeId.STRING_LITERAL> {
356
- constructor(alias?: string);
357
- static readonly instance: DuckDBStringLiteralType;
358
- static create(alias?: string): DuckDBStringLiteralType;
359
- }
360
- export declare const STRING_LITERAL: DuckDBStringLiteralType;
361
- export declare class DuckDBIntegerLiteralType extends BaseDuckDBType<DuckDBTypeId.INTEGER_LITERAL> {
362
- constructor(alias?: string);
363
- static readonly instance: DuckDBIntegerLiteralType;
364
- static create(alias?: string): DuckDBIntegerLiteralType;
365
- }
366
- export declare const INTEGER_LITERAL: DuckDBIntegerLiteralType;
367
- export declare class DuckDBTimeNSType extends BaseDuckDBType<DuckDBTypeId.TIME_NS> {
368
- constructor(alias?: string);
369
- static readonly instance: DuckDBTimeNSType;
370
- static create(alias?: string): DuckDBTimeNSType;
371
- }
372
- export declare const TIME_NS: DuckDBTimeNSType;
373
- export type DuckDBType = DuckDBBooleanType | DuckDBTinyIntType | DuckDBSmallIntType | DuckDBIntegerType | DuckDBBigIntType | DuckDBUTinyIntType | DuckDBUSmallIntType | DuckDBUIntegerType | DuckDBUBigIntType | DuckDBFloatType | DuckDBDoubleType | DuckDBTimestampType | DuckDBDateType | DuckDBTimeType | DuckDBIntervalType | DuckDBHugeIntType | DuckDBUHugeIntType | DuckDBVarCharType | DuckDBBlobType | DuckDBDecimalType | DuckDBTimestampSecondsType | DuckDBTimestampMillisecondsType | DuckDBTimestampNanosecondsType | DuckDBEnumType | DuckDBListType | DuckDBStructType | DuckDBMapType | DuckDBArrayType | DuckDBUUIDType | DuckDBUnionType | DuckDBBitType | DuckDBTimeTZType | DuckDBTimestampTZType | DuckDBAnyType | DuckDBBigNumType | DuckDBSQLNullType | DuckDBStringLiteralType | DuckDBIntegerLiteralType | DuckDBTimeNSType;
1
+ export * from './types';