@m1212e/rumble 0.21.2 → 0.21.4

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.cjs CHANGED
@@ -208,7 +208,7 @@ function mapNullFieldsToUndefined(obj) {
208
208
  }
209
209
  //#endregion
210
210
  //#region package.json
211
- var version = "0.21.2";
211
+ var version = "0.21.4";
212
212
  //#endregion
213
213
  //#region lib/helpers/mergeFilters.ts
214
214
  function mergeFilters(filterA, filterB, mode = "AND") {
@@ -814,10 +814,9 @@ const createEnumImplementer = ({ schema, schemaBuilder }) => {
814
814
  }
815
815
  if (!enumSchemaName || !enumValues) throw new RumbleError("Could not determine enum structure!");
816
816
  const graphqlImplementationName = refName ?? `${(0, es_toolkit.capitalize)((0, drizzle_orm_casing.toCamelCase)(enumSchemaName))}Enum`;
817
- let ret = referenceStorage.get(graphqlImplementationName);
818
- if (ret) return ret;
819
- const implement = () => schemaBuilder.enumType(graphqlImplementationName, { values: enumValues });
820
- ret = implement();
817
+ const cached = referenceStorage.get(graphqlImplementationName);
818
+ if (cached) return cached;
819
+ const ret = schemaBuilder.enumType(graphqlImplementationName, { values: enumValues });
821
820
  referenceStorage.set(graphqlImplementationName, ret);
822
821
  return ret;
823
822
  };
@@ -1140,7 +1139,12 @@ async function initSearchIfApplicable(input) {
1140
1139
  console.info("Database dialect is not compatible with search, skipping search initialization. Only PostgreSQL is supported.");
1141
1140
  return;
1142
1141
  }
1143
- await input.db.execute(drizzle_orm.sql`CREATE EXTENSION IF NOT EXISTS pg_trgm;`);
1142
+ try {
1143
+ await input.db.execute(drizzle_orm.sql`CREATE EXTENSION IF NOT EXISTS pg_trgm;`);
1144
+ } catch (error) {
1145
+ 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);
1146
+ return;
1147
+ }
1144
1148
  if (input.search?.threshold) {
1145
1149
  const threshold = Number(input.search.threshold);
1146
1150
  if (threshold < 0 || threshold > 1) throw new Error(`Search threshold must be between 0 and 1`);