@kernl-sdk/pg 0.1.25 → 0.1.26
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +9 -0
- package/dist/__tests__/memory-integration.test.js +1 -1
- package/dist/pgvector/__tests__/handle.test.js +13 -13
- package/dist/pgvector/__tests__/integration/document.integration.test.js +21 -21
- package/dist/pgvector/__tests__/integration/edge.integration.test.js +32 -32
- package/dist/pgvector/__tests__/integration/filters.integration.test.js +5 -5
- package/dist/pgvector/__tests__/integration/lifecycle.integration.test.js +12 -12
- package/dist/pgvector/__tests__/integration/query.integration.test.d.ts +1 -1
- package/dist/pgvector/__tests__/integration/query.integration.test.js +51 -51
- package/dist/pgvector/__tests__/search.test.js +1 -1
- package/dist/pgvector/sql/__tests__/limit.test.js +20 -20
- package/dist/pgvector/sql/__tests__/query.test.js +17 -17
- package/dist/pgvector/sql/limit.js +2 -2
- package/dist/pgvector/sql/query.d.ts +1 -1
- package/dist/pgvector/sql/query.d.ts.map +1 -1
- package/dist/pgvector/sql/query.js +1 -1
- package/package.json +6 -6
- package/src/__tests__/memory-integration.test.ts +1 -1
- package/src/pgvector/__tests__/handle.test.ts +13 -13
- package/src/pgvector/__tests__/integration/document.integration.test.ts +21 -21
- package/src/pgvector/__tests__/integration/edge.integration.test.ts +32 -32
- package/src/pgvector/__tests__/integration/filters.integration.test.ts +5 -5
- package/src/pgvector/__tests__/integration/lifecycle.integration.test.ts +12 -12
- package/src/pgvector/__tests__/integration/query.integration.test.ts +51 -51
- package/src/pgvector/__tests__/search.test.ts +1 -1
- package/src/pgvector/sql/__tests__/limit.test.ts +20 -20
- package/src/pgvector/sql/__tests__/query.test.ts +17 -17
- package/src/pgvector/sql/limit.ts +2 -2
- package/src/pgvector/sql/query.ts +2 -2
|
@@ -7,13 +7,13 @@ import type { SQLClause } from "./select";
|
|
|
7
7
|
* Codec for building sql LIMIT clause.
|
|
8
8
|
*/
|
|
9
9
|
export const SQL_LIMIT: Codec<LimitInput, SQLClause> = {
|
|
10
|
-
encode({
|
|
10
|
+
encode({ limit, offset, startIdx }) {
|
|
11
11
|
const parts: string[] = [];
|
|
12
12
|
const params: unknown[] = [];
|
|
13
13
|
let idx = startIdx;
|
|
14
14
|
|
|
15
15
|
parts.push(`LIMIT $${idx++}`);
|
|
16
|
-
params.push(
|
|
16
|
+
params.push(limit);
|
|
17
17
|
|
|
18
18
|
if (offset > 0) {
|
|
19
19
|
parts.push(`OFFSET $${idx++}`);
|
|
@@ -67,7 +67,7 @@ export function sqlize(query: SearchQuery, config: SqlizeConfig): SqlizedQuery {
|
|
|
67
67
|
schema: config.schema,
|
|
68
68
|
table: config.table,
|
|
69
69
|
},
|
|
70
|
-
limit: {
|
|
70
|
+
limit: { limit: query.limit ?? 10, offset: query.offset ?? 0 },
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -106,7 +106,7 @@ export interface OrderInput {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
export interface LimitInput {
|
|
109
|
-
|
|
109
|
+
limit: number;
|
|
110
110
|
offset: number;
|
|
111
111
|
startIdx: number;
|
|
112
112
|
}
|