create-prisma-php-app 1.16.30 → 1.16.31

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.
@@ -248,8 +248,10 @@ abstract class Utility
248
248
  case 'endsWith':
249
249
  case 'equals':
250
250
  case 'not':
251
- if ($val === null || $val === '') {
252
- $sqlConditions[] = $condition === 'not' ? "$fieldQuoted IS NOT NULL" : "$fieldQuoted IS NULL";
251
+ if ($val === null) {
252
+ $sqlConditions[] = "$fieldQuoted IS NOT NULL";
253
+ } elseif ($val === '') {
254
+ $sqlConditions[] = "$fieldQuoted != ''";
253
255
  } else {
254
256
  $validatedValue = Validator::string($val);
255
257
  $likeOperator = $condition === 'contains' ? ($dbType == 'pgsql' ? 'ILIKE' : 'LIKE') : '=';
@@ -274,7 +276,6 @@ abstract class Utility
274
276
  $inPlaceholders = [];
275
277
  foreach ($val as $i => $inVal) {
276
278
  $inKey = $bindingKey . "_" . $i;
277
- // Assuming the values are strings; adjust validation as necessary.
278
279
  $validatedValue = Validator::string($inVal);
279
280
  $inPlaceholders[] = $inKey;
280
281
  $bindings[$inKey] = $validatedValue;
@@ -289,12 +290,16 @@ abstract class Utility
289
290
  }
290
291
  }
291
292
  } else {
292
- // For scalar non-array values; direct equals condition assumed
293
- $bindingKey = ":" . $prefix . $key . $level;
294
- // Use appropriate validation based on expected type; assuming string for simplicity
295
- $validatedValue = Validator::string($value);
296
- $sqlConditions[] = "$fieldQuoted = $bindingKey";
297
- $bindings[$bindingKey] = $validatedValue;
293
+ if ($value === null) {
294
+ $sqlConditions[] = "$fieldQuoted IS NULL";
295
+ } elseif ($value === '') {
296
+ $sqlConditions[] = "$fieldQuoted = ''";
297
+ } else {
298
+ $bindingKey = ":" . $prefix . $key . $level;
299
+ $validatedValue = Validator::string($value);
300
+ $sqlConditions[] = "$fieldQuoted = $bindingKey";
301
+ $bindings[$bindingKey] = $validatedValue;
302
+ }
298
303
  }
299
304
  }
300
305
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "1.16.30",
3
+ "version": "1.16.31",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",