@reachu/database 1.0.95 → 1.0.97
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/dist/helpers/index.d.ts +2 -1
- package/dist/helpers/index.js +3 -1
- package/dist/helpers/index.js.map +1 -1
- package/dist/helpers/querys/index.d.ts +2 -0
- package/dist/helpers/querys/index.js +32 -0
- package/dist/helpers/querys/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +13 -2
- package/package.json +3 -3
- package/src/helpers/index.ts +2 -1
- package/src/helpers/querys/index.ts +19 -0
package/dist/helpers/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ import * as Statistics from './statistics';
|
|
|
2
2
|
import * as Returns from './returns';
|
|
3
3
|
import * as Products from './products';
|
|
4
4
|
import * as Order from './order';
|
|
5
|
-
|
|
5
|
+
import * as Querys from './querys';
|
|
6
|
+
export { Statistics, Returns, Products, Order, Querys };
|
package/dist/helpers/index.js
CHANGED
|
@@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.Order = exports.Products = exports.Returns = exports.Statistics = void 0;
|
|
22
|
+
exports.Querys = exports.Order = exports.Products = exports.Returns = exports.Statistics = void 0;
|
|
23
23
|
const Statistics = __importStar(require("./statistics"));
|
|
24
24
|
exports.Statistics = Statistics;
|
|
25
25
|
const Returns = __importStar(require("./returns"));
|
|
@@ -28,4 +28,6 @@ const Products = __importStar(require("./products"));
|
|
|
28
28
|
exports.Products = Products;
|
|
29
29
|
const Order = __importStar(require("./order"));
|
|
30
30
|
exports.Order = Order;
|
|
31
|
+
const Querys = __importStar(require("./querys"));
|
|
32
|
+
exports.Querys = Querys;
|
|
31
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA2C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA2C;AAMlC,gCAAU;AALnB,mDAAqC;AAKhB,0BAAO;AAJ5B,qDAAuC;AAIT,4BAAQ;AAHtC,+CAAiC;AAGO,sBAAK;AAF7C,iDAAmC;AAEY,wBAAM"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getCurrentDate = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const getCurrentDate = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
const connection = typeorm_1.getConnection();
|
|
16
|
+
const queryRunner = connection.createQueryRunner();
|
|
17
|
+
try {
|
|
18
|
+
yield queryRunner.connect();
|
|
19
|
+
const result = yield queryRunner.query('SELECT NOW() as date');
|
|
20
|
+
console.log(`getCurrentDate result: ${JSON.stringify(result)}`);
|
|
21
|
+
const currentDate = result[0].date;
|
|
22
|
+
console.log(`getCurrentDate: ${currentDate}`);
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
console.error('getCurrentDate: Error:', error);
|
|
26
|
+
}
|
|
27
|
+
finally {
|
|
28
|
+
yield queryRunner.release();
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
exports.getCurrentDate = getCurrentDate;
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/querys/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAwC;AAExC,MAAM,cAAc,GAAG,GAAS,EAAE;IAChC,MAAM,UAAU,GAAG,uBAAa,EAAE,CAAC;IACnC,MAAM,WAAW,GAAG,UAAU,CAAC,iBAAiB,EAAE,CAAC;IACnD,IAAI;QACF,MAAM,WAAW,CAAC,OAAO,EAAE,CAAC;QAC5B,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC/D,OAAO,CAAC,GAAG,CAAC,0BAA0B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAChE,MAAM,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACnC,OAAO,CAAC,GAAG,CAAC,mBAAmB,WAAW,EAAE,CAAC,CAAC;KAC/C;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;KAChD;YAAS;QACR,MAAM,WAAW,CAAC,OAAO,EAAE,CAAC;KAC7B;AACH,CAAC,CAAA,CAAC;AAEO,wCAAc"}
|
|
@@ -2986,9 +2986,14 @@
|
|
|
2986
2986
|
"signature": "93c5df77bc28067280f992e0471941b578c82c41c081e7f1c6e88a4e7b82497c",
|
|
2987
2987
|
"affectsGlobalScope": false
|
|
2988
2988
|
},
|
|
2989
|
+
"../src/helpers/querys/index.ts": {
|
|
2990
|
+
"version": "ab2befcd1372f06609cfda17b110c31f1b76cd9092033ba59b7bd33bcb6fe90b",
|
|
2991
|
+
"signature": "eb80b6c7eae67e57701b07fcd4afe0de1d9ba7098ff3b7ab70828646e76fbad2",
|
|
2992
|
+
"affectsGlobalScope": false
|
|
2993
|
+
},
|
|
2989
2994
|
"../src/helpers/index.ts": {
|
|
2990
|
-
"version": "
|
|
2991
|
-
"signature": "
|
|
2995
|
+
"version": "ffcb339ebe705e2c8f012bfe520ffd72da08f33719153525283d9140795fe1d8",
|
|
2996
|
+
"signature": "0b64db0975e2ca04c9e5651829f4f2150986c1204b16c5f00e2a49a515667f8f",
|
|
2992
2997
|
"affectsGlobalScope": false
|
|
2993
2998
|
},
|
|
2994
2999
|
"../src/index.ts": {
|
|
@@ -6023,6 +6028,7 @@
|
|
|
6023
6028
|
"../src/helpers/index.ts": [
|
|
6024
6029
|
"../src/helpers/order/index.ts",
|
|
6025
6030
|
"../src/helpers/products/index.ts",
|
|
6031
|
+
"../src/helpers/querys/index.ts",
|
|
6026
6032
|
"../src/helpers/returns/index.ts",
|
|
6027
6033
|
"../src/helpers/statistics/index.ts"
|
|
6028
6034
|
],
|
|
@@ -6043,6 +6049,9 @@
|
|
|
6043
6049
|
"../src/entity/product.entity.ts",
|
|
6044
6050
|
"../src/entity/request.ts"
|
|
6045
6051
|
],
|
|
6052
|
+
"../src/helpers/querys/index.ts": [
|
|
6053
|
+
"../node_modules/typeorm/index.d.ts"
|
|
6054
|
+
],
|
|
6046
6055
|
"../src/helpers/returns/index.ts": [
|
|
6047
6056
|
"../src/helpers/returns/storage.ts"
|
|
6048
6057
|
],
|
|
@@ -8828,6 +8837,7 @@
|
|
|
8828
8837
|
"../src/helpers/index.ts": [
|
|
8829
8838
|
"../src/helpers/order/index.ts",
|
|
8830
8839
|
"../src/helpers/products/index.ts",
|
|
8840
|
+
"../src/helpers/querys/index.ts",
|
|
8831
8841
|
"../src/helpers/returns/index.ts",
|
|
8832
8842
|
"../src/helpers/statistics/index.ts"
|
|
8833
8843
|
],
|
|
@@ -9879,6 +9889,7 @@
|
|
|
9879
9889
|
"../src/helpers/products/index.ts",
|
|
9880
9890
|
"../src/helpers/products/storage/index.ts",
|
|
9881
9891
|
"../src/helpers/products/storage/search.ts",
|
|
9892
|
+
"../src/helpers/querys/index.ts",
|
|
9882
9893
|
"../src/helpers/returns/index.ts",
|
|
9883
9894
|
"../src/helpers/returns/storage.ts",
|
|
9884
9895
|
"../src/helpers/statistics/connections.ts",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reachu/database",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.97",
|
|
4
4
|
"description": "reachu-database",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"author": "reachu",
|
|
22
22
|
"license": "ISC",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@reachu/logger": "1.0.
|
|
25
|
-
"@reachu/utils": "1.0.
|
|
24
|
+
"@reachu/logger": "1.0.97",
|
|
25
|
+
"@reachu/utils": "1.0.97",
|
|
26
26
|
"dotenv": "8.0.0",
|
|
27
27
|
"express": "4.17.1",
|
|
28
28
|
"mysql2": "1.5.2",
|
package/src/helpers/index.ts
CHANGED
|
@@ -2,5 +2,6 @@ import * as Statistics from './statistics';
|
|
|
2
2
|
import * as Returns from './returns';
|
|
3
3
|
import * as Products from './products';
|
|
4
4
|
import * as Order from './order';
|
|
5
|
+
import * as Querys from './querys';
|
|
5
6
|
|
|
6
|
-
export { Statistics, Returns, Products, Order };
|
|
7
|
+
export { Statistics, Returns, Products, Order, Querys };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getConnection } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
const getCurrentDate = async () => {
|
|
4
|
+
const connection = getConnection();
|
|
5
|
+
const queryRunner = connection.createQueryRunner();
|
|
6
|
+
try {
|
|
7
|
+
await queryRunner.connect();
|
|
8
|
+
const result = await queryRunner.query('SELECT NOW() as date');
|
|
9
|
+
console.log(`getCurrentDate result: ${JSON.stringify(result)}`);
|
|
10
|
+
const currentDate = result[0].date;
|
|
11
|
+
console.log(`getCurrentDate: ${currentDate}`);
|
|
12
|
+
} catch (error) {
|
|
13
|
+
console.error('getCurrentDate: Error:', error);
|
|
14
|
+
} finally {
|
|
15
|
+
await queryRunner.release();
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { getCurrentDate };
|