@proteinjs/db 1.47.0 → 1.47.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proteinjs/db",
3
- "version": "1.47.0",
3
+ "version": "1.47.1",
4
4
  "main": "./dist/generated/index.js",
5
5
  "types": "./dist/generated/index.d.ts",
6
6
  "exports": {
@@ -41,7 +41,7 @@
41
41
  "test": "jest --passWithNoTests"
42
42
  },
43
43
  "dependencies": {
44
- "@proteinjs/db-query": "^1.10.0",
44
+ "@proteinjs/db-query": "^1.10.1",
45
45
  "@proteinjs/logger": "^1.0.21",
46
46
  "@proteinjs/reflection": "^1.2.0",
47
47
  "@proteinjs/serializer": "^1.1.10",
@@ -66,5 +66,5 @@
66
66
  "ts-jest": "29.1.1",
67
67
  "typescript": "5.2.2"
68
68
  },
69
- "gitHead": "ed0fb780bf900daefb251880e49c330e7d818a1f"
69
+ "gitHead": "ad0e3db9563d9be4277af86e6c942d7ae4d811f6"
70
70
  }
package/src/Db.ts CHANGED
@@ -13,7 +13,7 @@ import { ReverseCascadeEdgeIndex } from './ReverseCascadeEdgeIndex';
13
13
  import { Record, RecordSerializer, SerializedRecord } from './Record';
14
14
  import { Logger } from '@proteinjs/logger';
15
15
  import { SourceRecordLoader } from './source/SourceRecordLoader';
16
- import { ParameterizationConfig, QueryBuilder, Statement, StatementFactory } from '@proteinjs/db-query';
16
+ import { ParameterizationConfig, ParamType, QueryBuilder, Statement, StatementFactory } from '@proteinjs/db-query';
17
17
  import { QueryBuilderFactory } from './QueryBuilderFactory';
18
18
  import { StatementConfigFactory } from './StatementConfigFactory';
19
19
  import { TableManager } from './schema/TableManager';
@@ -60,11 +60,15 @@ export type DbDriverQueryStatementConfig = ParameterizationConfig & {
60
60
  handleCaseSensitivity: (tableName: string, columnName: string, caseSensitive: boolean) => string;
61
61
  /** Driver SQL for truncating a datetime column to a bucket unit (`QueryBuilder.timeBucket`). */
62
62
  dateTruncExpression?: (resolvedColumnName: string, unit: 'day' | 'hour' | 'minute') => string;
63
+ /** Driver SQL standing in for a bound param's placeholder, by driver type (`StatementConfig.paramExpression`). */
64
+ paramExpression?: (placeholder: string, type: ParamType) => string;
63
65
  };
64
66
 
65
67
  export type DbDriverDmlStatementConfig = ParameterizationConfig & {
66
68
  prefixTablesWithDb?: boolean;
67
69
  getDriverColumnType?: (tableName: string, columnName: string) => string;
70
+ /** Driver SQL standing in for a bound param's placeholder, by driver type (`StatementConfig.paramExpression`). */
71
+ paramExpression?: (placeholder: string, type: ParamType) => string;
68
72
  };
69
73
 
70
74
  export interface DefaultDbDriverFactory extends Loadable {
@@ -34,6 +34,7 @@ export class StatementConfigFactory {
34
34
  useNamedParams: config.useNamedParams,
35
35
  getColumnType: this.getColumnType(),
36
36
  getDriverColumnType: config.getDriverColumnType,
37
+ paramExpression: config.paramExpression,
37
38
  ...(this.isQueryConfig(config) && {
38
39
  handleCaseSensitivity: config.handleCaseSensitivity,
39
40
  dateTruncExpression: config.dateTruncExpression,