retold-data-service 2.0.8 → 2.0.9

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.
@@ -1,17 +1,36 @@
1
1
  {
2
2
  "sqltools.connections": [
3
- {
4
- "mysqlOptions": {
5
- "authProtocol": "default"
6
- },
7
- "previewLimit": 50,
8
- "server": "localhost",
9
- "port": 3306,
10
- "driver": "MariaDB",
11
- "name": "Local",
12
- "database": "bookstore",
13
- "username": "root",
14
- "password": "123456789"
15
- }
16
- ]
3
+ {
4
+ "mysqlOptions": {
5
+ "authProtocol": "default",
6
+ "enableSsl": "Disabled"
7
+ },
8
+ "ssh": "Disabled",
9
+ "previewLimit": 50,
10
+ "server": "localhost",
11
+ "port": 3306,
12
+ "driver": "MariaDB",
13
+ "name": "Local MariaDB Harness",
14
+ "database": "bookstore",
15
+ "username": "root",
16
+ "password": "123456789",
17
+ "group": "Retold Development"
18
+ },
19
+ {
20
+ "mysqlOptions": {
21
+ "authProtocol": "default",
22
+ "enableSsl": "Disabled"
23
+ },
24
+ "ssh": "Disabled",
25
+ "previewLimit": 50,
26
+ "server": "localhost",
27
+ "port": 31306,
28
+ "driver": "MariaDB",
29
+ "name": "Containerized MariaDB Harness",
30
+ "group": "Retold Development",
31
+ "database": "bookstore",
32
+ "username": "root",
33
+ "password": "123456789"
34
+ }
35
+ ]
17
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "retold-data-service",
3
- "version": "2.0.8",
3
+ "version": "2.0.9",
4
4
  "description": "Serve up a whole model!",
5
5
  "main": "source/Retold-Data-Service.js",
6
6
  "scripts": {
@@ -110,19 +110,28 @@ class RetoldDataService extends libFableServiceProviderBase
110
110
  {
111
111
  // 4. Create the DAL for each entry (e.g. it would be at _DAL.Movie for the Movie entity)
112
112
  let tmpDALEntityName = this.entityList[i];
113
- let tmpDALPackageObject = this.fullModel.Tables[tmpDALEntityName];
114
- // We no longer need to load it from a package file; it's all in the full model
115
- this.fable.log.info(`Initializing the ${tmpDALEntityName} DAL...`);
116
- this._DAL[tmpDALEntityName] = this._Meadow.loadFromPackageObject(tmpDALPackageObject.MeadowSchema);
117
- // 5. Tell this DAL object to use the specified storage provider
118
- this.fable.log.info(`...defaulting the ${tmpDALEntityName} DAL to use ${this.options.StorageProvider}`);
119
- this._DAL[tmpDALEntityName].setProvider(this.options.StorageProvider);
120
- // 6. Create a Meadow Endpoints class for this DAL
121
- this.fable.log.info(`...initializing the ${tmpDALEntityName} Meadow Endpoints to use ${this.options.StorageProvider}`);
122
- this._MeadowEndpoints[tmpDALEntityName] = libMeadowEndpoints.new(this._DAL[tmpDALEntityName]);
123
- // 8. Expose the meadow endpoints on Orator
124
- this.fable.log.info(`...mapping the ${tmpDALEntityName} Meadow Endpoints to Orator`);
125
- this._MeadowEndpoints[tmpDALEntityName].connectRoutes(this.fable.OratorServiceServer);
113
+ try
114
+ {
115
+ let tmpDALSchema = this.fullModel.Tables[tmpDALEntityName];
116
+ let tmpDALMeadowSchema = tmpDALSchema.MeadowSchema;
117
+
118
+ //let tmpDALPackageFile = `${this.options.DALMeadowSchemaPath}${this.options.DALMeadowSchemaPrefix}${tmpDALEntityName}${this.options.DALMeadowSchemaPostfix}.json`
119
+ //this.fable.log.info(`Initializing the ${tmpDALEntityName} DAL from [${tmpDALPackageFile}]...`);
120
+ this._DAL[tmpDALEntityName] = this._Meadow.loadFromPackageObject(tmpDALMeadowSchema);
121
+ // 5. Tell this DAL object to use MySQL
122
+ this.fable.log.info(`...defaulting the ${tmpDALEntityName} DAL to use MySQL`);
123
+ this._DAL[tmpDALEntityName].setProvider('MySQL');
124
+ // 6. Create a Meadow Endpoints class for this DAL
125
+ this.fable.log.info(`...initializing the ${tmpDALEntityName} Meadow Endpoints to use MySQL`);
126
+ this._MeadowEndpoints[tmpDALEntityName] = libMeadowEndpoints.new(this._DAL[tmpDALEntityName]);
127
+ // 8. Expose the meadow endpoints on Orator
128
+ this.fable.log.info(`...mapping the ${tmpDALEntityName} Meadow Endpoints to Orator`);
129
+ this._MeadowEndpoints[tmpDALEntityName].connectRoutes(this.fable.OratorServiceServer);
130
+ }
131
+ catch (pError)
132
+ {
133
+ this.fable.log.error(`Error initializing DAL and Endpoints for entity [${tmpDALEntityName}]: ${pError}`);
134
+ }
126
135
  }
127
136
 
128
137
  return fCallback();