@spytecgps/nova-orm 1.1.0 → 1.1.1-rc1

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.
@@ -1,7 +1,8 @@
1
- import { DataSource, EntityTarget, LoggerOptions, ObjectLiteral, QueryRunner, ReplicationMode, Repository, SelectQueryBuilder } from 'typeorm';
1
+ import { DataSource, EntityTarget, LoggerOptions, ObjectLiteral, QueryBuilder, QueryRunner, ReplicationMode, Repository, SelectQueryBuilder } from 'typeorm';
2
2
  import { BaseSelectQueryParams } from './types/common';
3
3
  import { Logger } from './types/logger';
4
4
  export type queryBuilderHandler<T> = (novaDataSource: NovaDataSource, queryRunner?: QueryRunner) => Promise<T>;
5
+ export type SafeQuery3Callback<T> = (queryBuilder: QueryBuilder<T>) => Promise<T[]>;
5
6
  export interface NovaDataSourceConfig {
6
7
  /**
7
8
  * Database username.
@@ -32,6 +33,10 @@ export interface NovaDataSourceConfig {
32
33
  */
33
34
  logging?: LoggerOptions;
34
35
  }
36
+ interface SafeQuery3Options {
37
+ tag?: string;
38
+ replicationMode?: ReplicationMode;
39
+ }
35
40
  export declare class NovaDataSource {
36
41
  protected readonly dataSource: DataSource;
37
42
  protected readonly logger: Logger;
@@ -71,4 +76,6 @@ export declare class NovaDataSource {
71
76
  createQueryRunnerFromParams(params: BaseSelectQueryParams): QueryRunner;
72
77
  safeQuery<T>(queryBuilderHandler: queryBuilderHandler<T>, tag?: string, queryRunner?: QueryRunner): Promise<T>;
73
78
  safeQuery2<T>(queryBuilderHandler: queryBuilderHandler<T>, tag?: string, queryRunner?: QueryRunner): Promise<T>;
79
+ safeQuery3<Entity extends ObjectLiteral>(target: EntityTarget<Entity>, callback: SafeQuery3Callback<Entity>, { replicationMode, tag }?: SafeQuery3Options): Promise<Entity[]>;
74
80
  }
81
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "1.1.0",
3
+ "version": "1.1.1-rc1",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",