@travetto/model-mysql 3.0.0-rc.4 → 3.0.0-rc.7

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 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/doc.ts and execute "npx trv doc" to rebuild -->
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#L23)
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
- options = {};
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#L9) annotation, and so these values can be overridden using the
97
- standard [Configuration](https://github.com/travetto/travetto/tree/main/module/config#readme "Environment-aware config management using yaml files")resolution paths.
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
- "displayName": "MySQL Model Service",
4
- "version": "3.0.0-rc.4",
3
+ "version": "3.0.0-rc.7",
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
- "index.ts",
20
+ "__index__.ts",
22
21
  "src",
23
22
  "support"
24
23
  ],
25
- "main": "index.ts",
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.4",
32
- "@travetto/context": "^3.0.0-rc.4",
33
- "@travetto/model": "^3.0.0-rc.4",
34
- "@travetto/model-query": "3.0.0-rc.4",
35
- "@travetto/model-sql": "^3.0.0-rc.4",
36
- "mysql": "^2.18.1",
37
- "@types/mysql": "^2.15.21"
30
+ "@travetto/config": "^3.0.0-rc.7",
31
+ "@travetto/context": "^3.0.0-rc.7",
32
+ "@travetto/model": "^3.0.0-rc.7",
33
+ "@travetto/model-query": "^3.0.0-rc.7",
34
+ "@travetto/model-sql": "^3.0.0-rc.7",
35
+ "@types/mysql": "^2.15.21",
36
+ "mysql": "^2.18.1"
38
37
  },
39
- "devDependencies": {
40
- "@travetto/app": "^3.0.0-rc.4"
38
+ "peerDependencies": {
39
+ "@travetto/command": "^3.0.0-rc.5"
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 * as mysql from 'mysql';
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.constructor.ᚕid, () => new Promise(r => this.#pool.end(r)));
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 { SQLDialect } from '@travetto/model-sql/srcinternal/util';
8
+ import { VisitStack } from '@travetto/model-sql/src/internal/util';
9
9
 
10
10
  import { MySQLConnection } from './connection';
11
11
 
@@ -1,7 +1,7 @@
1
- import { EnvUtil } from '@travetto/boot';
2
- import type { Service } from '@travetto/command/bin/lib/service';
1
+ import { Env } from '@travetto/base';
2
+ import type { Service } from '@travetto/command/support/bin/service';
3
3
 
4
- const version = EnvUtil.get('TRV_SERVICE_MYSQL', '5.6');
4
+ const version = Env.get('MYSQL_VERSION', '5.6');
5
5
 
6
6
  export const service: Service = {
7
7
  name: 'mysql',