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.
- package/.vscode/settings.json +33 -14
- package/package.json +1 -1
- package/source/Retold-Data-Service.js +22 -13
package/.vscode/settings.json
CHANGED
|
@@ -1,17 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sqltools.connections": [
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
@@ -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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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();
|