pg-mvc-service 1.0.21 → 1.0.23

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.
@@ -149,7 +149,8 @@ class ValidateValueUtil {
149
149
  case "timestamp[]":
150
150
  isError = this.isErrorTimestamp(v);
151
151
  break;
152
- case "integer[]":
152
+ case "integer[]": // TODO: ここ最大最小のチェックもしないと
153
+ case "real[]": // TODO: ここ最大最小 + 桁数のチェックもしないと
153
154
  isError = this.isErrorNumber(v);
154
155
  break;
155
156
  case "bool[]":
@@ -92,6 +92,9 @@ class TableModel {
92
92
  this.Offset = (value - 1) * this.PageCount;
93
93
  }
94
94
  }
95
+ get Client() {
96
+ return this.client;
97
+ }
95
98
  constructor(client, tableAlias) {
96
99
  this.dbName = "default";
97
100
  this.tableName = "";
package/index.d.ts CHANGED
@@ -146,87 +146,6 @@ declare module 'pg-mvc-service' {
146
146
  constructor(errorId: string, message?: string);
147
147
  }
148
148
 
149
- // export class TableModel {
150
- // protected readonly dbName: string;
151
- // get DbName(): string;
152
- // protected readonly tableName: string;
153
- // get TableName(): string;
154
- // protected readonly tableDescription: string;
155
- // get TableDescription(): string;
156
- // protected readonly comment: string;
157
- // get Comment(): string;
158
- // protected readonly columns: { [key: string]: TColumn };
159
- // get Columns(): { [key: string]: TColumn };
160
- // protected readonly references: Array<{table: string, columns: Array<{target: string, ref: string}>}>;
161
- // get References(): Array<{table: string, columns: Array<{target: string, ref: string}>}>;
162
- // public GetReferences(columnName: string): Array<{table: string, columns: Array<{target: string, ref: string}>}>;
163
- // get TableAlias(): string;
164
- // public IsOutputLog: boolean;
165
- // public SortKeyword: TSortKeyword;
166
- // public Offset: number;
167
- // public Limit: number;
168
- // public PageCount: number;
169
- // set OffsetPage(value: number);
170
-
171
- // constructor(client: Pool);
172
- // constructor(client: Pool, tableAlias: string);
173
- // constructor(client: PoolClient);
174
- // constructor(client: PoolClient, tableAlias: string);
175
-
176
- // public select(): void;
177
- // public select(columls: Array<string | {name: string, alias?: string, func?: TAggregateFuncType}> | '*'): void;
178
- // public select(columls: Array<string | {name: string, alias?: string, func?: TAggregateFuncType}> | '*', model: TableModel): void;
179
- // public select(columls: Array<string | {name: string, alias?: string, func?: TAggregateFuncType}> | '*', keyFormat: TKeyFormat): void;
180
- // public select(columls: Array<string | {name: string, alias?: string, func?: TAggregateFuncType}> | '*', model: TableModel, keyFormat: TKeyFormat): void;
181
- // public select(expression: string, alias: string): void;
182
-
183
- // public join(joinType: 'left' | 'inner', joinModel: TableModel, conditions: Array<TNestedCondition>): void;
184
-
185
- // public where(expression: string): void;
186
- // public where(conditions: Array<TNestedCondition>): void;
187
- // public where(left: string, operator: TOperator, right: any | TColumnInfo): void;
188
- // public where(left: TColumnInfo, operator: TOperator, right: any | TColumnInfo): void;
189
-
190
- // public find<T = {[key: string]: any}>(pk: {[key: string]: any}, selectColumns: Array<string> | "*" | null, selectExpressions: Array<TSelectExpression> | null, keyFormat: TKeyFormat): Promise<T | null>;
191
- // public find<T = {[key: string]: any}>(pk: {[key: string]: any}, selectColumns: Array<string> | "*" | null, selectExpressions: Array<TSelectExpression> | null): Promise<T | null>;
192
- // public find<T = {[key: string]: any}>(pk: {[key: string]: any}, selectColumns: Array<string> | "*" | null): Promise<T | null>;
193
- // public find<T = {[key: string]: any}>(pk: {[key: string]: any}): Promise<T | null>;
194
-
195
- // public findId<T = {[key: string]: any}>(id: any, selectColumns: Array<string> | "*" | null, selectExpressions: Array<TSelectExpression> | null, keyFormat: TKeyFormat): Promise<T | null>;
196
- // public findId<T = {[key: string]: any}>(id: any, selectColumns: Array<string> | "*" | null, selectExpressions: Array<TSelectExpression> | null): Promise<T | null>;
197
- // public findId<T = {[key: string]: any}>(id: any, selectColumns: Array<string> | "*" | null): Promise<T | null>;
198
- // public findId<T = {[key: string]: any}>(id: any): Promise<T | null>;
199
-
200
- // protected readonly errorMessages: Record<TColumnType | 'length' | 'null' | 'notInput', string>
201
- // protected throwValidationError(code: string, message: string): never;
202
- // protected validateOptions(options: {[key: string]: any}, isInsert: boolean) : Promise<void>;
203
- // protected validateInsert(options: {[key: string]: any}) : Promise<void>;
204
- // protected validateUpdate(options: {[key: string]: any}) : Promise<void>;
205
- // protected validateUpdateId(id: any, options: {[key: string]: any}) : Promise<void>;
206
- // protected validateDelete() : Promise<void>;
207
- // protected validateDeleteId(id: any) : Promise<void>;
208
-
209
- // public executeInsert(options: {[key: string]: any}) : Promise<void>;
210
- // public executeUpdate(options: {[key: string]: any}) : Promise<number>;
211
- // public executeUpdateId(id: any, options: {[key: string]: any}) : Promise<void>;
212
- // public executeDelete() : Promise<number>;
213
- // public executeDeleteId(id: any) : Promise<void>;
214
-
215
- // public executeSelect<T = {[key: string]: any}>(): Promise<Array<T>>;
216
- // public executeSelectWithCount<T = any>(): Promise<{ datas: Array<T>, count: number, lastPage: number}>;
217
-
218
- // protected executeQuery(param1: string, vars?: Array<any>) : Promise<any>;
219
- // protected executeQuery(param1: TQuery) : Promise<any>;
220
-
221
- // public orderBy(column: string | TColumnInfo, sortKeyword: TSortKeyword): void;
222
- // public orderByList(column: string | TColumnInfo, list: Array<string | number | boolean | null>, sortKeyword: TSortKeyword): void;
223
- // public orderBySentence(query: string, sortKeyword: TSortKeyword): void;
224
-
225
- // public groupBy(column: string | TColumnInfo): void;
226
-
227
- // get ValidateClient(): ValidateClient;
228
- // }
229
-
230
149
  export function createTableDoc(models: Array<TableModel>, serviceName?: string): string;
231
150
  export function migrate(migrates: Array<MigrateTable>, poolParam: {
232
151
  host: string, user: string, dbName: string, password: string, port?: number, isSsl?: boolean
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-mvc-service",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/n-daira/npm-pack_mvc-service#readme",
6
6
  "bugs": {
@@ -162,7 +162,8 @@ export default class ValidateValueUtil {
162
162
  case "timestamp[]":
163
163
  isError = this.isErrorTimestamp(v);
164
164
  break;
165
- case "integer[]":
165
+ case "integer[]": // TODO: ここ最大最小のチェックもしないと
166
+ case "real[]": // TODO: ここ最大最小 + 桁数のチェックもしないと
166
167
  isError = this.isErrorNumber(v);
167
168
  break;
168
169
  case "bool[]":
@@ -122,6 +122,9 @@ export class TableModel {
122
122
  }
123
123
 
124
124
  private client: PoolClient | Pool;
125
+ get Client(): PoolClient | Pool {
126
+ return this.client;
127
+ }
125
128
  constructor(client: Pool);
126
129
  constructor(client: Pool, tableAlias: string);
127
130
  constructor(client: PoolClient);