pg-manipulator 1.0.14 → 1.0.15

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.
@@ -7,6 +7,6 @@ export type users_select = {
7
7
  password: string | undefined;
8
8
  language: string | undefined;
9
9
  type: number | undefined;
10
- where: users_where;
11
- order: users_order;
10
+ where: users_where | undefined;
11
+ order: users_order | undefined;
12
12
  };
@@ -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 | any, transaction?: PoolClient | any): Promise<users_fields>;
9
- static get_all(fields: users_select | any, transaction?: PoolClient | any): Promise<users_fields[]>;
10
- static create(fields: users | any, transaction?: PoolClient | any): Promise<users_fields>;
11
- static update(fields: users_update | any, transaction?: PoolClient | any): Promise<any>;
12
- static delete(fields: users_where | any, transaction?: PoolClient | any): Promise<any>;
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>;
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 | any, transaction: PoolClient | any = undefined) {
17
+ static async get(fields: ${table.name}_select, 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 | any, transaction: PoolClient | any = undefined) {
21
+ static async get_all(fields: ${table.name}_select, 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} | any, transaction: PoolClient | any = undefined) {
25
+ static async create(fields: ${table.name}, 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 | any, transaction: PoolClient | any = undefined) {
29
+ static async update(fields: ${table.name}_update, 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 | any, transaction: PoolClient | any = undefined) {
33
+ static async delete(fields: ${table.name}_where, transaction: PoolClient | any = undefined) {
34
34
  return await super.b_delete('${database}', fields, '${table.name}', transaction)
35
35
  }
36
36
  }`);
@@ -14,8 +14,8 @@ export type ${table.name}_select = {
14
14
  ${table.columns
15
15
  .map((column) => {
16
16
  return `\t${column.name}: ${select.get_type(column.value.type)}\n`;
17
- }).join('')}\twhere: ${table.name}_where
18
- order: ${table.name}_order
17
+ }).join('')}\twhere: ${table.name}_where | undefined
18
+ order: ${table.name}_order | undefined
19
19
  }`);
20
20
  this.database = database;
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-manipulator",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "postgresql database handler",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",