@atscript/db-sqlite 0.1.183 → 0.1.185
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/index.cjs +1 -1
- package/dist/index.mjs +2 -2
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -2262,7 +2262,7 @@ var SqliteAdapter = class SqliteAdapter extends _atscript_db.BaseDbAdapter {
|
|
|
2262
2262
|
const metric = similarityToVecMetric(vec.similarity) === "l2" ? "euclidean" : "cosine";
|
|
2263
2263
|
return {
|
|
2264
2264
|
source: {
|
|
2265
|
-
sql: `SELECT t.*, v.distance AS
|
|
2265
|
+
sql: `SELECT t.*, v.distance AS "${_atscript_db_sql_tools.VECTOR_DISTANCE_ALIAS}" FROM "${esc(vecTable)}" v JOIN "${esc(tableName)}" t ON t.rowid = v.rowid WHERE ${innerWhereParts.join(" AND ")}`,
|
|
2266
2266
|
params
|
|
2267
2267
|
},
|
|
2268
2268
|
limit,
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import { ALL_AGGREGATE_FNS, ALL_BUCKET_UNITS, ALL_ISOLATION_LEVELS, ALL_VIEW_CAPABILITIES, BaseDbAdapter, DB_FULLTEXT_LANGUAGES, DbError, DbSpace, constraintViolation, createChangeRecorder, defaultFulltextIndex, describeFulltext, fkColumns, searchIndexNotFoundMessage, searchTermInteger, splitFulltextFields, vectorIndexNotFoundMessage } from "@atscript/db";
|
|
3
3
|
import { resolveAggregateSearch } from "@atscript/db/agg";
|
|
4
|
-
import { EMPTY_AND, InsertSqlCache, SEARCH_SOURCE_ALIAS, addVectorScore, buildAggregateCount, buildAggregateSelect, buildCreateView, buildDelete, buildGeoSearchCount, buildGeoSearchSelect, buildJsonColumnCopy, buildJsonifyText, buildKeyViolationCount, buildPartitionedSelect, buildSelect, buildUpdate, buildVectorSearchCount, buildVectorSearchSelect, buildWhere as buildWhere$1, defaultValueForType, defaultValueToSqlLiteral, derivedColumnExpr, fillReplacePayload, fromSourceSql, geoWindowFromControls, jsonDollarPath, orFragment, orderByList, parseRegexString, refActionToSql, renameGeoDistance, replaceColumnsFor, searchRankOrder, sqlStringLiteral, sqlTimeZoneLiteral, stripPartitionRowNumber, toSqlValue, unquoteSqlStringLiteral, vectorMaxDistance, viewReadSource, writeLimitWhere } from "@atscript/db-sql-tools";
|
|
4
|
+
import { EMPTY_AND, InsertSqlCache, SEARCH_SOURCE_ALIAS, VECTOR_DISTANCE_ALIAS, addVectorScore, buildAggregateCount, buildAggregateSelect, buildCreateView, buildDelete, buildGeoSearchCount, buildGeoSearchSelect, buildJsonColumnCopy, buildJsonifyText, buildKeyViolationCount, buildPartitionedSelect, buildSelect, buildUpdate, buildVectorSearchCount, buildVectorSearchSelect, buildWhere as buildWhere$1, defaultValueForType, defaultValueToSqlLiteral, derivedColumnExpr, fillReplacePayload, fromSourceSql, geoWindowFromControls, jsonDollarPath, orFragment, orderByList, parseRegexString, refActionToSql, renameGeoDistance, replaceColumnsFor, searchRankOrder, sqlStringLiteral, sqlTimeZoneLiteral, stripPartitionRowNumber, toSqlValue, unquoteSqlStringLiteral, vectorMaxDistance, viewReadSource, writeLimitWhere } from "@atscript/db-sql-tools";
|
|
5
5
|
import { bucketer } from "@uniqu/core";
|
|
6
6
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
7
|
//#region src/better-sqlite3-driver.ts
|
|
@@ -2261,7 +2261,7 @@ var SqliteAdapter = class SqliteAdapter extends BaseDbAdapter {
|
|
|
2261
2261
|
const metric = similarityToVecMetric(vec.similarity) === "l2" ? "euclidean" : "cosine";
|
|
2262
2262
|
return {
|
|
2263
2263
|
source: {
|
|
2264
|
-
sql: `SELECT t.*, v.distance AS
|
|
2264
|
+
sql: `SELECT t.*, v.distance AS "${VECTOR_DISTANCE_ALIAS}" FROM "${esc(vecTable)}" v JOIN "${esc(tableName)}" t ON t.rowid = v.rowid WHERE ${innerWhereParts.join(" AND ")}`,
|
|
2265
2265
|
params
|
|
2266
2266
|
},
|
|
2267
2267
|
limit,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/db-sqlite",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.185",
|
|
4
4
|
"description": "SQLite adapter for @atscript/db with swappable driver support.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"atscript",
|
|
@@ -36,23 +36,23 @@
|
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@atscript/db-sql-tools": "^0.1.
|
|
39
|
+
"@atscript/db-sql-tools": "^0.1.185"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@atscript/core": "^0.2.
|
|
43
|
-
"@atscript/typescript": "^0.2.
|
|
42
|
+
"@atscript/core": "^0.2.14",
|
|
43
|
+
"@atscript/typescript": "^0.2.14",
|
|
44
44
|
"@types/better-sqlite3": "^7.6.13",
|
|
45
45
|
"@uniqu/core": "^0.2.2",
|
|
46
46
|
"better-sqlite3": "^12.6.2",
|
|
47
47
|
"sqlite-vec": "^0.1.9",
|
|
48
|
-
"unplugin-atscript": "^0.2.
|
|
48
|
+
"unplugin-atscript": "^0.2.14"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@atscript/core": "^0.2.
|
|
52
|
-
"@atscript/typescript": "^0.2.
|
|
51
|
+
"@atscript/core": "^0.2.14",
|
|
52
|
+
"@atscript/typescript": "^0.2.14",
|
|
53
53
|
"@uniqu/core": "^0.2.2",
|
|
54
54
|
"better-sqlite3": ">=11.0.0",
|
|
55
|
-
"@atscript/db": "^0.1.
|
|
55
|
+
"@atscript/db": "^0.1.185"
|
|
56
56
|
},
|
|
57
57
|
"peerDependenciesMeta": {
|
|
58
58
|
"better-sqlite3": {
|