sql-love 1.0.5 → 1.1.0

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/dist/index.d.ts CHANGED
@@ -320,7 +320,7 @@ export declare class SelectBuilder {
320
320
  /**
321
321
  * Add a WHERE clause with a BETWEEN condition
322
322
  * @param column The column name
323
- * @param twoValueArray The two values to be between
323
+ * @param twoValueArray The two values to be between. If the first is null, it will use >= instead. If the second is null, it will use <= instead. If both are null, no criteria will be added
324
324
  */
325
325
  whereBetween(column: string, twoValueArray: [
326
326
  any,
@@ -350,21 +350,31 @@ export declare class SelectBuilder {
350
350
  * @param column The column name or expression to sort by. Include DESC or prefix with - to sort descending
351
351
  * @param [direction] The direction to sort by (ASC or DESC)
352
352
  * @example
353
- * query.sortField('modified_at'); // ORDER BY modified_at
354
- * query.sortField('-modified_at'); // ORDER BY modified_at DESC
355
- * query.sortField('COUNT(*)'); // ORDER BY COUNT(*)
356
- * query.sortField('COUNT(*) DESC'); // ORDER BY COUNT(*) DESC
353
+ * query.orderBy('modified_at'); // ORDER BY modified_at
354
+ * query.orderBy('-modified_at'); // ORDER BY modified_at DESC
355
+ * query.orderBy('COUNT(*)'); // ORDER BY COUNT(*)
356
+ * query.orderBy('COUNT(*) DESC'); // ORDER BY COUNT(*) DESC
357
+ * query.orderBy('modified_at DESC NULLS LAST'); // ORDER BY modified_at DESC NULLS LAST
358
+ * query.orderBy('modified_at USING >'); // ORDER BY modified_at USING >
357
359
  */
358
360
  orderBy(column: string, direction?: "ASC" | "DESC"): this;
359
361
  /**
360
362
  * Sort by the given column, with a map of columns to translate
361
- * @param fieldName The file name such as "created_at" or "-created_at" for descending
363
+ * @param fieldName The file name such as 'created_at' or '-created_at' for descending
362
364
  * @param [mapNames] Column names to translate from field to column expression
365
+ * @param [modifier] Additional clause to append such as 'NULLS LAST' or 'COLLATE "en_US"'
363
366
  * @example
364
367
  * query.sortField('-modified_at'); // ORDER BY modified_at DESC
365
368
  * query.sortField('-created', {'created': 'created_at'}); // ORDER BY created_at DESC
366
- */
367
- sortField(fieldName: string, mapNames?: Record<string, string>): this;
369
+ * query.sortField('-created', {
370
+ * 'created': 'created_at NULLS LAST',
371
+ * '-created': 'created_at DESC NULLS LAST'
372
+ * }); // ORDER BY created_at DESC NULLS LAST
373
+ * query.sortField('-name', {
374
+ * 'name': 'name COLLATE "jp_JP"'
375
+ * }); // ORDER BY name COLLATE "jp_JP" DESC
376
+ */
377
+ sortField(fieldName: string, mapNames?: Record<string, string>, modifier?: string): this;
368
378
  /**
369
379
  * Check to see if the given string is 0 or all digits not starting with 0
370
380
  * @param string The input string