data-finder-ts 0.1.4 → 0.1.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.
Files changed (58) hide show
  1. package/dist/{chunk-4JVW4TAB.js → chunk-BGEX377Q.js} +58 -8
  2. package/dist/chunk-BGEX377Q.js.map +1 -0
  3. package/dist/chunk-BKPWV3OF.js +962 -0
  4. package/dist/chunk-BKPWV3OF.js.map +1 -0
  5. package/dist/{chunk-PMPLCEWQ.js → chunk-GPHWC533.js} +2 -2
  6. package/dist/{chunk-FJYA2ASS.js → chunk-KAK75RVS.js} +74 -12
  7. package/dist/chunk-KAK75RVS.js.map +1 -0
  8. package/dist/{chunk-4LNZV6EN.js → chunk-MGEL5RWM.js} +206 -78
  9. package/dist/chunk-MGEL5RWM.js.map +1 -0
  10. package/dist/chunk-PF6EJZHB.js +1015 -0
  11. package/dist/chunk-PF6EJZHB.js.map +1 -0
  12. package/dist/datafinder/attribute.cjs +537 -11
  13. package/dist/datafinder/attribute.cjs.map +1 -1
  14. package/dist/datafinder/attribute.d.cts +29 -7
  15. package/dist/datafinder/attribute.d.ts +29 -7
  16. package/dist/datafinder/attribute.js +2 -2
  17. package/dist/datafinder/runner.cjs +1267 -215
  18. package/dist/datafinder/runner.cjs.map +1 -1
  19. package/dist/datafinder/runner.d.cts +28 -5
  20. package/dist/datafinder/runner.d.ts +28 -5
  21. package/dist/datafinder/runner.js +6 -6
  22. package/dist/datafinder/sql-generator.cjs +1203 -206
  23. package/dist/datafinder/sql-generator.cjs.map +1 -1
  24. package/dist/datafinder/sql-generator.d.cts +19 -5
  25. package/dist/datafinder/sql-generator.d.ts +19 -5
  26. package/dist/datafinder/sql-generator.js +9 -5
  27. package/dist/datafinder/typed-attributes.cjs +693 -88
  28. package/dist/datafinder/typed-attributes.cjs.map +1 -1
  29. package/dist/datafinder/typed-attributes.d.cts +3 -242
  30. package/dist/datafinder/typed-attributes.d.ts +3 -242
  31. package/dist/datafinder/typed-attributes.js +3 -3
  32. package/dist/dialect-CogGPm_y.d.cts +38 -0
  33. package/dist/dialect-aaG1bDi5.d.ts +38 -0
  34. package/dist/index.cjs +1677 -408
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.cts +109 -5
  37. package/dist/index.d.ts +109 -5
  38. package/dist/index.js +321 -11
  39. package/dist/index.js.map +1 -1
  40. package/dist/model/milestoning.cjs +529 -0
  41. package/dist/model/milestoning.cjs.map +1 -1
  42. package/dist/model/milestoning.js +2 -2
  43. package/dist/model/relational.cjs +547 -16
  44. package/dist/model/relational.cjs.map +1 -1
  45. package/dist/model/relational.d.cts +421 -57
  46. package/dist/model/relational.d.ts +421 -57
  47. package/dist/model/relational.js +53 -3
  48. package/dist/typed-attributes-CUTf_6Ru.d.ts +328 -0
  49. package/dist/typed-attributes-CdWXq_78.d.cts +328 -0
  50. package/package.json +3 -2
  51. package/dist/chunk-4JVW4TAB.js.map +0 -1
  52. package/dist/chunk-4LNZV6EN.js.map +0 -1
  53. package/dist/chunk-FJYA2ASS.js.map +0 -1
  54. package/dist/chunk-MH4XMYVB.js +0 -696
  55. package/dist/chunk-MH4XMYVB.js.map +0 -1
  56. package/dist/chunk-UYMOE6YU.js +0 -509
  57. package/dist/chunk-UYMOE6YU.js.map +0 -1
  58. /package/dist/{chunk-PMPLCEWQ.js.map → chunk-GPHWC533.js.map} +0 -0
@@ -1,8 +1,22 @@
1
1
  import { Attribute } from './attribute.cjs';
2
- import { SelectOperation, RelationalOperationElement, Table, SortOperation } from '../model/relational.cjs';
2
+ import { SelectOperation, RelationalOperationElement, Table, SortOperation, Operation, ArithmeticOperation, LogicalOperation } from '../model/relational.cjs';
3
+ import { b as DialectName, S as SqlDialect } from '../dialect-CogGPm_y.cjs';
3
4
 
