@m1212e/rumble 0.21.3 → 0.21.5
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/out/client/generate.cjs +1 -1
- package/out/client/generate.mjs +1 -1
- package/out/{generate-B4w-hX0K.mjs → generate-0QFVc3Sg.mjs} +10 -5
- package/out/generate-0QFVc3Sg.mjs.map +1 -0
- package/out/{generate-Ch5LEiBr.cjs → generate-CM3XjmlO.cjs} +10 -5
- package/out/generate-CM3XjmlO.cjs.map +1 -0
- package/out/index.cjs +13 -4
- package/out/index.cjs.map +1 -1
- package/out/index.mjs +13 -4
- package/out/index.mjs.map +1 -1
- package/package.json +1 -1
- package/out/generate-B4w-hX0K.mjs.map +0 -1
- package/out/generate-Ch5LEiBr.cjs.map +0 -1
package/out/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as lazy } from "./lazy-C7IyM4M4.mjs";
|
|
2
|
-
import { t as generateFromSchema } from "./generate-
|
|
2
|
+
import { t as generateFromSchema } from "./generate-0QFVc3Sg.mjs";
|
|
3
3
|
import { GraphQLError } from "graphql";
|
|
4
4
|
import { EnvelopArmorPlugin } from "@escape.tech/graphql-armor";
|
|
5
5
|
import { useDisableIntrospection } from "@graphql-yoga/plugin-disable-introspection";
|
|
@@ -180,7 +180,7 @@ function mapNullFieldsToUndefined(obj) {
|
|
|
180
180
|
}
|
|
181
181
|
//#endregion
|
|
182
182
|
//#region package.json
|
|
183
|
-
var version = "0.21.
|
|
183
|
+
var version = "0.21.5";
|
|
184
184
|
//#endregion
|
|
185
185
|
//#region lib/helpers/mergeFilters.ts
|
|
186
186
|
function mergeFilters(filterA, filterB, mode = "AND") {
|
|
@@ -1111,12 +1111,21 @@ async function initSearchIfApplicable(input) {
|
|
|
1111
1111
|
console.info("Database dialect is not compatible with search, skipping search initialization. Only PostgreSQL is supported.");
|
|
1112
1112
|
return;
|
|
1113
1113
|
}
|
|
1114
|
-
|
|
1114
|
+
try {
|
|
1115
|
+
await input.db.execute(sql`CREATE EXTENSION IF NOT EXISTS pg_trgm;`);
|
|
1116
|
+
} catch (error) {
|
|
1117
|
+
console.error("Failed to create pg_trgm extension. Search functionality may not work. Ensure the database user has CREATE privilege or the extension is pre-installed.", error);
|
|
1118
|
+
return;
|
|
1119
|
+
}
|
|
1115
1120
|
if (input.search?.threshold) {
|
|
1116
1121
|
const threshold = Number(input.search.threshold);
|
|
1117
1122
|
if (threshold < 0 || threshold > 1) throw new Error(`Search threshold must be between 0 and 1`);
|
|
1118
1123
|
const dbName = (await input.db.execute(sql`SELECT current_database()`)).rows[0].current_database;
|
|
1119
|
-
|
|
1124
|
+
try {
|
|
1125
|
+
await input.db.execute(sql.raw(`ALTER DATABASE ${dbName} SET pg_trgm.similarity_threshold = ${threshold};`));
|
|
1126
|
+
} catch (error) {
|
|
1127
|
+
if (error?.cause?.code !== "XX000" && error?.code !== "XX000") throw error;
|
|
1128
|
+
}
|
|
1120
1129
|
}
|
|
1121
1130
|
if (input.search?.cpu_operator_cost) {
|
|
1122
1131
|
if (typeof input.search.cpu_operator_cost !== "number") throw new Error(`CPU operator cost must be a number`);
|