@anfenn/dync 1.0.20 → 1.0.22

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.
@@ -2356,7 +2356,7 @@ var buildCondition = (condition) => {
2356
2356
  switch (condition.type) {
2357
2357
  case "equals": {
2358
2358
  if (condition.caseInsensitive) {
2359
- return { clause: `LOWER(${col}) = LOWER(?)`, parameters: [condition.value] };
2359
+ return { clause: `${col} = ? COLLATE NOCASE`, parameters: [condition.value] };
2360
2360
  }
2361
2361
  return { clause: `${col} = ?`, parameters: [condition.value] };
2362
2362
  }
@@ -2378,7 +2378,7 @@ var buildCondition = (condition) => {
2378
2378
  const placeholders = condition.values.map(() => "?").join(", ");
2379
2379
  if (condition.caseInsensitive) {
2380
2380
  return {
2381
- clause: `LOWER(${col}) IN (${condition.values.map(() => "LOWER(?)").join(", ")})`,
2381
+ clause: `${col} COLLATE NOCASE IN (${placeholders})`,
2382
2382
  parameters: condition.values
2383
2383
  };
2384
2384
  }
@@ -2393,9 +2393,10 @@ var buildCondition = (condition) => {
2393
2393
  }
2394
2394
  case "like": {
2395
2395
  if (condition.caseInsensitive) {
2396
- return { clause: `LOWER(${col}) LIKE LOWER(?)`, parameters: [condition.pattern] };
2396
+ return { clause: `${col} LIKE ?`, parameters: [condition.pattern] };
2397
2397
  }
2398
- return { clause: `${col} LIKE ?`, parameters: [condition.pattern] };
2398
+ const globPattern = condition.pattern.replace(/%/g, "*").replace(/_/g, "?");
2399
+ return { clause: `${col} GLOB ?`, parameters: [globPattern] };
2399
2400
  }
2400
2401
  }
2401
2402
  };
@@ -3818,4 +3819,4 @@ export {
3818
3819
  SqliteQueryContext,
3819
3820
  SQLiteAdapter2 as SQLiteAdapter
3820
3821
  };
3821
- //# sourceMappingURL=chunk-I2KQD4DD.js.map
3822
+ //# sourceMappingURL=chunk-YSKDP34Q.js.map