@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/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as lazy } from "./lazy-C7IyM4M4.mjs";
2
- import { t as generateFromSchema } from "./generate-B4w-hX0K.mjs";
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.3";
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
- await input.db.execute(sql`CREATE EXTENSION IF NOT EXISTS pg_trgm;`);
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
- await input.db.execute(sql.raw(`ALTER DATABASE ${dbName} SET pg_trgm.similarity_threshold = ${threshold};`));
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`);