@quantform/sqlite 0.7.0-beta.9 → 0.7.10
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/jest.config.ts +1 -1
- package/lib/index.d.ts +3 -0
- package/{dist → lib}/index.d.ts.map +1 -1
- package/{dist → lib}/index.js +1 -1
- package/{dist → lib}/sqlite-storage.js +2 -2
- package/package.json +7 -7
- package/src/index.ts +2 -2
- package/src/sqlite-storage.ts +3 -3
- package/tsconfig.json +2 -2
- package/dist/index.d.ts +0 -6
- /package/{dist → lib}/sqlite-language.d.ts +0 -0
- /package/{dist → lib}/sqlite-language.d.ts.map +0 -0
- /package/{dist → lib}/sqlite-language.js +0 -0
- /package/{dist → lib}/sqlite-language.spec.d.ts +0 -0
- /package/{dist → lib}/sqlite-language.spec.d.ts.map +0 -0
- /package/{dist → lib}/sqlite-language.spec.js +0 -0
- /package/{dist → lib}/sqlite-storage.d.ts +0 -0
- /package/{dist → lib}/sqlite-storage.d.ts.map +0 -0
- /package/{dist → lib}/sqlite-storage.spec.d.ts +0 -0
- /package/{dist → lib}/sqlite-storage.spec.d.ts.map +0 -0
- /package/{dist → lib}/sqlite-storage.spec.js +0 -0
package/jest.config.ts
CHANGED
|
@@ -23,7 +23,7 @@ const config: Config = {
|
|
|
23
23
|
}
|
|
24
24
|
]
|
|
25
25
|
},
|
|
26
|
-
testPathIgnorePatterns: ['<rootDir>/
|
|
26
|
+
testPathIgnorePatterns: ['<rootDir>/lib/'],
|
|
27
27
|
roots: ['<rootDir>'],
|
|
28
28
|
modulePaths: [compilerOptions.baseUrl],
|
|
29
29
|
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
|
package/lib/index.d.ts
ADDED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC;AAEpC,wBAAgB,MAAM,CAAC,SAAS,CAAC,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC;AAEpC,wBAAgB,MAAM,CAAC,SAAS,CAAC,EAAE,MAAM,wCAExC"}
|
package/{dist → lib}/index.js
RENAMED
|
@@ -19,6 +19,6 @@ const sqlite_storage_1 = require("./sqlite-storage");
|
|
|
19
19
|
const core_1 = require("@quantform/core");
|
|
20
20
|
__exportStar(require("./sqlite-storage"), exports);
|
|
21
21
|
function sqlite(directory) {
|
|
22
|
-
return
|
|
22
|
+
return core_1.useStorageFactory.options(new sqlite_storage_1.SQLiteStorageFactory(directory));
|
|
23
23
|
}
|
|
24
24
|
exports.sqlite = sqlite;
|
|
@@ -51,7 +51,7 @@ class SQLiteStorage {
|
|
|
51
51
|
return this.connection
|
|
52
52
|
.prepare("SELECT name FROM sqlite_master WHERE type='table'")
|
|
53
53
|
.all()
|
|
54
|
-
.map(it => it.name);
|
|
54
|
+
.map((it) => it.name);
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
// eslint-disable-next-line complexity
|
|
@@ -67,7 +67,7 @@ class SQLiteStorage {
|
|
|
67
67
|
.prepare(sqlite_language_1.SQLiteLanguage.query(type, query))
|
|
68
68
|
.all();
|
|
69
69
|
const types = Object.keys(type.type);
|
|
70
|
-
objects.forEach(it => {
|
|
70
|
+
objects.forEach((it) => {
|
|
71
71
|
for (const prop of types) {
|
|
72
72
|
if (type.type[prop] == 'decimal') {
|
|
73
73
|
it[prop] = (0, core_1.d)(it[prop]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quantform/sqlite",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Mateusz Majchrzak",
|
|
6
6
|
"description": "Node.js library for building systematic trading strategies in reactive way.",
|
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
14
|
-
"main": "
|
|
15
|
-
"typings": "
|
|
14
|
+
"main": "lib/index.js",
|
|
15
|
+
"typings": "lib/index.d.ts",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"better-sqlite3": "
|
|
17
|
+
"better-sqlite3": "11.7.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@types/better-sqlite3": "^7.6.
|
|
21
|
-
"@quantform/core": "0.7.
|
|
20
|
+
"@types/better-sqlite3": "^7.6.12",
|
|
21
|
+
"@quantform/core": "0.7.10"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@quantform/core": "0.7.
|
|
24
|
+
"@quantform/core": "0.7.10"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "tsc && tsc-alias",
|
package/src/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SQLiteStorageFactory } from '@lib/sqlite-storage';
|
|
2
|
-
import {
|
|
2
|
+
import { useStorageFactory } from '@quantform/core';
|
|
3
3
|
|
|
4
4
|
export * from '@lib/sqlite-storage';
|
|
5
5
|
|
|
6
6
|
export function sqlite(directory?: string) {
|
|
7
|
-
return
|
|
7
|
+
return useStorageFactory.options(new SQLiteStorageFactory(directory));
|
|
8
8
|
}
|
package/src/sqlite-storage.ts
CHANGED
|
@@ -44,7 +44,7 @@ export class SQLiteStorage implements Storage {
|
|
|
44
44
|
return this.connection
|
|
45
45
|
.prepare("SELECT name FROM sqlite_master WHERE type='table'")
|
|
46
46
|
.all()
|
|
47
|
-
.map(it => it.name);
|
|
47
|
+
.map((it: any) => it.name);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
// eslint-disable-next-line complexity
|
|
@@ -60,13 +60,13 @@ export class SQLiteStorage implements Storage {
|
|
|
60
60
|
return [];
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
const objects = await this.connection
|
|
63
|
+
const objects: any[] = await this.connection
|
|
64
64
|
.prepare(SQLiteLanguage.query(type, query))
|
|
65
65
|
.all();
|
|
66
66
|
|
|
67
67
|
const types = Object.keys(type.type);
|
|
68
68
|
|
|
69
|
-
objects.forEach(it => {
|
|
69
|
+
objects.forEach((it: any) => {
|
|
70
70
|
for (const prop of types) {
|
|
71
71
|
if (type.type[prop] == 'decimal') {
|
|
72
72
|
it[prop] = d(it[prop]);
|
package/tsconfig.json
CHANGED
package/dist/index.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|