@protobase/query 0.117.7 → 0.118.1
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/dist/aggregate-scan.d.ts +35 -0
- package/dist/aggregate-scan.js +108 -0
- package/dist/facet-counts.js +7 -3
- package/dist/filter-fingerprint.d.ts +6 -0
- package/dist/filter-fingerprint.js +7 -1
- package/dist/grouped-counts.js +40 -0
- package/dist/histogram-bounds.js +24 -0
- package/dist/histogram.js +25 -16
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/package.json +2 -2
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Db } from "./db.js";
|
|
2
|
+
import { Scope } from "./scope.js";
|
|
3
|
+
import { FacetCount } from "./facet-counts.js";
|
|
4
|
+
import { BucketOptions } from "./series-buckets.js";
|
|
5
|
+
import { SeriesPoint } from "./series.js";
|
|
6
|
+
import { Histogram } from "./histogram.js";
|
|
7
|
+
import { CheckedFilter, ResourceModel } from "@protobase/schema";
|
|
8
|
+
//#region src/aggregate-scan.d.ts
|
|
9
|
+
export type ScanRequests = {
|
|
10
|
+
facets?: Array<{
|
|
11
|
+
field: string;
|
|
12
|
+
limit?: number;
|
|
13
|
+
}>;
|
|
14
|
+
histograms?: Array<{
|
|
15
|
+
field: string;
|
|
16
|
+
buckets: number;
|
|
17
|
+
}>;
|
|
18
|
+
series?: Array<{
|
|
19
|
+
field: string;
|
|
20
|
+
} & BucketOptions>;
|
|
21
|
+
};
|
|
22
|
+
export type ScanResults = {
|
|
23
|
+
facets: FacetCount[][];
|
|
24
|
+
histograms: Histogram[];
|
|
25
|
+
series: SeriesPoint[][];
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* The facet counts, histograms and series of one filter and scope, each as `facetCounts`, `histogram` and `series` find
|
|
29
|
+
* it, in few scans of the table however many are asked for: one for the bounds of every histogram, and one per
|
|
30
|
+
* `setsPerScan` groupings that count facets' values, histograms' buckets and series' buckets together (`groupedCounts`).
|
|
31
|
+
* The filter applies to each as given, so a facet that leaves out its own terms is asked for with them left out
|
|
32
|
+
* (`withoutField`). Results come in request order.
|
|
33
|
+
*/
|
|
34
|
+
export declare const aggregateScan: (db: Db, model: ResourceModel, filter: CheckedFilter | undefined, scope: Scope | undefined, requests: ScanRequests) => Promise<ScanResults>;
|
|
35
|
+
//#endregion
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { columnRef, requireField } from "./columns.js";
|
|
2
|
+
import { assertFilterRequirements } from "./filter-requirements.js";
|
|
3
|
+
import { toNumber } from "./numbers.js";
|
|
4
|
+
import { facetLimit } from "./facet-counts.js";
|
|
5
|
+
import { seriesBuckets } from "./series-buckets.js";
|
|
6
|
+
import { bucketOf, histogramColumn, histogramOf } from "./histogram.js";
|
|
7
|
+
import { groupedCounts } from "./grouped-counts.js";
|
|
8
|
+
import { histogramBounds } from "./histogram-bounds.js";
|
|
9
|
+
import { sql } from "kysely";
|
|
10
|
+
//#region src/aggregate-scan.ts
|
|
11
|
+
const bucketText = (value) => sql`to_char(${value}, 'YYYY-MM-DD"T"HH24:MI:SS')`;
|
|
12
|
+
const bucketList = async (db, buckets) => {
|
|
13
|
+
const { from, truncate, local, laterBucket, step } = buckets;
|
|
14
|
+
return (await sql`select ${bucketText(sql`b`)} as bucket from generate_series(${truncate(local(from))}, ${laterBucket}, ${step}) as b order by b`.execute(db)).rows.map((row) => row.bucket);
|
|
15
|
+
};
|
|
16
|
+
const seriesKey = ({ col, from, to, bound, truncate, local, isDate }) => sql`case when ${col} >= ${from}::${bound} and ${col} < ${to}::${bound} then ${bucketText(truncate(isDate ? sql`${col}::timestamp` : local(col)))} end`;
|
|
17
|
+
const countSets = () => {
|
|
18
|
+
const sets = [];
|
|
19
|
+
const indexes = /* @__PURE__ */ new Map();
|
|
20
|
+
const add = (id, set) => {
|
|
21
|
+
const known = indexes.get(id);
|
|
22
|
+
if (known !== void 0) return known;
|
|
23
|
+
indexes.set(id, sets.length);
|
|
24
|
+
sets.push(set);
|
|
25
|
+
return sets.length - 1;
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
sets,
|
|
29
|
+
add
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The facet counts, histograms and series of one filter and scope, each as `facetCounts`, `histogram` and `series` find
|
|
34
|
+
* it, in few scans of the table however many are asked for: one for the bounds of every histogram, and one per
|
|
35
|
+
* `setsPerScan` groupings that count facets' values, histograms' buckets and series' buckets together (`groupedCounts`).
|
|
36
|
+
* The filter applies to each as given, so a facet that leaves out its own terms is asked for with them left out
|
|
37
|
+
* (`withoutField`). Results come in request order.
|
|
38
|
+
*/
|
|
39
|
+
const aggregateScan = async (db, model, filter, scope, requests) => {
|
|
40
|
+
const facets = (requests.facets ?? []).map(({ field, limit }) => ({
|
|
41
|
+
field,
|
|
42
|
+
column: columnRef(requireField(model, field, "filterable")),
|
|
43
|
+
limit: facetLimit(limit)
|
|
44
|
+
}));
|
|
45
|
+
const histograms = (requests.histograms ?? []).map(({ field, buckets }) => ({
|
|
46
|
+
field,
|
|
47
|
+
column: histogramColumn(model, field, buckets),
|
|
48
|
+
buckets
|
|
49
|
+
}));
|
|
50
|
+
const series = (requests.series ?? []).map(({ field, ...options }) => ({
|
|
51
|
+
id: JSON.stringify([field, options]),
|
|
52
|
+
buckets: seriesBuckets(model, field, options)
|
|
53
|
+
}));
|
|
54
|
+
await assertFilterRequirements(db, filter, scope);
|
|
55
|
+
const bounds = await histogramBounds(db, model, filter, scope, histograms.map(({ column }) => column));
|
|
56
|
+
const { sets, add } = countSets();
|
|
57
|
+
const facetSets = facets.map(({ field, column }) => add(`facet:${field}`, {
|
|
58
|
+
key: sql`${column}`,
|
|
59
|
+
ranked: true
|
|
60
|
+
}));
|
|
61
|
+
const histogramSets = histograms.map(({ field, column, buckets }, index) => {
|
|
62
|
+
const { min, max } = bounds[index];
|
|
63
|
+
if (buckets === 1 || min === null || max === null || min === max) return;
|
|
64
|
+
return add(`histogram:${field}:${buckets}`, {
|
|
65
|
+
key: sql`case when ${column} is not null then ${bucketOf(column, min, max, buckets)} end`,
|
|
66
|
+
ranked: false
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
const seriesSets = series.map(({ id, buckets }) => add(`series:${id}`, {
|
|
70
|
+
key: seriesKey(buckets),
|
|
71
|
+
ranked: false
|
|
72
|
+
}));
|
|
73
|
+
const counted = await groupedCounts(db, model, filter, scope, sets, Math.max(0, ...facets.map(({ limit }) => limit)));
|
|
74
|
+
const lists = [];
|
|
75
|
+
for (const { buckets } of series) lists.push(await bucketList(db, buckets));
|
|
76
|
+
return {
|
|
77
|
+
facets: facets.map(({ limit }, index) => counted[facetSets[index]].slice(0, limit)),
|
|
78
|
+
histograms: histograms.map(({ buckets }, index) => {
|
|
79
|
+
const { min, max, count } = bounds[index];
|
|
80
|
+
if (min === null || max === null) return {
|
|
81
|
+
min: null,
|
|
82
|
+
max: null,
|
|
83
|
+
buckets: []
|
|
84
|
+
};
|
|
85
|
+
if (min === max) return {
|
|
86
|
+
min,
|
|
87
|
+
max,
|
|
88
|
+
buckets: [{
|
|
89
|
+
from: min,
|
|
90
|
+
to: max,
|
|
91
|
+
count
|
|
92
|
+
}]
|
|
93
|
+
};
|
|
94
|
+
const set = histogramSets[index];
|
|
95
|
+
if (set === void 0) return histogramOf(min, max, buckets, /* @__PURE__ */ new Map([[1, count]]));
|
|
96
|
+
return histogramOf(min, max, buckets, new Map(counted[set].flatMap(({ value, count }) => value === null ? [] : [[toNumber(value), count]])));
|
|
97
|
+
}),
|
|
98
|
+
series: series.map((_, index) => {
|
|
99
|
+
const counts = new Map(counted[seriesSets[index]].flatMap(({ value, count }) => value === null ? [] : [[String(value), count]]));
|
|
100
|
+
return lists[index].map((bucket) => ({
|
|
101
|
+
bucket,
|
|
102
|
+
count: counts.get(bucket) ?? 0
|
|
103
|
+
}));
|
|
104
|
+
})
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
//#endregion
|
|
108
|
+
export { aggregateScan };
|
package/dist/facet-counts.js
CHANGED
|
@@ -9,11 +9,15 @@ import { sql } from "kysely";
|
|
|
9
9
|
//#region src/facet-counts.ts
|
|
10
10
|
const defaultLimit = 100;
|
|
11
11
|
const maxLimit = 1e3;
|
|
12
|
+
/** How many values a facet keeps, the most frequent first: `limit`, 100 by default, or a `QueryError`. */
|
|
13
|
+
const facetLimit = (limit = defaultLimit) => {
|
|
14
|
+
if (!Number.isInteger(limit) || limit < 1 || limit > maxLimit) throw new QueryError("invalid_option", `limit must be between 1 and ${maxLimit}`);
|
|
15
|
+
return limit;
|
|
16
|
+
};
|
|
12
17
|
/** Counts per value of `field`, with every filter applied except the ones on `field` itself. */
|
|
13
18
|
const facetCounts = async (db, model, field, filter, options) => {
|
|
14
19
|
const column = columnRef(requireField(model, field, "filterable"));
|
|
15
|
-
const limit = options.limit
|
|
16
|
-
if (!Number.isInteger(limit) || limit < 1 || limit > maxLimit) throw new QueryError("invalid_option", `limit must be between 1 and ${maxLimit}`);
|
|
20
|
+
const limit = facetLimit(options.limit);
|
|
17
21
|
const others = withoutField(filter, field);
|
|
18
22
|
await assertFilterRequirements(db, others, options.scope);
|
|
19
23
|
return withStatementTimeout(db, options.statementTimeoutMs, async (trx) => {
|
|
@@ -24,4 +28,4 @@ const facetCounts = async (db, model, field, filter, options) => {
|
|
|
24
28
|
});
|
|
25
29
|
};
|
|
26
30
|
//#endregion
|
|
27
|
-
export { facetCounts };
|
|
31
|
+
export { facetCounts, facetLimit };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Scope } from "./scope.js";
|
|
2
|
+
import { CheckedFilter } from "@protobase/schema";
|
|
3
|
+
//#region src/filter-fingerprint.d.ts
|
|
4
|
+
/** What a read keeps to, as text: equal for two reads that filter the same rows, however their filters were written. */
|
|
5
|
+
export declare const readIdentity: (filter: CheckedFilter | undefined, scope?: Scope) => string;
|
|
6
|
+
//#endregion
|
|
@@ -34,6 +34,12 @@ const hash = (text) => {
|
|
|
34
34
|
h2 = Math.imul(h2 ^ h2 >>> 16, 2246822507) ^ Math.imul(h1 ^ h1 >>> 13, 3266489909);
|
|
35
35
|
return (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString(36);
|
|
36
36
|
};
|
|
37
|
+
/** What a read keeps to, as text: equal for two reads that filter the same rows, however their filters were written. */
|
|
38
|
+
const readIdentity = (filter, scope) => canonical({
|
|
39
|
+
filter,
|
|
40
|
+
terms: relatedTerms(scope),
|
|
41
|
+
within: scope?.within
|
|
42
|
+
});
|
|
37
43
|
/** A short fingerprint of the filter a cursor was issued for and what its scope narrows it by; empty without either. */
|
|
38
44
|
const filterFingerprint = (filter, scope) => {
|
|
39
45
|
const terms = relatedTerms(scope);
|
|
@@ -45,4 +51,4 @@ const filterFingerprint = (filter, scope) => {
|
|
|
45
51
|
return filter ? hash(canonical(filter)) : "";
|
|
46
52
|
};
|
|
47
53
|
//#endregion
|
|
48
|
-
export { filterFingerprint };
|
|
54
|
+
export { filterFingerprint, readIdentity };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { baseQuery } from "./base-query.js";
|
|
2
|
+
import { toNumber } from "./numbers.js";
|
|
3
|
+
import { sql } from "kysely";
|
|
4
|
+
/**
|
|
5
|
+
* Counts the rows per value of every set's key, the filter and scope applying to each, in one scan of the table
|
|
6
|
+
* (`GROUPING SETS`) per `setsPerScan` sets. A ranked set keeps its `limit` most frequent values, ties by value, as
|
|
7
|
+
* `facetCounts` orders them; the others keep every value. Returns each set's values in that order, a null key included.
|
|
8
|
+
*/
|
|
9
|
+
const groupedCounts = async (db, model, filter, scope, sets, limit) => {
|
|
10
|
+
const counts = [];
|
|
11
|
+
for (let start = 0; start < sets.length; start += 4) counts.push(...await countScan(db, model, filter, scope, sets.slice(start, start + 4), limit));
|
|
12
|
+
return counts;
|
|
13
|
+
};
|
|
14
|
+
const countScan = async (db, model, filter, scope, sets, limit) => {
|
|
15
|
+
const keys = sets.map((_, index) => sql.id(`k${index}`));
|
|
16
|
+
const keyed = baseQuery(db, model, filter, scope).select(sets.map(({ key }, index) => key.as(`k${index}`))).offset(0);
|
|
17
|
+
const setOf = sql`case ${sql.join(keys.map((key, index) => sql`when grouping(${key}) = 0 then ${sql.lit(index)}`), sql` `)} end`;
|
|
18
|
+
const ranked = sets.flatMap(({ ranked }, index) => ranked ? [sql.lit(index)] : []);
|
|
19
|
+
const kept = ranked.length === 0 ? sql`true` : sql`s not in (${sql.join(ranked)}) or rank <= ${limit}`;
|
|
20
|
+
const result = await sql`
|
|
21
|
+
with g as (
|
|
22
|
+
select ${setOf} as s, ${sql.join(keys)}, count(*) as n
|
|
23
|
+
from (${keyed}) as v
|
|
24
|
+
group by grouping sets (${sql.join(keys.map((key) => sql`(${key})`))})
|
|
25
|
+
), r as (
|
|
26
|
+
select g.*, row_number() over (partition by s order by n desc, ${sql.join(keys)}) as rank from g
|
|
27
|
+
)
|
|
28
|
+
select s, ${sql.join(keys)}, n::text as n from r
|
|
29
|
+
where ${kept}
|
|
30
|
+
order by s, rank
|
|
31
|
+
`.execute(db);
|
|
32
|
+
const counts = sets.map(() => []);
|
|
33
|
+
for (const row of result.rows) counts[row.s].push({
|
|
34
|
+
value: row[`k${row.s}`],
|
|
35
|
+
count: toNumber(row.n)
|
|
36
|
+
});
|
|
37
|
+
return counts;
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { groupedCounts };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { baseQuery } from "./base-query.js";
|
|
2
|
+
import { toNumber } from "./numbers.js";
|
|
3
|
+
import { sql } from "kysely";
|
|
4
|
+
//#region src/histogram-bounds.ts
|
|
5
|
+
/** The bounds of every column in one scan of the table, in the order given. */
|
|
6
|
+
const histogramBounds = async (db, model, filter, scope, columns) => {
|
|
7
|
+
if (columns.length === 0) return [];
|
|
8
|
+
const row = await baseQuery(db, model, filter, scope).select(columns.flatMap((column, index) => [
|
|
9
|
+
sql`min(${column})::float8::text`.as(`lo${index}`),
|
|
10
|
+
sql`max(${column})::float8::text`.as(`hi${index}`),
|
|
11
|
+
sql`count(${column})::text`.as(`n${index}`)
|
|
12
|
+
])).executeTakeFirstOrThrow();
|
|
13
|
+
return columns.map((_, index) => {
|
|
14
|
+
const lo = row[`lo${index}`] ?? null;
|
|
15
|
+
const hi = row[`hi${index}`] ?? null;
|
|
16
|
+
return {
|
|
17
|
+
min: lo === null ? null : Number(lo),
|
|
18
|
+
max: hi === null ? null : Number(hi),
|
|
19
|
+
count: toNumber(row[`n${index}`])
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { histogramBounds };
|
package/dist/histogram.js
CHANGED
|
@@ -12,13 +12,32 @@ const numericTypes = [
|
|
|
12
12
|
"decimal",
|
|
13
13
|
"currency"
|
|
14
14
|
];
|
|
15
|
-
/**
|
|
16
|
-
const
|
|
15
|
+
/** The column of a numeric filterable field that a histogram of `buckets` can bucket, or a `QueryError`. */
|
|
16
|
+
const histogramColumn = (model, field, buckets) => {
|
|
17
17
|
const target = requireField(model, field, "filterable");
|
|
18
18
|
if (!numericTypes.includes(target.type)) throw new QueryError("unsupported_field_type", `Histogram needs a numeric field, "${field}" is ${target.type}`);
|
|
19
19
|
if (!Number.isInteger(buckets) || buckets < 1 || buckets > maxBuckets) throw new QueryError("invalid_option", `buckets must be between 1 and ${maxBuckets}`);
|
|
20
|
+
return columnRef(target);
|
|
21
|
+
};
|
|
22
|
+
/** Which of `buckets` equal-width buckets between `min` and `max` a value falls in, from 1; the maximum is in the last. */
|
|
23
|
+
const bucketOf = (column, min, max, buckets) => sql`least(width_bucket(${column}::float8, ${min}::float8, ${max}::float8, ${buckets}::int), ${buckets}::int)`;
|
|
24
|
+
/** The buckets between `min` and `max` with their counts by `bucketOf`, empty ones included. */
|
|
25
|
+
const histogramOf = (min, max, buckets, counts) => {
|
|
26
|
+
const width = (max - min) / buckets;
|
|
27
|
+
return {
|
|
28
|
+
min,
|
|
29
|
+
max,
|
|
30
|
+
buckets: Array.from({ length: buckets }, (_, i) => ({
|
|
31
|
+
from: min + i * width,
|
|
32
|
+
to: i === buckets - 1 ? max : min + (i + 1) * width,
|
|
33
|
+
count: counts.get(i + 1) ?? 0
|
|
34
|
+
}))
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
/** Equal-width buckets between the filtered min and max, empty buckets included. */
|
|
38
|
+
const histogram = async (db, model, field, filter, buckets, scope) => {
|
|
39
|
+
const col = histogramColumn(model, field, buckets);
|
|
20
40
|
await assertFilterRequirements(db, filter, scope);
|
|
21
|
-
const col = columnRef(target);
|
|
22
41
|
const present = baseQuery(db, model, filter, scope).where(sql`${col} is not null`);
|
|
23
42
|
const bounds = await present.select([sql`min(${col})::float8::text`.as("lo"), sql`max(${col})::float8::text`.as("hi")]).executeTakeFirstOrThrow();
|
|
24
43
|
if (bounds.lo === null || bounds.hi === null) return {
|
|
@@ -40,18 +59,8 @@ const histogram = async (db, model, field, filter, buckets, scope) => {
|
|
|
40
59
|
}]
|
|
41
60
|
};
|
|
42
61
|
}
|
|
43
|
-
const counted = await present.select([
|
|
44
|
-
|
|
45
|
-
const width = (max - min) / buckets;
|
|
46
|
-
return {
|
|
47
|
-
min,
|
|
48
|
-
max,
|
|
49
|
-
buckets: Array.from({ length: buckets }, (_, i) => ({
|
|
50
|
-
from: min + i * width,
|
|
51
|
-
to: i === buckets - 1 ? max : min + (i + 1) * width,
|
|
52
|
-
count: counts.get(i + 1) ?? 0
|
|
53
|
-
}))
|
|
54
|
-
};
|
|
62
|
+
const counted = await present.select([bucketOf(col, min, max, buckets).as("bucket"), sql`count(*)::text`.as("n")]).groupBy(sql`1`).execute();
|
|
63
|
+
return histogramOf(min, max, buckets, new Map(counted.map((row) => [toNumber(row.bucket), toNumber(row.n)])));
|
|
55
64
|
};
|
|
56
65
|
//#endregion
|
|
57
|
-
export { histogram };
|
|
66
|
+
export { bucketOf, histogram, histogramColumn, histogramOf };
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ import { Granularity } from "./series-buckets.js";
|
|
|
14
14
|
import { SeriesOptions, SeriesPoint, series } from "./series.js";
|
|
15
15
|
import { SplitPoint, SplitSeriesOptions, splitSeries } from "./split-series.js";
|
|
16
16
|
import { Histogram, HistogramBucket, histogram } from "./histogram.js";
|
|
17
|
+
import { ScanRequests, ScanResults, aggregateScan } from "./aggregate-scan.js";
|
|
18
|
+
import { readIdentity } from "./filter-fingerprint.js";
|
|
17
19
|
import { MapBounds, MapBucket, MapBuckets, MapPosition, cellsAcross, checkMapPosition, mapBuckets, mapCellPixels, maxMapBuckets, maxMapZoom } from "./map-buckets.js";
|
|
18
20
|
import { withoutField } from "./prune-filter.js";
|
|
19
21
|
import { ScrollMode, scrollMode } from "./scroll-mode.js";
|
|
@@ -28,4 +30,4 @@ import { lookupRead } from "./linked-read.js";
|
|
|
28
30
|
import { LookupCoverage, lookupQueries, uncoveredLookupMatch } from "./lookup-coverage.js";
|
|
29
31
|
import { readsParent } from "./reads-parent.js";
|
|
30
32
|
import { SeekRequest, seekToPosition } from "./seek-to-position.js";
|
|
31
|
-
export { type ColumnUse, type CompileOptions, type CoverageQuery, type Db, type ExtraColumn, type FacetCount, type FacetOptions, type Granularity, type GroupTotal, type GroupTotalsOptions, type Histogram, type HistogramBucket, type IndexKey, type IndexNeed, type KeyItemType, type LimitPer, type ListOptions, type ListPlan, type ListResult, type LookupCoverage, type LookupRead, type MapBounds, type MapBucket, type MapBuckets, type MapPosition, type Measure, type ParentRead, type PerValue, QueryError, type QueryErrorCode, type RelatedPage, type RelatedPageRequest, type RelatedRowsQuery, type Scope, type ScrollMode, type SeekRequest, type SeriesOptions, type SeriesPoint, type SplitPoint, type SplitSeriesOptions, type TableIndex, type TableIndexes, type UncoveredColumn, buildListQuery, buildRelatedRows, cellsAcross, checkMapPosition, columnRef, compileFilter, countUpTo, estimateCount, exactCount, facetCounts, groupTotals, histogram, indexServes, listPerValue, listQuery, lookupQueries, lookupRead, lookupReadOf, mapBuckets, mapCellPixels, maxLimit, maxMapBuckets, maxMapZoom, parentCondition, readsParent, relatedPage, relatedRows, scrollMode, seekToPosition, series, splitSeries, tableIndexes, tenantCondition, uncoveredColumns, uncoveredFileColumns, uncoveredLookupMatch, withLookupRead, withoutField };
|
|
33
|
+
export { type ColumnUse, type CompileOptions, type CoverageQuery, type Db, type ExtraColumn, type FacetCount, type FacetOptions, type Granularity, type GroupTotal, type GroupTotalsOptions, type Histogram, type HistogramBucket, type IndexKey, type IndexNeed, type KeyItemType, type LimitPer, type ListOptions, type ListPlan, type ListResult, type LookupCoverage, type LookupRead, type MapBounds, type MapBucket, type MapBuckets, type MapPosition, type Measure, type ParentRead, type PerValue, QueryError, type QueryErrorCode, type RelatedPage, type RelatedPageRequest, type RelatedRowsQuery, type ScanRequests, type ScanResults, type Scope, type ScrollMode, type SeekRequest, type SeriesOptions, type SeriesPoint, type SplitPoint, type SplitSeriesOptions, type TableIndex, type TableIndexes, type UncoveredColumn, aggregateScan, buildListQuery, buildRelatedRows, cellsAcross, checkMapPosition, columnRef, compileFilter, countUpTo, estimateCount, exactCount, facetCounts, groupTotals, histogram, indexServes, listPerValue, listQuery, lookupQueries, lookupRead, lookupReadOf, mapBuckets, mapCellPixels, maxLimit, maxMapBuckets, maxMapZoom, parentCondition, readIdentity, readsParent, relatedPage, relatedRows, scrollMode, seekToPosition, series, splitSeries, tableIndexes, tenantCondition, uncoveredColumns, uncoveredFileColumns, uncoveredLookupMatch, withLookupRead, withoutField };
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { columnRef } from "./columns.js";
|
|
|
4
4
|
import { compileFilter } from "./compile-filter.js";
|
|
5
5
|
import { tenantCondition } from "./scope.js";
|
|
6
6
|
import { parentCondition } from "./read-conditions.js";
|
|
7
|
+
import { readIdentity } from "./filter-fingerprint.js";
|
|
7
8
|
import { buildListQuery, listQuery, maxLimit } from "./list-query.js";
|
|
8
9
|
import { buildRelatedRows, relatedRows } from "./related-rows.js";
|
|
9
10
|
import { listPerValue } from "./list-per-value.js";
|
|
@@ -16,6 +17,7 @@ import { groupTotals } from "./group-totals.js";
|
|
|
16
17
|
import { splitSeries } from "./split-series.js";
|
|
17
18
|
import { series } from "./series.js";
|
|
18
19
|
import { histogram } from "./histogram.js";
|
|
20
|
+
import { aggregateScan } from "./aggregate-scan.js";
|
|
19
21
|
import { cellsAcross, checkMapPosition, mapBuckets, mapCellPixels, maxMapBuckets, maxMapZoom } from "./map-buckets.js";
|
|
20
22
|
import { scrollMode } from "./scroll-mode.js";
|
|
21
23
|
import { tableIndexes } from "./table-indexes.js";
|
|
@@ -25,4 +27,4 @@ import { lookupRead } from "./linked-read.js";
|
|
|
25
27
|
import { lookupQueries, uncoveredLookupMatch } from "./lookup-coverage.js";
|
|
26
28
|
import { readsParent } from "./reads-parent.js";
|
|
27
29
|
import { seekToPosition } from "./seek-to-position.js";
|
|
28
|
-
export { QueryError, buildListQuery, buildRelatedRows, cellsAcross, checkMapPosition, columnRef, compileFilter, countUpTo, estimateCount, exactCount, facetCounts, groupTotals, histogram, indexServes, listPerValue, listQuery, lookupQueries, lookupRead, lookupReadOf, mapBuckets, mapCellPixels, maxLimit, maxMapBuckets, maxMapZoom, parentCondition, readsParent, relatedPage, relatedRows, scrollMode, seekToPosition, series, splitSeries, tableIndexes, tenantCondition, uncoveredColumns, uncoveredFileColumns, uncoveredLookupMatch, withLookupRead, withoutField };
|
|
30
|
+
export { QueryError, aggregateScan, buildListQuery, buildRelatedRows, cellsAcross, checkMapPosition, columnRef, compileFilter, countUpTo, estimateCount, exactCount, facetCounts, groupTotals, histogram, indexServes, listPerValue, listQuery, lookupQueries, lookupRead, lookupReadOf, mapBuckets, mapCellPixels, maxLimit, maxMapBuckets, maxMapZoom, parentCondition, readIdentity, readsParent, relatedPage, relatedRows, scrollMode, seekToPosition, series, splitSeries, tableIndexes, tenantCondition, uncoveredColumns, uncoveredFileColumns, uncoveredLookupMatch, withLookupRead, withoutField };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/query",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.118.1",
|
|
4
4
|
"description": "Kysely list, filter, count and aggregate queries over Protobase resources.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@protobase/schema": "0.
|
|
32
|
+
"@protobase/schema": "0.118.1",
|
|
33
33
|
"kysely": "^0.29.6"
|
|
34
34
|
}
|
|
35
35
|
}
|