retold-data-service 1.0.1 → 1.0.2

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.
Files changed (28) hide show
  1. package/debug/Build-Database.sh +12 -0
  2. package/debug/Harness-Configuration.json +1 -1
  3. package/debug/{model/ddl/Model.ddl → Model.ddl} +0 -0
  4. package/debug/model/{Model-Extended.json → MeadowModel-Extended.json} +0 -0
  5. package/debug/model/{Model-PICT.json → MeadowModel-PICT.json} +0 -0
  6. package/debug/model/{Model.json → MeadowModel.json} +0 -0
  7. package/debug/model/{generated_documentation → doc}/Dictionary.md +1 -1
  8. package/debug/model/{generated_documentation → doc}/Model-Author.md +1 -1
  9. package/debug/model/{generated_documentation → doc}/Model-Book.md +1 -1
  10. package/debug/model/{generated_documentation → doc}/Model-BookAuthorJoin.md +1 -1
  11. package/debug/model/{generated_documentation → doc}/Model-BookPrice.md +1 -1
  12. package/debug/model/{generated_documentation → doc}/Model-Review.md +1 -1
  13. package/debug/model/{generated_documentation → doc}/ModelChangeTracking.md +1 -1
  14. package/debug/model/{generated_documentation/diagrams/Stricture_Output.dot → doc/diagrams/Relationships.dot} +1 -1
  15. package/debug/model/doc/diagrams/Relationships.png +0 -0
  16. package/debug/model/{generated_documentation/diagrams/full/Stricture_Output.dot → doc/diagrams/RelationshipsFull.dot} +1 -1
  17. package/debug/model/doc/diagrams/RelationshipsFull.png +0 -0
  18. package/debug/model/meadow/{Model-MeadowSchema-Author.json → MeadowSchemaAuthor.json} +0 -0
  19. package/debug/model/meadow/{Model-MeadowSchema-Book.json → MeadowSchemaBook.json} +0 -0
  20. package/debug/model/meadow/{Model-MeadowSchema-BookAuthorJoin.json → MeadowSchemaBookAuthorJoin.json} +0 -0
  21. package/debug/model/meadow/{Model-MeadowSchema-BookPrice.json → MeadowSchemaBookPrice.json} +0 -0
  22. package/debug/model/meadow/{Model-MeadowSchema-Review.json → MeadowSchemaReview.json} +0 -0
  23. package/debug/model/{mysql/Model-CreateDatabase.mysql.sql → mysql_create/MeadowModel-CreateMySQLDatabase.mysql.sql} +1 -1
  24. package/package.json +4 -4
  25. package/source/Retold-Data-Service.js +6 -3
  26. package/debug/model/Build-Database.sh +0 -22
  27. package/debug/model/generated_documentation/diagrams/Stricture_Output.png +0 -0
  28. package/debug/model/generated_documentation/diagrams/full/Stricture_Output.png +0 -0
@@ -0,0 +1,12 @@
1
+ #! /bin/bash
2
+ echo "Example - Database Build Script"
3
+ echo "Contact: Steven Velozo <steven@velozo.com>"
4
+ echo ""
5
+ echo "---"
6
+ echo ""
7
+
8
+ echo "--> Stricture now generates everything automatically"
9
+ echo "--> It loads from ./Model.ddl if no parameters are passed"
10
+ npx stricture
11
+
12
+ echo "--> Database Code generation and compilation complete!"
@@ -34,7 +34,7 @@
34
34
  "DefaultMeadowDataProvider": "MySQL",
35
35
 
36
36
  "MeadowModel": "/home/coder/retold-dev/library/debug/model/Model.json",
37
- "MeadowEntitySchemaPrefix": "/home/coder/retold-dev/library/debug/model/meadow/Model-MeadowSchema-",
37
+ "MeadowEntitySchemaPrefix": "/home/coder/retold-dev/library/debug/model/meadow/MeadowSchema-",
38
38
 
39
39
  "StrictureDDL": false
40
40
  },
File without changes
File without changes
@@ -15,4 +15,4 @@ Table | Column Count
15
15
 
16
16
  - - -
17
17
 
18
- Generated on 2022-04-12 at 05:42
18
+ Generated on 2022-05-23 at 09:07
@@ -17,4 +17,4 @@ DeletingIDUser | | Numeric |
17
17
  Name | 200 | String |
18
18
  - - -
19
19
 
20
- Generated on 2022-04-12 at 05:42
20
+ Generated on 2022-05-23 at 09:07
@@ -23,4 +23,4 @@ ImageURL | 254 | String |
23
23
  PublicationYear | | Numeric |
24
24
  - - -
25
25
 
26
- Generated on 2022-04-12 at 05:42
26
+ Generated on 2022-05-23 at 09:07
@@ -11,4 +11,4 @@ IDBook | | Numeric | Book.IDBook
11
11
  IDAuthor | | Numeric | Author.IDAuthor
12
12
  - - -
13
13
 
14
- Generated on 2022-04-12 at 05:42
14
+ Generated on 2022-05-23 at 09:07
@@ -22,4 +22,4 @@ CouponCode | 16 | String |
22
22
  IDBook | | Numeric | Book.IDBook
23
23
  - - -
24
24
 
