pg-manipulator 1.0.1 → 1.0.2
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/bin/dump/index.cjs +1 -0
- package/dist/@types/index.d.ts +5 -0
- package/dist/@types/users/users_fields.d.ts +5 -5
- package/dist/@types/users/users_order.d.ts +3 -3
- package/dist/@types/users/users_select.d.ts +5 -5
- package/dist/@types/users/users_update.d.ts +5 -5
- package/dist/@types/users/users_where.d.ts +6 -6
- package/dist/base/index.d.ts +5 -5
- package/dist/base/index.js +10 -10
- package/dist/class/users/index.d.ts +1 -5
- package/dist/class/users/index.js +3 -7
- package/dist/class/users/users.d.ts +5 -5
- package/dist/class/users/users.js +10 -10
- package/dist/database/client/index.d.ts +1 -1
- package/dist/generator/index.js +1 -1
- package/dist/generator/template/entity.js +5 -5
- package/dist/generator/template/entity_store.js +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -3
- package/dist/mapping/users/index.d.ts +0 -72
- package/dist/mapping/users/index.js +1 -5
- package/dist/mapping/users/users.d.ts +2 -2
- package/dist/mapping/users/users.js +11 -11
- package/dist/middleware/create/index.js +17 -7
- package/dist/middleware/select/index.d.ts +2 -0
- package/dist/middleware/select/index.js +120 -7
- package/dist/middleware/update/index.js +17 -7
- package/dist/middleware/where/index.js +33 -23
- package/package.json +1 -1
- package/dist/@types/bettings/betting_ball_scores_fields.d.ts +0 -6
- package/dist/@types/bettings/betting_ball_scores_fields.js +0 -2
- package/dist/@types/bettings/betting_ball_scores_order.d.ts +0 -6
- package/dist/@types/bettings/betting_ball_scores_order.js +0 -2
- package/dist/@types/bettings/betting_ball_scores_select.d.ts +0 -10
- package/dist/@types/bettings/betting_ball_scores_select.js +0 -2
- package/dist/@types/bettings/betting_ball_scores_update.d.ts +0 -8
- package/dist/@types/bettings/betting_ball_scores_update.js +0 -2
- package/dist/@types/bettings/betting_ball_scores_where.d.ts +0 -7
- package/dist/@types/bettings/betting_ball_scores_where.js +0 -2
- package/dist/@types/bettings/betting_balls_fields.d.ts +0 -8
- package/dist/@types/bettings/betting_balls_fields.js +0 -2
- package/dist/@types/bettings/betting_balls_order.d.ts +0 -8
- package/dist/@types/bettings/betting_balls_order.js +0 -2
- package/dist/@types/bettings/betting_balls_select.d.ts +0 -12
- package/dist/@types/bettings/betting_balls_select.js +0 -2
- package/dist/@types/bettings/betting_balls_update.d.ts +0 -10
- package/dist/@types/bettings/betting_balls_update.js +0 -2
- package/dist/@types/bettings/betting_balls_where.d.ts +0 -9
- package/dist/@types/bettings/betting_balls_where.js +0 -2
- package/dist/@types/bettings/betting_cards_fields.d.ts +0 -7
- package/dist/@types/bettings/betting_cards_fields.js +0 -2
- package/dist/@types/bettings/betting_cards_order.d.ts +0 -7
- package/dist/@types/bettings/betting_cards_order.js +0 -2
- package/dist/@types/bettings/betting_cards_select.d.ts +0 -11
- package/dist/@types/bettings/betting_cards_select.js +0 -2
- package/dist/@types/bettings/betting_cards_update.d.ts +0 -9
- package/dist/@types/bettings/betting_cards_update.js +0 -2
- package/dist/@types/bettings/betting_cards_where.d.ts +0 -8
- package/dist/@types/bettings/betting_cards_where.js +0 -2
- package/dist/@types/bettings/card_options_fields.d.ts +0 -11
- package/dist/@types/bettings/card_options_fields.js +0 -2
- package/dist/@types/bettings/card_options_order.d.ts +0 -11
- package/dist/@types/bettings/card_options_order.js +0 -2
- package/dist/@types/bettings/card_options_select.d.ts +0 -15
- package/dist/@types/bettings/card_options_select.js +0 -2
- package/dist/@types/bettings/card_options_update.d.ts +0 -13
- package/dist/@types/bettings/card_options_update.js +0 -2
- package/dist/@types/bettings/card_options_where.d.ts +0 -12
- package/dist/@types/bettings/card_options_where.js +0 -2
- package/dist/@types/bettings/cards_fields.d.ts +0 -7
- package/dist/@types/bettings/cards_fields.js +0 -2
- package/dist/@types/bettings/cards_order.d.ts +0 -7
- package/dist/@types/bettings/cards_order.js +0 -2
- package/dist/@types/bettings/cards_select.d.ts +0 -11
- package/dist/@types/bettings/cards_select.js +0 -2
- package/dist/@types/bettings/cards_update.d.ts +0 -9
- package/dist/@types/bettings/cards_update.js +0 -2
- package/dist/@types/bettings/cards_where.d.ts +0 -8
- package/dist/@types/bettings/cards_where.js +0 -2
- package/dist/@types/bettings/championship_teams_fields.d.ts +0 -7
- package/dist/@types/bettings/championship_teams_fields.js +0 -2
- package/dist/@types/bettings/championship_teams_order.d.ts +0 -7
- package/dist/@types/bettings/championship_teams_order.js +0 -2
- package/dist/@types/bettings/championship_teams_select.d.ts +0 -11
- package/dist/@types/bettings/championship_teams_select.js +0 -2
- package/dist/@types/bettings/championship_teams_update.d.ts +0 -9
- package/dist/@types/bettings/championship_teams_update.js +0 -2
- package/dist/@types/bettings/championship_teams_where.d.ts +0 -8
- package/dist/@types/bettings/championship_teams_where.js +0 -2
- package/dist/@types/bettings/championships_fields.d.ts +0 -9
- package/dist/@types/bettings/championships_fields.js +0 -2
- package/dist/@types/bettings/championships_order.d.ts +0 -9
- package/dist/@types/bettings/championships_order.js +0 -2
- package/dist/@types/bettings/championships_select.d.ts +0 -13
- package/dist/@types/bettings/championships_select.js +0 -2
- package/dist/@types/bettings/championships_update.d.ts +0 -11
- package/dist/@types/bettings/championships_update.js +0 -2
- package/dist/@types/bettings/championships_where.d.ts +0 -10
- package/dist/@types/bettings/championships_where.js +0 -2
- package/dist/@types/bettings/match_teams_fields.d.ts +0 -5
- package/dist/@types/bettings/match_teams_fields.js +0 -2
- package/dist/@types/bettings/match_teams_order.d.ts +0 -5
- package/dist/@types/bettings/match_teams_order.js +0 -2
- package/dist/@types/bettings/match_teams_select.d.ts +0 -9
- package/dist/@types/bettings/match_teams_select.js +0 -2
- package/dist/@types/bettings/match_teams_update.d.ts +0 -7
- package/dist/@types/bettings/match_teams_update.js +0 -2
- package/dist/@types/bettings/match_teams_where.d.ts +0 -6
- package/dist/@types/bettings/match_teams_where.js +0 -2
- package/dist/@types/bettings/matches_fields.d.ts +0 -5
- package/dist/@types/bettings/matches_fields.js +0 -2
- package/dist/@types/bettings/matches_order.d.ts +0 -5
- package/dist/@types/bettings/matches_order.js +0 -2
- package/dist/@types/bettings/matches_select.d.ts +0 -9
- package/dist/@types/bettings/matches_select.js +0 -2
- package/dist/@types/bettings/matches_update.d.ts +0 -7
- package/dist/@types/bettings/matches_update.js +0 -2
- package/dist/@types/bettings/matches_where.d.ts +0 -6
- package/dist/@types/bettings/matches_where.js +0 -2
- package/dist/@types/bettings/teams_fields.d.ts +0 -7
- package/dist/@types/bettings/teams_fields.js +0 -2
- package/dist/@types/bettings/teams_order.d.ts +0 -7
- package/dist/@types/bettings/teams_order.js +0 -2
- package/dist/@types/bettings/teams_select.d.ts +0 -11
- package/dist/@types/bettings/teams_select.js +0 -2
- package/dist/@types/bettings/teams_update.d.ts +0 -9
- package/dist/@types/bettings/teams_update.js +0 -2
- package/dist/@types/bettings/teams_where.d.ts +0 -8
- package/dist/@types/bettings/teams_where.js +0 -2
- package/dist/class/bettings/betting_ball_scores.d.ts +0 -13
- package/dist/class/bettings/betting_ball_scores.js +0 -58
- package/dist/class/bettings/betting_balls.d.ts +0 -13
- package/dist/class/bettings/betting_balls.js +0 -58
- package/dist/class/bettings/betting_cards.d.ts +0 -13
- package/dist/class/bettings/betting_cards.js +0 -58
- package/dist/class/bettings/card_options.d.ts +0 -13
- package/dist/class/bettings/card_options.js +0 -58
- package/dist/class/bettings/cards.d.ts +0 -13
- package/dist/class/bettings/cards.js +0 -58
- package/dist/class/bettings/championship_teams.d.ts +0 -13
- package/dist/class/bettings/championship_teams.js +0 -58
- package/dist/class/bettings/championships.d.ts +0 -13
- package/dist/class/bettings/championships.js +0 -58
- package/dist/class/bettings/index.d.ts +0 -27
- package/dist/class/bettings/index.js +0 -47
- package/dist/class/bettings/match_teams.d.ts +0 -13
- package/dist/class/bettings/match_teams.js +0 -58
- package/dist/class/bettings/matches.d.ts +0 -13
- package/dist/class/bettings/matches.js +0 -58
- package/dist/class/bettings/teams.d.ts +0 -13
- package/dist/class/bettings/teams.js +0 -58
- package/dist/class/users/transaction_historics.d.ts +0 -13
- package/dist/class/users/transaction_historics.js +0 -58
- package/dist/class/users/transactions.d.ts +0 -13
- package/dist/class/users/transactions.js +0 -58
- package/dist/mapping/bettings/betting_ball_scores.d.ts +0 -27
- package/dist/mapping/bettings/betting_ball_scores.js +0 -53
- package/dist/mapping/bettings/betting_balls.d.ts +0 -37
- package/dist/mapping/bettings/betting_balls.js +0 -75
- package/dist/mapping/bettings/betting_cards.d.ts +0 -27
- package/dist/mapping/bettings/betting_cards.js +0 -64
- package/dist/mapping/bettings/card_options.d.ts +0 -37
- package/dist/mapping/bettings/card_options.js +0 -108
- package/dist/mapping/bettings/cards.d.ts +0 -37
- package/dist/mapping/bettings/cards.js +0 -64
- package/dist/mapping/bettings/championship_teams.d.ts +0 -37
- package/dist/mapping/bettings/championship_teams.js +0 -64
- package/dist/mapping/bettings/championships.d.ts +0 -37
- package/dist/mapping/bettings/championships.js +0 -86
- package/dist/mapping/bettings/index.d.ts +0 -323
- package/dist/mapping/bettings/index.js +0 -27
- package/dist/mapping/bettings/match_teams.d.ts +0 -27
- package/dist/mapping/bettings/match_teams.js +0 -42
- package/dist/mapping/bettings/matches.d.ts +0 -27
- package/dist/mapping/bettings/matches.js +0 -42
- package/dist/mapping/bettings/teams.d.ts +0 -37
- package/dist/mapping/bettings/teams.js +0 -64
- package/dist/mapping/users/transaction_historics.d.ts +0 -37
- package/dist/mapping/users/transaction_historics.js +0 -53
- package/dist/mapping/users/transactions.d.ts +0 -37
- package/dist/mapping/users/transactions.js +0 -108
package/bin/dump/index.cjs
CHANGED
package/dist/@types/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export type column = {
|
|
|
13
13
|
pk: boolean;
|
|
14
14
|
};
|
|
15
15
|
export type where_number = {
|
|
16
|
+
equals: number;
|
|
16
17
|
gt: number;
|
|
17
18
|
lt: number;
|
|
18
19
|
gte: number;
|
|
@@ -21,20 +22,24 @@ export type where_number = {
|
|
|
21
22
|
not_in: Array<number>;
|
|
22
23
|
};
|
|
23
24
|
export type where_string = {
|
|
25
|
+
equals: string;
|
|
24
26
|
in: Array<string>;
|
|
25
27
|
not_in: Array<string>;
|
|
26
28
|
like: string;
|
|
27
29
|
ilike: string;
|
|
28
30
|
};
|
|
29
31
|
export type where_boolean = {
|
|
32
|
+
equals: string;
|
|
30
33
|
in: Array<string>;
|
|
31
34
|
not_in: Array<string>;
|
|
32
35
|
};
|
|
33
36
|
export type where_date = {
|
|
37
|
+
equals: number;
|
|
34
38
|
gt: number;
|
|
35
39
|
lt: number;
|
|
36
40
|
gte: number;
|
|
37
41
|
lte: number;
|
|
38
42
|
in: Array<number>;
|
|
39
43
|
not_in: Array<number>;
|
|
44
|
+
between: Array<Date>;
|
|
40
45
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export type users_order = {
|
|
2
2
|
id: 'desc' | 'asc';
|
|
3
|
-
|
|
4
|
-
surname: 'desc' | 'asc';
|
|
3
|
+
nickname: 'desc' | 'asc';
|
|
5
4
|
email: 'desc' | 'asc';
|
|
6
|
-
|
|
5
|
+
password: 'desc' | 'asc';
|
|
6
|
+
language: 'desc' | 'asc';
|
|
7
7
|
type: 'desc' | 'asc';
|
|
8
8
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { users_where } from './users_where';
|
|
2
2
|
import { users_order } from './users_order';
|
|
3
3
|
export type users_select = {
|
|
4
|
-
id:
|
|
5
|
-
|
|
6
|
-
surname: string | undefined;
|
|
4
|
+
id: number | undefined;
|
|
5
|
+
nickname: string | undefined;
|
|
7
6
|
email: string | undefined;
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
password: string | undefined;
|
|
8
|
+
language: string | undefined;
|
|
9
|
+
type: number | undefined;
|
|
10
10
|
where: users_where;
|
|
11
11
|
order: users_order;
|
|
12
12
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { users_where } from './users_where';
|
|
2
2
|
export type users_update = {
|
|
3
|
-
id:
|
|
4
|
-
|
|
5
|
-
surname: string | undefined;
|
|
3
|
+
id: number | undefined;
|
|
4
|
+
nickname: string | undefined;
|
|
6
5
|
email: string | undefined;
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
password: string | undefined;
|
|
7
|
+
language: string | undefined;
|
|
8
|
+
type: number | undefined;
|
|
9
9
|
where: users_where;
|
|
10
10
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { where_string } from '../';
|
|
1
|
+
import { where_number, where_string } from '../';
|
|
2
2
|
export type users_where = {
|
|
3
|
-
id:
|
|
4
|
-
|
|
5
|
-
surname: where_string | undefined;
|
|
3
|
+
id: where_number | undefined;
|
|
4
|
+
nickname: where_string | undefined;
|
|
6
5
|
email: where_string | undefined;
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
password: where_string | undefined;
|
|
7
|
+
language: where_string | undefined;
|
|
8
|
+
type: where_number | undefined;
|
|
9
9
|
};
|
package/dist/base/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PoolClient } from 'pg';
|
|
2
2
|
export default class base {
|
|
3
|
-
static b_create(database: string, fields: any, table: string, transaction
|
|
4
|
-
static b_update(database: string, fields: any, table: string, transaction
|
|
5
|
-
static b_delete(database: string, fields: any, table: string, transaction
|
|
6
|
-
static b_get(database: string, fields: any, table: string, transaction
|
|
7
|
-
static b_get_all(database: string, fields: any, table: string, transaction
|
|
3
|
+
protected static b_create(database: string, fields: any, table: string, transaction?: PoolClient | any): Promise<any>;
|
|
4
|
+
protected static b_update(database: string, fields: any, table: string, transaction?: PoolClient | any): Promise<any>;
|
|
5
|
+
protected static b_delete(database: string, fields: any, table: string, transaction?: PoolClient | any): Promise<any>;
|
|
6
|
+
protected static b_get(database: string, fields: any, table: string, transaction?: PoolClient | any): Promise<any>;
|
|
7
|
+
protected static b_get_all(database: string, fields: any, table: string, transaction?: PoolClient | any): Promise<any>;
|
|
8
8
|
}
|
package/dist/base/index.js
CHANGED
|
@@ -15,33 +15,33 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
const index_js_1 = __importDefault(require("../middleware/index.js"));
|
|
16
16
|
const database_1 = __importDefault(require("../database"));
|
|
17
17
|
class base {
|
|
18
|
-
static b_create(
|
|
19
|
-
return __awaiter(this,
|
|
18
|
+
static b_create(database_2, fields_1, table_1) {
|
|
19
|
+
return __awaiter(this, arguments, void 0, function* (database, fields, table, transaction = undefined) {
|
|
20
20
|
var _a;
|
|
21
21
|
const [query, params] = yield (new index_js_1.default(database, table)).create(fields);
|
|
22
22
|
return (_a = (yield database_1.default.query(database, query, params, transaction))) === null || _a === void 0 ? void 0 : _a.shift();
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
static b_update(
|
|
26
|
-
return __awaiter(this,
|
|
25
|
+
static b_update(database_2, fields_1, table_1) {
|
|
26
|
+
return __awaiter(this, arguments, void 0, function* (database, fields, table, transaction = undefined) {
|
|
27
27
|
const [query, params] = yield (new index_js_1.default(database, table)).update(fields);
|
|
28
28
|
return yield database_1.default.query(database, query, params, transaction);
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
static b_delete(
|
|
32
|
-
return __awaiter(this,
|
|
31
|
+
static b_delete(database_2, fields_1, table_1) {
|
|
32
|
+
return __awaiter(this, arguments, void 0, function* (database, fields, table, transaction = undefined) {
|
|
33
33
|
const [query, params] = yield (new index_js_1.default(database, table)).delete(fields);
|
|
34
34
|
return yield database_1.default.query(database, query, params, transaction);
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
-
static b_get(
|
|
38
|
-
return __awaiter(this,
|
|
37
|
+
static b_get(database_2, fields_1, table_1) {
|
|
38
|
+
return __awaiter(this, arguments, void 0, function* (database, fields, table, transaction = undefined) {
|
|
39
39
|
const [query, params] = yield (new index_js_1.default(database, table)).get(fields);
|
|
40
40
|
return (yield database_1.default.query(database, query, params, transaction)).shift();
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
static b_get_all(
|
|
44
|
-
return __awaiter(this,
|
|
43
|
+
static b_get_all(database_2, fields_1, table_1) {
|
|
44
|
+
return __awaiter(this, arguments, void 0, function* (database, fields, table, transaction = undefined) {
|
|
45
45
|
const [query, params] = yield (new index_js_1.default(database, table)).get_all(fields);
|
|
46
46
|
return yield database_1.default.query(database, query, params, transaction);
|
|
47
47
|
});
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { PoolClient } from 'pg';
|
|
2
2
|
import { pool_tsx } from '../../@types';
|
|
3
3
|
import users from './users';
|
|
4
|
-
import transactions from './transactions';
|
|
5
|
-
import transaction_historics from './transaction_historics';
|
|
6
4
|
declare const _default: {
|
|
7
|
-
query(query_string: string, query_params: Array<any>, transaction
|
|
5
|
+
query(query_string: string, query_params: Array<any>, transaction?: PoolClient | any): Promise<any>;
|
|
8
6
|
transaction(callback: pool_tsx): Promise<void>;
|
|
9
7
|
users: typeof users;
|
|
10
|
-
transactions: typeof transactions;
|
|
11
|
-
transaction_historics: typeof transaction_historics;
|
|
12
8
|
};
|
|
13
9
|
export default _default;
|
|
@@ -14,11 +14,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const database_1 = __importDefault(require("../../../src/database"));
|
|
16
16
|
const users_1 = __importDefault(require("./users"));
|
|
17
|
-
const transactions_1 = __importDefault(require("./transactions"));
|
|
18
|
-
const transaction_historics_1 = __importDefault(require("./transaction_historics"));
|
|
19
17
|
exports.default = {
|
|
20
|
-
query(
|
|
21
|
-
return __awaiter(this,
|
|
18
|
+
query(query_string_1, query_params_1) {
|
|
19
|
+
return __awaiter(this, arguments, void 0, function* (query_string, query_params, transaction = undefined) {
|
|
22
20
|
return yield database_1.default.query('users', query_string, query_params, transaction);
|
|
23
21
|
});
|
|
24
22
|
},
|
|
@@ -27,7 +25,5 @@ exports.default = {
|
|
|
27
25
|
return yield database_1.default.transaction('users', callback);
|
|
28
26
|
});
|
|
29
27
|
},
|
|
30
|
-
users: users_1.default
|
|
31
|
-
transactions: transactions_1.default,
|
|
32
|
-
transaction_historics: transaction_historics_1.default
|
|
28
|
+
users: users_1.default
|
|
33
29
|
};
|
|
@@ -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
|
|
9
|
-
static get_all(fields: users_select, transaction
|
|
10
|
-
static create(fields: users, transaction
|
|
11
|
-
static update(fields: users_update, transaction
|
|
12
|
-
static delete(fields: users_where, transaction
|
|
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,43 +14,43 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const base_1 = __importDefault(require("../../base"));
|
|
16
16
|
class users extends base_1.default {
|
|
17
|
-
static get(
|
|
17
|
+
static get(fields_1) {
|
|
18
18
|
const _super = Object.create(null, {
|
|
19
19
|
b_get: { get: () => super.b_get }
|
|
20
20
|
});
|
|
21
|
-
return __awaiter(this,
|
|
21
|
+
return __awaiter(this, arguments, void 0, function* (fields, transaction = undefined) {
|
|
22
22
|
return yield _super.b_get.call(this, 'users', fields, 'users', transaction);
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
static get_all(
|
|
25
|
+
static get_all(fields_1) {
|
|
26
26
|
const _super = Object.create(null, {
|
|
27
27
|
b_get_all: { get: () => super.b_get_all }
|
|
28
28
|
});
|
|
29
|
-
return __awaiter(this,
|
|
29
|
+
return __awaiter(this, arguments, void 0, function* (fields, transaction = undefined) {
|
|
30
30
|
return yield _super.b_get_all.call(this, 'users', fields, 'users', transaction);
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
static create(
|
|
33
|
+
static create(fields_1) {
|
|
34
34
|
const _super = Object.create(null, {
|
|
35
35
|
b_create: { get: () => super.b_create }
|
|
36
36
|
});
|
|
37
|
-
return __awaiter(this,
|
|
37
|
+
return __awaiter(this, arguments, void 0, function* (fields, transaction = undefined) {
|
|
38
38
|
return yield _super.b_create.call(this, 'users', fields, 'users', transaction);
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
static update(
|
|
41
|
+
static update(fields_1) {
|
|
42
42
|
const _super = Object.create(null, {
|
|
43
43
|
b_update: { get: () => super.b_update }
|
|
44
44
|
});
|
|
45
|
-
return __awaiter(this,
|
|
45
|
+
return __awaiter(this, arguments, void 0, function* (fields, transaction = undefined) {
|
|
46
46
|
return yield _super.b_update.call(this, 'users', fields, 'users', transaction);
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
static delete(
|
|
49
|
+
static delete(fields_1) {
|
|
50
50
|
const _super = Object.create(null, {
|
|
51
51
|
b_delete: { get: () => super.b_delete }
|
|
52
52
|
});
|
|
53
|
-
return __awaiter(this,
|
|
53
|
+
return __awaiter(this, arguments, void 0, function* (fields, transaction = undefined) {
|
|
54
54
|
return yield _super.b_delete.call(this, 'users', fields, 'users', transaction);
|
|
55
55
|
});
|
|
56
56
|
}
|
|
@@ -4,6 +4,6 @@ export default class core_client {
|
|
|
4
4
|
client: Client;
|
|
5
5
|
name: string;
|
|
6
6
|
constructor(client: Client, db_name: string);
|
|
7
|
-
query(query_string: string, query_params: Array<any>, transaction?: Pool |
|
|
7
|
+
query(query_string: string, query_params: Array<any>, transaction?: Pool | any): Promise<any>;
|
|
8
8
|
transaction(callback: pool_tsx): Promise<void>;
|
|
9
9
|
}
|
package/dist/generator/index.js
CHANGED
|
@@ -97,7 +97,7 @@ class generator {
|
|
|
97
97
|
}
|
|
98
98
|
static dump() {
|
|
99
99
|
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
-
|
|
100
|
+
database_2.default.open();
|
|
101
101
|
const connections = new database_store_1.default();
|
|
102
102
|
if (!fs_1.default.existsSync(`src/class`)) {
|
|
103
103
|
fs_1.default.mkdirSync(`src/class`);
|
|
@@ -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 | 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, transaction: PoolClient | 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}, transaction: PoolClient | 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, transaction: PoolClient | 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, transaction: PoolClient | 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
|
}`);
|
|
@@ -11,7 +11,7 @@ class entity_store extends base_1.default {
|
|
|
11
11
|
this.database = database;
|
|
12
12
|
this.import_general = `import db from '../../../src/database'\nimport { PoolClient } from 'pg'\nimport { pool_tsx } from '../../@types'\n`;
|
|
13
13
|
this.export_general = `\nexport default {
|
|
14
|
-
async query(query_string: string, query_params: Array<any>, transaction: PoolClient) {
|
|
14
|
+
async query(query_string: string, query_params: Array<any>, transaction: PoolClient | any = undefined) {
|
|
15
15
|
return await db.query('${database}', query_string, query_params, transaction)
|
|
16
16
|
},
|
|
17
17
|
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -3,10 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.users = exports.
|
|
6
|
+
exports.users = exports.db = void 0;
|
|
7
7
|
const database_1 = __importDefault(require("./database"));
|
|
8
8
|
exports.db = database_1.default;
|
|
9
|
-
const bettings_1 = __importDefault(require("./class/bettings"));
|
|
10
|
-
exports.bettings = bettings_1.default;
|
|
11
9
|
const users_1 = __importDefault(require("./class/users"));
|
|
12
10
|
exports.users = users_1.default;
|
|
@@ -10,52 +10,6 @@ declare const _default: {
|
|
|
10
10
|
fk_table: string;
|
|
11
11
|
fk_reference: string;
|
|
12
12
|
pk: boolean;
|
|
13
|
-
} | {
|
|
14
|
-
name: string;
|
|
15
|
-
value: {
|
|
16
|
-
type: string;
|
|
17
|
-
is_null: string;
|
|
18
|
-
maxlength: null;
|
|
19
|
-
};
|
|
20
|
-
fk_table: null;
|
|
21
|
-
fk_reference: null;
|
|
22
|
-
pk: boolean;
|
|
23
|
-
} | {
|
|
24
|
-
name: string;
|
|
25
|
-
value: {
|
|
26
|
-
type: string;
|
|
27
|
-
is_null: string;
|
|
28
|
-
maxlength: number;
|
|
29
|
-
};
|
|
30
|
-
fk_table: null;
|
|
31
|
-
fk_reference: null;
|
|
32
|
-
pk: boolean;
|
|
33
|
-
})[];
|
|
34
|
-
fathers: never[];
|
|
35
|
-
childrens: never[];
|
|
36
|
-
name: string;
|
|
37
|
-
};
|
|
38
|
-
transactions: {
|
|
39
|
-
columns: ({
|
|
40
|
-
name: string;
|
|
41
|
-
value: {
|
|
42
|
-
type: string;
|
|
43
|
-
is_null: string;
|
|
44
|
-
maxlength: null;
|
|
45
|
-
};
|
|
46
|
-
fk_table: string;
|
|
47
|
-
fk_reference: string;
|
|
48
|
-
pk: boolean;
|
|
49
|
-
} | {
|
|
50
|
-
name: string;
|
|
51
|
-
value: {
|
|
52
|
-
type: string;
|
|
53
|
-
is_null: string;
|
|
54
|
-
maxlength: null;
|
|
55
|
-
};
|
|
56
|
-
fk_table: null;
|
|
57
|
-
fk_reference: null;
|
|
58
|
-
pk: boolean;
|
|
59
13
|
} | {
|
|
60
14
|
name: string;
|
|
61
15
|
value: {
|
|
@@ -66,22 +20,6 @@ declare const _default: {
|
|
|
66
20
|
fk_table: null;
|
|
67
21
|
fk_reference: null;
|
|
68
22
|
pk: boolean;
|
|
69
|
-
})[];
|
|
70
|
-
fathers: never[];
|
|
71
|
-
childrens: never[];
|
|
72
|
-
name: string;
|
|
73
|
-
};
|
|
74
|
-
transaction_historics: {
|
|
75
|
-
columns: ({
|
|
76
|
-
name: string;
|
|
77
|
-
value: {
|
|
78
|
-
type: string;
|
|
79
|
-
is_null: string;
|
|
80
|
-
maxlength: null;
|
|
81
|
-
};
|
|
82
|
-
fk_table: string;
|
|
83
|
-
fk_reference: string;
|
|
84
|
-
pk: boolean;
|
|
85
23
|
} | {
|
|
86
24
|
name: string;
|
|
87
25
|
value: {
|
|
@@ -92,16 +30,6 @@ declare const _default: {
|
|
|
92
30
|
fk_table: null;
|
|
93
31
|
fk_reference: null;
|
|
94
32
|
pk: boolean;
|
|
95
|
-
} | {
|
|
96
|
-
name: string;
|
|
97
|
-
value: {
|
|
98
|
-
type: string;
|
|
99
|
-
is_null: string;
|
|
100
|
-
maxlength: number;
|
|
101
|
-
};
|
|
102
|
-
fk_table: null;
|
|
103
|
-
fk_reference: null;
|
|
104
|
-
pk: boolean;
|
|
105
33
|
})[];
|
|
106
34
|
fathers: never[];
|
|
107
35
|
childrens: never[];
|
|
@@ -4,10 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const users_1 = __importDefault(require("./users"));
|
|
7
|
-
const transactions_1 = __importDefault(require("./transactions"));
|
|
8
|
-
const transaction_historics_1 = __importDefault(require("./transaction_historics"));
|
|
9
7
|
exports.default = {
|
|
10
|
-
users: users_1.default
|
|
11
|
-
transactions: transactions_1.default,
|
|
12
|
-
transaction_historics: transaction_historics_1.default
|
|
8
|
+
users: users_1.default
|
|
13
9
|
};
|
|
@@ -14,7 +14,7 @@ declare const _default: {
|
|
|
14
14
|
value: {
|
|
15
15
|
type: string;
|
|
16
16
|
is_null: string;
|
|
17
|
-
maxlength:
|
|
17
|
+
maxlength: number;
|
|
18
18
|
};
|
|
19
19
|
fk_table: null;
|
|
20
20
|
fk_reference: null;
|
|
@@ -24,7 +24,7 @@ declare const _default: {
|
|
|
24
24
|
value: {
|
|
25
25
|
type: string;
|
|
26
26
|
is_null: string;
|
|
27
|
-
maxlength:
|
|
27
|
+
maxlength: null;
|
|
28
28
|
};
|
|
29
29
|
fk_table: null;
|
|
30
30
|
fk_reference: null;
|
|
@@ -5,8 +5,8 @@ exports.default = {
|
|
|
5
5
|
{
|
|
6
6
|
"name": "id",
|
|
7
7
|
"value": {
|
|
8
|
-
"type": "
|
|
9
|
-
"is_null": "
|
|
8
|
+
"type": "integer",
|
|
9
|
+
"is_null": "YES",
|
|
10
10
|
"maxlength": null
|
|
11
11
|
},
|
|
12
12
|
"fk_table": "users",
|
|
@@ -14,18 +14,18 @@ exports.default = {
|
|
|
14
14
|
"pk": true
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
"name": "
|
|
17
|
+
"name": "nickname",
|
|
18
18
|
"value": {
|
|
19
19
|
"type": "character varying",
|
|
20
20
|
"is_null": "NO",
|
|
21
|
-
"maxlength":
|
|
21
|
+
"maxlength": 100
|
|
22
22
|
},
|
|
23
23
|
"fk_table": null,
|
|
24
24
|
"fk_reference": null,
|
|
25
25
|
"pk": false
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
"name": "
|
|
28
|
+
"name": "email",
|
|
29
29
|
"value": {
|
|
30
30
|
"type": "character varying",
|
|
31
31
|
"is_null": "NO",
|
|
@@ -36,7 +36,7 @@ exports.default = {
|
|
|
36
36
|
"pk": false
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
"name": "
|
|
39
|
+
"name": "password",
|
|
40
40
|
"value": {
|
|
41
41
|
"type": "character varying",
|
|
42
42
|
"is_null": "NO",
|
|
@@ -47,11 +47,11 @@ exports.default = {
|
|
|
47
47
|
"pk": false
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
|
-
"name": "
|
|
50
|
+
"name": "language",
|
|
51
51
|
"value": {
|
|
52
52
|
"type": "character varying",
|
|
53
53
|
"is_null": "NO",
|
|
54
|
-
"maxlength":
|
|
54
|
+
"maxlength": 2
|
|
55
55
|
},
|
|
56
56
|
"fk_table": null,
|
|
57
57
|
"fk_reference": null,
|
|
@@ -60,9 +60,9 @@ exports.default = {
|
|
|
60
60
|
{
|
|
61
61
|
"name": "type",
|
|
62
62
|
"value": {
|
|
63
|
-
"type": "
|
|
64
|
-
"is_null": "
|
|
65
|
-
"maxlength":
|
|
63
|
+
"type": "integer",
|
|
64
|
+
"is_null": "YES",
|
|
65
|
+
"maxlength": null
|
|
66
66
|
},
|
|
67
67
|
"fk_table": null,
|
|
68
68
|
"fk_reference": null,
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { column } from '../../@types';
|
|
1
2
|
export default class select_factory {
|
|
2
3
|
fields: any;
|
|
3
4
|
database: string;
|
|
@@ -7,5 +8,6 @@ export default class select_factory {
|
|
|
7
8
|
params: Array<any>;
|
|
8
9
|
schema: any;
|
|
9
10
|
constructor(database: string, table: string, fields: any);
|
|
11
|
+
mount(database: string, table: string, column: column, fields: any, children_name: string | undefined, addQuery?: Function | undefined, addParam?: Function | undefined): Promise<void>;
|
|
10
12
|
prepare(): Promise<(string | any[])[]>;
|
|
11
13
|
}
|