pg-manipulator 1.0.16 → 1.0.18

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,9 +1,9 @@
1
1
  import { where_number, where_string } from '../';
2
2
  export type users_where = {
3
- id: where_number | number | any;
4
- nickname: where_string | string | any;
5
- email: where_string | string | any;
6
- password: where_string | string | any;
7
- language: where_string | string | any;
8
- type: where_number | number | any;
3
+ id: where_number | number | undefined;
4
+ nickname: where_string | string | undefined;
5
+ email: where_string | string | undefined;
6
+ password: where_string | string | undefined;
7
+ language: where_string | string | undefined;
8
+ type: where_number | number | undefined;
9
9
  };
@@ -5,9 +5,9 @@ import { users_where } from '../../@types/users/users_where';
5
5
  import { users_update } from '../../@types/users/users_update';
6
6
  import { users_fields } from '../../@types/users/users_fields';
7
7
  export default class users extends base {
8
- static get(fields: users_select, transaction?: PoolClient | any): Promise<users_fields>;
9
- static get_all(fields: users_select, transaction?: PoolClient | any): Promise<users_fields[]>;
10
- static create(fields: users, transaction?: PoolClient | any): Promise<users_fields>;
11
- static update(fields: users_update, transaction?: PoolClient | any): Promise<any>;
12
- static delete(fields: users_where, transaction?: PoolClient | any): Promise<any>;
8
+ static get(fields: users_select | Object, transaction?: PoolClient | any): Promise<users_fields>;
9
+ static get_all(fields: users_select | Object, transaction?: PoolClient | any): Promise<users_fields[]>;
10
+ static create(fields: users | Object, transaction?: PoolClient | any): Promise<users_fields>;
11
+ static update(fields: users_update | Object, transaction?: PoolClient | any): Promise<any>;
12
+ static delete(fields: users_where | Object, transaction?: PoolClient | any): Promise<any>;
13
13
  }
@@ -14,23 +14,23 @@ import { ${table.name}_update } from '../../@types/${database}/${table.name}_upd
14
14
  import { ${table.name}_fields } from '../../@types/${database}/${table.name}_fields'
15
15
 
16
16
  export default class ${table.name} extends base {
17
- static async get(fields: ${table.name}_select, transaction: PoolClient | any = undefined) {
17
+ static async get(fields: ${table.name}_select | Object, transaction: PoolClient | any = undefined) {
18
18
  return <${table.name}_fields> await super.b_get('${database}', fields, '${table.name}', transaction)
19
19
  }
20
20
 
21
- static async get_all(fields: ${table.name}_select, transaction: PoolClient | any = undefined) {
21
+ static async get_all(fields: ${table.name}_select | Object, transaction: PoolClient | any = undefined) {
22
22
  return <Array<${table.name}_fields>> await super.b_get_all('${database}', fields, '${table.name}', transaction)
23
23
  }
24
24
 
25
- static async create(fields: ${table.name}, transaction: PoolClient | any = undefined) {
25
+ static async create(fields: ${table.name} | Object, transaction: PoolClient | any = undefined) {
26
26
  return <${table.name}_fields> await super.b_create('${database}', fields, '${table.name}', transaction)
27
27
  }
28
28
 
29
- static async update(fields: ${table.name}_update, transaction: PoolClient | any = undefined) {
29
+ static async update(fields: ${table.name}_update | Object, transaction: PoolClient | any = undefined) {
30
30
  return await super.b_update('${database}', fields, '${table.name}', transaction)
31
31
  }
32
32
 
33
- static async delete(fields: ${table.name}_where, transaction: PoolClient | any = undefined) {
33
+ static async delete(fields: ${table.name}_where | Object, transaction: PoolClient | any = undefined) {
34
34
  return await super.b_delete('${database}', fields, '${table.name}', transaction)
35
35
  }
36
36
  }`);
@@ -3,6 +3,6 @@ import base from './base';
3
3
  export default class where extends base {
4
4
  database: string;
5
5
  constructor(table: table, database: string);
6
- static get_type(type: string): "any" | "where_date | Date | any" | "where_boolean | boolean | any" | "where_number | number | any" | "where_string | string | any";
6
+ static get_type(type: string): "any | undefined" | "where_date | Date | undefined" | "where_boolean | boolean | undefined" | "where_number | number | undefined" | "where_string | string | undefined";
7
7
  dump(): void;
8
8
  }
@@ -19,15 +19,15 @@ ${table.columns
19
19
  static get_type(type) {
20
20
  switch ((0, utils_1.get_type)(type)) {
21
21
  case 'Date':
22
- return 'where_date | Date | any';
22
+ return 'where_date | Date | undefined';
23
23
  case 'boolean':
24
- return 'where_boolean | boolean | any';
24
+ return 'where_boolean | boolean | undefined';
25
25
  case 'number':
26
- return 'where_number | number | any';
26
+ return 'where_number | number | undefined';
27
27
  case 'string':
28
- return 'where_string | string | any';
28
+ return 'where_string | string | undefined';
29
29
  default:
30
- return 'any';
30
+ return 'any | undefined';
31
31
  }
32
32
  }
33
33
  dump() {
@@ -190,6 +190,7 @@ class select_factory {
190
190
  }
191
191
  }
192
192
  }
193
+ console.log(this.query, this.params);
193
194
  return [this.query, this.params];
194
195
  });
195
196
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-manipulator",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "postgresql database handler",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",