@travetto/model-mysql 3.0.0-rc.0 → 3.0.0-rc.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/README.md +7 -6
- package/{index.ts → __index__.ts} +0 -0
- package/package.json +20 -13
- package/src/connection.ts +2 -2
- package/src/dialect.ts +1 -1
- package/support/service.mysql.ts +3 -3
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- This file was generated by @travetto/doc and should not be modified directly -->
|
|
2
|
-
<!-- Please modify https://github.com/travetto/travetto/tree/main/module/model-mysql/
|
|
2
|
+
<!-- Please modify https://github.com/travetto/travetto/tree/main/module/model-mysql/DOC.ts and execute "npx trv doc" to rebuild -->
|
|
3
3
|
# MySQL Model Service
|
|
4
4
|
## MySQL backing for the travetto model module, with real-time modeling support for SQL schemas.
|
|
5
5
|
|
|
@@ -16,7 +16,7 @@ a [SQL](https://en.wikipedia.org/wiki/SQL) database. Every table generated will
|
|
|
16
16
|
Supported features:
|
|
17
17
|
|
|
18
18
|
* [CRUD](https://github.com/travetto/travetto/tree/main/module/model/src/service/crud.ts#L11)
|
|
19
|
-
* [Bulk](https://github.com/travetto/travetto/tree/main/module/model/src/service/bulk.ts#
|
|
19
|
+
* [Bulk](https://github.com/travetto/travetto/tree/main/module/model/src/service/bulk.ts#L19)
|
|
20
20
|
* [Query Crud](https://github.com/travetto/travetto/tree/main/module/model-query/src/service/crud.ts#L11)
|
|
21
21
|
* [Facet](https://github.com/travetto/travetto/tree/main/module/model-query/src/service/facet.ts#L12)
|
|
22
22
|
* [Query](https://github.com/travetto/travetto/tree/main/module/model-query/src/service/query.ts#L10)
|
|
@@ -53,7 +53,7 @@ import { Config } from '@travetto/config';
|
|
|
53
53
|
* SQL Model Config
|
|
54
54
|
*/
|
|
55
55
|
@Config('model.sql')
|
|
56
|
-
export class SQLModelConfig {
|
|
56
|
+
export class SQLModelConfig<T extends {} = {}> {
|
|
57
57
|
/**
|
|
58
58
|
* Host to connect to
|
|
59
59
|
*/
|
|
@@ -89,9 +89,10 @@ export class SQLModelConfig {
|
|
|
89
89
|
/**
|
|
90
90
|
* Raw client options
|
|
91
91
|
*/
|
|
92
|
-
|
|
92
|
+
|
|
93
|
+
options: T = {} as T;
|
|
93
94
|
}
|
|
94
95
|
```
|
|
95
96
|
|
|
96
|
-
Additionally, you can see that the class is registered with the [@Config](https://github.com/travetto/travetto/tree/main/module/config/src/decorator.ts#
|
|
97
|
-
standard [Configuration](https://github.com/travetto/travetto/tree/main/module/config#readme "
|
|
97
|
+
Additionally, you can see that the class is registered with the [@Config](https://github.com/travetto/travetto/tree/main/module/config/src/decorator.ts#L13) annotation, and so these values can be overridden using the
|
|
98
|
+
standard [Configuration](https://github.com/travetto/travetto/tree/main/module/config#readme "Configuration support")resolution paths.
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/model-mysql",
|
|
3
|
-
"
|
|
4
|
-
"version": "3.0.0-rc.0",
|
|
3
|
+
"version": "3.0.0-rc.10",
|
|
5
4
|
"description": "MySQL backing for the travetto model module, with real-time modeling support for SQL schemas.",
|
|
6
5
|
"keywords": [
|
|
7
6
|
"sql",
|
|
@@ -18,26 +17,34 @@
|
|
|
18
17
|
"name": "Travetto Framework"
|
|
19
18
|
},
|
|
20
19
|
"files": [
|
|
21
|
-
"
|
|
20
|
+
"__index__.ts",
|
|
22
21
|
"src",
|
|
23
22
|
"support"
|
|
24
23
|
],
|
|
25
|
-
"main": "
|
|
24
|
+
"main": "__index__.ts",
|
|
26
25
|
"repository": {
|
|
27
26
|
"url": "https://github.com/travetto/travetto.git",
|
|
28
27
|
"directory": "module/model-mysql"
|
|
29
28
|
},
|
|
30
29
|
"dependencies": {
|
|
31
|
-
"@travetto/config": "^3.0.0-rc.
|
|
32
|
-
"@travetto/context": "^3.0.0-rc.
|
|
33
|
-
"@travetto/model": "^3.0.0-rc.
|
|
34
|
-
"@travetto/model-query": "3.0.0-rc.
|
|
35
|
-
"@travetto/model-sql": "^3.0.0-rc.
|
|
36
|
-
"mysql": "^2.
|
|
37
|
-
"
|
|
30
|
+
"@travetto/config": "^3.0.0-rc.10",
|
|
31
|
+
"@travetto/context": "^3.0.0-rc.10",
|
|
32
|
+
"@travetto/model": "^3.0.0-rc.10",
|
|
33
|
+
"@travetto/model-query": "^3.0.0-rc.10",
|
|
34
|
+
"@travetto/model-sql": "^3.0.0-rc.10",
|
|
35
|
+
"@types/mysql": "^2.15.21",
|
|
36
|
+
"mysql": "^2.18.1"
|
|
38
37
|
},
|
|
39
|
-
"
|
|
40
|
-
"@travetto/
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@travetto/command": "^3.0.0-rc.7"
|
|
40
|
+
},
|
|
41
|
+
"peerDependenciesMeta": {
|
|
42
|
+
"@travetto/command": {
|
|
43
|
+
"optional": true
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"travetto": {
|
|
47
|
+
"displayName": "MySQL Model Service"
|
|
41
48
|
},
|
|
42
49
|
"publishConfig": {
|
|
43
50
|
"access": "public"
|
package/src/connection.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import mysql from 'mysql';
|
|
2
2
|
|
|
3
3
|
import { ShutdownManager } from '@travetto/base';
|
|
4
4
|
import { AsyncContext } from '@travetto/context';
|
|
@@ -34,7 +34,7 @@ export class MySQLConnection extends Connection<mysql.PoolConnection> {
|
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
// Close mysql
|
|
37
|
-
ShutdownManager.onShutdown(this
|
|
37
|
+
ShutdownManager.onShutdown(this, () => new Promise(r => this.#pool.end(r)));
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/**
|
package/src/dialect.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { WhereClause } from '@travetto/model-query';
|
|
|
5
5
|
import { Class } from '@travetto/base';
|
|
6
6
|
import { ModelType } from '@travetto/model';
|
|
7
7
|
import { SQLModelConfig, SQLDialect } from '@travetto/model-sql';
|
|
8
|
-
import {
|
|
8
|
+
import { VisitStack } from '@travetto/model-sql/src/internal/util';
|
|
9
9
|
|
|
10
10
|
import { MySQLConnection } from './connection';
|
|
11
11
|
|
package/support/service.mysql.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { Service } from '@travetto/command/bin/
|
|
1
|
+
import { Env } from '@travetto/base';
|
|
2
|
+
import type { Service } from '@travetto/command/support/bin/service';
|
|
3
3
|
|
|
4
|
-
const version =
|
|
4
|
+
const version = Env.get('MYSQL_VERSION', '5.6');
|
|
5
5
|
|
|
6
6
|
export const service: Service = {
|
|
7
7
|
name: 'mysql',
|