25
- Generated on 2022-04-12 at 05:42
25
+ Generated on 2022-05-23 at 09:07
@@ -19,4 +19,4 @@ Rating | | Numeric |
19
19
  IDBook | | Numeric | Book.IDBook
20
20
  - - -
21
21
 
22
- Generated on 2022-04-12 at 05:42
22
+ Generated on 2022-05-23 at 09:07
@@ -14,4 +14,4 @@ BookPrice | X | X | X
14
14
  Review | X | X | X
15
15
  - - -
16
16
 
17
- Generated on 2022-04-12 at 05:42
17
+ Generated on 2022-05-23 at 09:07
@@ -1,4 +1,4 @@
1
- ## Table Connection Graph -- Generated 2022-04-12T05:42:45.172Z
1
+ ## Table Connection Graph -- Generated 2022-05-23T16:07:11.401Z
2
2
  digraph DataModel {
3
3
  rankdir=LR
4
4
  Book;
@@ -1,4 +1,4 @@
1
- ## Table Connection Graph -- Generated 2022-04-12T05:42:47.865Z
1
+ ## Table Connection Graph -- Generated 2022-05-23T16:07:11.408Z
2
2
  digraph DataModel {
3
3
  rankdir=LR
4
4
  Book;
@@ -1,4 +1,4 @@
1
- -- Data Model -- Generated 2022-04-12T05:42:37.433Z
1
+ -- Data Model -- Generated 2022-05-23T16:07:11.382Z
2
2
 
3
3
  -- This script creates the following tables:
4
4
  -- Table ----------------------------------------- Column Count ----------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "retold-data-service",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Serve up a whole model!",
5
5
  "main": "source/Retold-Data-Service.js",
6
6
  "scripts": {
@@ -27,8 +27,7 @@
27
27
  "chai": "3.5.0",
28
28
  "coveralls": "2.13.1",
29
29
  "istanbul": "0.4.5",
30
- "mocha": "3.4.1",
31
- "mysql2": "1.2.0"
30
+ "mocha": "3.4.1"
32
31
  },
33
32
  "dependencies": {
34
33
  "async": "^3.2.3",
@@ -38,6 +37,7 @@
38
37
  "orator": "^2.0.4",
39
38
  "restify": "^8.6.1",
40
39
  "simple-get": "^4.0.1",
41
- "underscore": "^1.13.2"
40
+ "underscore": "^1.13.2",
41
+ "mysql2": "1.2.0"
42
42
  }
43
43
  }
@@ -67,11 +67,13 @@ class RetoldDataService
67
67
  if (this._Settings.Retold.hasOwnProperty('MeadowModel'))
68
68
  {
69
69
  // One or many full Model file path(s) has been set
70
+ this._Settings.Retold.MeadowModel = `${process.cwd()}/model/MeadowModel.json`;
70
71
  }
71
72
 
72
- if (this._Settings.Retold.hasOwnProperty('MeadowEntitySchema'))
73
+ if (this._Settings.Retold.hasOwnProperty('MeadowEntitySchemaPrefix'))
73
74
  {
74
75
  // One or many Entity Schema file path(s) is set
76
+ this._Settings.Retold.MeadowEntitySchemaPrefix = `${process.cwd()}/model/meadow/MeadowSchema`;
75
77
  }
76
78
  }
77
79
  else
@@ -101,8 +103,9 @@ class RetoldDataService
101
103
  "DefaultMeadowDataProvider": "Base",
102
104
 
103
105
  // Either the Meadow side or Stricture side should be set.
104
- "MeadowModel": false,
105
- "MeadowEntitySchemaPrefix": false,
106
+ // Try to use the opinionated Stricture locations if they arent (you really should set this though!)
107
+ "MeadowModel": `${process.cwd()}/model/MeadowModel.json`,
108
+ "MeadowEntitySchemaPrefix": `${process.cwd()}/model/meadow/MeadowSchema`,
106
109
 
107
110
  "StrictureDDL": false
108
111
  });
@@ -1,22 +0,0 @@
1
- #! /bin/bash
2
- echo "Example - Database Build Script"
3
- echo "Contact: Steven Velozo <steven@velozo.com>"
4
- echo ""
5
- echo "---"
6
- echo ""
7
-
8
- echo "--> Generating JSON model from DDL (with the BookStore prefix)"
9
- npx stricture -i ./ddl/Model.ddl -c Compile -f ./ -o Model
10
-
11
- echo "--> Generating MySQL Create Statements"
12
- npx stricture -i ./Model-Extended.json -c MySQL -f ./mysql/ -o "Model-CreateDatabase"
13
-
14
- echo "--> Generating Meadow Schemas"
15
- npx stricture -i ./Model-Extended.json -c Meadow -f ./meadow/ -o "Model-MeadowSchema-"
16
-
17
- echo "--> Generating Documentation"
18
- npx stricture -i ./Model-Extended.json -c Documentation -g -f ./generated_documentation/
19
- npx stricture -i ./Model-Extended.json -c Relationships -g -f ./generated_documentation/diagrams/
20
- npx stricture -i ./Model-Extended.json -c RelationshipsFull -g -f ./generated_documentation/diagrams/full/
21
-
22
- echo "--> Database Code generation and compilation complete!"