@thi.ng/column-store 0.11.1 → 0.11.3

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.
@@ -15,7 +15,7 @@ export declare class VectorColumn<T extends Row = Row> extends AColumn<T> {
15
15
  validate(value: any): boolean;
16
16
  ensureRows(): void;
17
17
  setRow(i: number, value: any): void;
18
- getRow(i: number): Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | Int8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Uint8ClampedArray<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>;
18
+ getRow(i: number): Uint32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | Int8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Uint8ClampedArray<ArrayBufferLike> | Uint16Array<ArrayBufferLike>;
19
19
  getRowKey(i: number): string;
20
20
  valueKey(value: any): string | string[];
21
21
  removeRow(i: number): void;
@@ -11,5 +11,5 @@ export declare const __serializeTyped: ($values: NumericArray, spec: ColumnSpec,
11
11
  values: any[];
12
12
  };
13
13
  /** @internal */
14
- export declare const __deserializeTyped: (type: Type, flags: number, values: number[]) => Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | Int8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Uint8ClampedArray<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>;
14
+ export declare const __deserializeTyped: (type: Type, flags: number, values: number[]) => Uint32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | Int8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Uint8ClampedArray<ArrayBufferLike> | Uint16Array<ArrayBufferLike>;
15
15
  //# sourceMappingURL=serialize.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/column-store",
3
- "version": "0.11.1",
3
+ "version": "0.11.3",
4
4
  "description": "In-memory column store database with customizable column types, extensible query engine, bitfield indexing for query acceleration, JSON serialization with optional RLE compression",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -40,12 +40,12 @@
40
40
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@thi.ng/api": "^8.12.15",
44
- "@thi.ng/bidir-index": "^1.5.1",
45
- "@thi.ng/checks": "^3.8.5",
46
- "@thi.ng/compare": "^2.5.1",
47
- "@thi.ng/errors": "^2.6.4",
48
- "@thi.ng/rle-pack": "^3.2.2"
43
+ "@thi.ng/api": "^8.12.16",
44
+ "@thi.ng/bidir-index": "^1.5.2",
45
+ "@thi.ng/checks": "^3.8.6",
46
+ "@thi.ng/compare": "^2.5.3",
47
+ "@thi.ng/errors": "^2.6.5",
48
+ "@thi.ng/rle-pack": "^3.2.3"
49
49
  },
50
50
  "devDependencies": {
51
51
  "esbuild": "^0.27.2",
@@ -130,5 +130,5 @@
130
130
  "status": "alpha",
131
131
  "year": 2025
132
132
  },
133
- "gitHead": "8f50352caab9ec7757d645c0afa605dfb5427abe\n"
133
+ "gitHead": "869c807f9230120074f4ef5b9dce651ad0b846b9\n"
134
134
  }
package/query.d.ts CHANGED
@@ -9,7 +9,7 @@ export declare class Query<T extends Row> {
9
9
  protected _offset: number;
10
10
  constructor(table: Table<T>, terms?: QueryTerm<T>[]);
11
11
  addTerm(term: QueryTerm<T>): this;
12
- limit(limit: number, offset?: number): void;
12
+ limit(limit: number, offset?: number): this;
13
13
  /**
14
14
  * Constructs a comparator for query results based on given sort criteria,
15
15
  * which are applied in given order. Each criteria can be on of:
package/query.js CHANGED
@@ -28,6 +28,7 @@ class Query {
28
28
  limit(limit, offset = 0) {
29
29
  this._limit = limit;
30
30
  this._offset = offset;
31
+ return this;
31
32
  }
32
33
  /**
33
34
  * Constructs a comparator for query results based on given sort criteria,
@@ -122,15 +123,16 @@ class Query {
122
123
  rows.push(table.getRow(i, false, true));
123
124
  }
124
125
  rows.sort(this._cmp);
125
- for (let i = this._offset, n = Math.min(rows.length, i + this._limit); i < n; i++) {
126
+ for (let i = this._offset, n2 = Math.min(rows.length, i + _limit); i < n2; i++) {
126
127
  yield rows[i];
127
128
  }
128
129
  return;
129
130
  }
130
131
  let j = 0;
132
+ const n = _offset + _limit;
131
133
  for (let i of ctx) {
132
134
  if (j >= _offset) {
133
- if (j >= _limit) return;
135
+ if (j >= n) return;
134
136
  yield table.getRow(i, false, true);
135
137
  }
136
138
  j++;