4
- declare function buildQueryOperation(businessDate: Date | null, processingDatetime: Date | null, columns: (Attribute | RelationalOperationElement)[], table: Table, op: RelationalOperationElement, orderBy?: SortOperation[], groupBy?: Attribute[], limit?: number, businessDateTo?: Date | null): SelectOperation;
5
- declare function selectSqlToString(selectOperation: SelectOperation): string;
6
- declare function toSql(businessDate: Date | null, processingDatetime: Date | null, columns: (Attribute | RelationalOperationElement)[], table: Table, op: RelationalOperationElement, orderBy?: SortOperation[], groupBy?: Attribute[], limit?: number, businessDateTo?: Date | null): string;
5
+ /**
6
+ * Whether `child` must be parenthesised as an operand of `parent`: it binds more loosely than the parent, or it
7
+ * is the right operand of a - or / and binds equally (a - (b - c) is not a - b - c).
8
+ */
9
+ declare function arithmeticNeedsParentheses(parent: ArithmeticOperation, child: RelationalOperationElement, onRight: boolean): boolean;
10
+ declare function buildQueryOperation(businessDate: Date | null, processingDatetime: Date | null, columns: (Attribute | RelationalOperationElement)[], table: Table, op: RelationalOperationElement, orderBy?: SortOperation[], groupBy?: Attribute[], limit?: number, businessDateTo?: Date | null, distinct?: boolean, offset?: number, having?: Operation): SelectOperation;
11
+ /**
12
+ * Whether `child` must be parenthesised where it is an operand of `parent`.
13
+ *
14
+ * A logical operation nested in one with a different operator is parenthesised: OR inside AND would
15
+ * otherwise change meaning, and AND inside OR is easier to read. The same operator needs none, since
16
+ * AND and OR are associative, so a AND (b AND c) is a AND b AND c.
17
+ */
18
+ declare function needsParentheses(parent: LogicalOperation, child: RelationalOperationElement): boolean;
19
+ declare function selectSqlToString(selectOperation: SelectOperation, dialect?: DialectName | SqlDialect): string;
20
+ declare function toSql(businessDate: Date | null, processingDatetime: Date | null, columns: (Attribute | RelationalOperationElement)[], table: Table, op: RelationalOperationElement, orderBy?: SortOperation[], groupBy?: Attribute[], limit?: number, businessDateTo?: Date | null, distinct?: boolean, offset?: number, having?: Operation, dialect?: DialectName | SqlDialect): string;
7
21
 
8
- export { buildQueryOperation, selectSqlToString, toSql };
22
+ export { arithmeticNeedsParentheses, buildQueryOperation, needsParentheses, selectSqlToString, toSql };
@@ -1,8 +1,22 @@
1
1
  import { Attribute } from './attribute.js';
2
- import { SelectOperation, RelationalOperationElement, Table, SortOperation } from '../model/relational.js';
2
+ import { SelectOperation, RelationalOperationElement, Table, SortOperation, Operation, ArithmeticOperation, LogicalOperation } from '../model/relational.js';
3
+ import { b as DialectName, S as SqlDialect } from '../dialect-aaG1bDi5.js';
3
4
 
4
- declare function buildQueryOperation(businessDate: Date | null, processingDatetime: Date | null, columns: (Attribute | RelationalOperationElement)[], table: Table, op: RelationalOperationElement, orderBy?: SortOperation[], groupBy?: Attribute[], limit?: number, businessDateTo?: Date | null): SelectOperation;
5
- declare function selectSqlToString(selectOperation: SelectOperation): string;
6
- declare function toSql(businessDate: Date | null, processingDatetime: Date | null, columns: (Attribute | RelationalOperationElement)[], table: Table, op: RelationalOperationElement, orderBy?: SortOperation[], groupBy?: Attribute[], limit?: number, businessDateTo?: Date | null): string;
5
+ /**
6
+ * Whether `child` must be parenthesised as an operand of `parent`: it binds more loosely than the parent, or it
7
+ * is the right operand of a - or / and binds equally (a - (b - c) is not a - b - c).
8
+ */
9
+ declare function arithmeticNeedsParentheses(parent: ArithmeticOperation, child: RelationalOperationElement, onRight: boolean): boolean;
10
+ declare function buildQueryOperation(businessDate: Date | null, processingDatetime: Date | null, columns: (Attribute | RelationalOperationElement)[], table: Table, op: RelationalOperationElement, orderBy?: SortOperation[], groupBy?: Attribute[], limit?: number, businessDateTo?: Date | null, distinct?: boolean, offset?: number, having?: Operation): SelectOperation;
11
+ /**
12
+ * Whether `child` must be parenthesised where it is an operand of `parent`.
13
+ *
14
+ * A logical operation nested in one with a different operator is parenthesised: OR inside AND would
15
+ * otherwise change meaning, and AND inside OR is easier to read. The same operator needs none, since
16
+ * AND and OR are associative, so a AND (b AND c) is a AND b AND c.
17
+ */
18
+ declare function needsParentheses(parent: LogicalOperation, child: RelationalOperationElement): boolean;
19
+ declare function selectSqlToString(selectOperation: SelectOperation, dialect?: DialectName | SqlDialect): string;
20
+ declare function toSql(businessDate: Date | null, processingDatetime: Date | null, columns: (Attribute | RelationalOperationElement)[], table: Table, op: RelationalOperationElement, orderBy?: SortOperation[], groupBy?: Attribute[], limit?: number, businessDateTo?: Date | null, distinct?: boolean, offset?: number, having?: Operation, dialect?: DialectName | SqlDialect): string;
7
21
 
8
- export { buildQueryOperation, selectSqlToString, toSql };
22
+ export { arithmeticNeedsParentheses, buildQueryOperation, needsParentheses, selectSqlToString, toSql };
@@ -1,14 +1,18 @@
1
1
  import {
2
+ arithmeticNeedsParentheses,
2
3
  buildQueryOperation,
4
+ needsParentheses,
3
5
  selectSqlToString,
4
6
  toSql
5
- } from "../chunk-MH4XMYVB.js";
6
- import "../chunk-PMPLCEWQ.js";
7
- import "../chunk-4LNZV6EN.js";
8
- import "../chunk-4JVW4TAB.js";
9
- import "../chunk-UYMOE6YU.js";
7
+ } from "../chunk-BKPWV3OF.js";
8
+ import "../chunk-GPHWC533.js";
9
+ import "../chunk-MGEL5RWM.js";
10
+ import "../chunk-BGEX377Q.js";
11
+ import "../chunk-PF6EJZHB.js";
10
12
  export {
13
+ arithmeticNeedsParentheses,
11
14
  buildQueryOperation,
15
+ needsParentheses,
12
16
  selectSqlToString,
13
17
  toSql
14
18
  };