meadow-connection-mysql 1.0.7 → 1.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.
@@ -0,0 +1,50 @@
1
+ # Contributing to Retold
2
+
3
+ We welcome contributions to Retold and its modules. This guide covers the expectations and process for contributing.
4
+
5
+ ## Code of Conduct
6
+
7
+ The Retold community values **empathy**, **equity**, **kindness**, and **thoughtfulness**. We expect all participants to treat each other with respect, assume good intent, and engage constructively. These values apply to all interactions: pull requests, issues, discussions, and code review.
8
+
9
+ ## How to Contribute
10
+
11
+ ### Pull Requests
12
+
13
+ Pull requests are the preferred method for contributing changes. To submit one:
14
+
15
+ 1. Fork the module repository you want to change
16
+ 2. Create a branch for your work
17
+ 3. Make your changes, following the code style of the module you are editing
18
+ 4. Ensure your changes have test coverage (see below)
19
+ 5. Open a pull request against the module's main branch
20
+
21
+ **Submitting a pull request does not guarantee it will be accepted.** Maintainers review contributions for fit, quality, and alignment with the project's direction. A PR may be declined, or you may be asked to revise it. This is normal and not a reflection on the quality of your effort.
22
+
23
+ ### Reporting Issues
24
+
25
+ If you find a bug or have a feature suggestion, open an issue on the relevant module's repository. Include enough detail to reproduce the problem or understand the proposal.
26
+
27
+ ## Test Coverage
28
+
29
+ Every commit must include test coverage for the changes it introduces. Retold modules use Mocha in TDD style. Before submitting:
30
+
31
+ - **Write tests** for any new functionality or bug fixes
32
+ - **Run the existing test suite** with `npm test` and confirm all tests pass
33
+ - **Check coverage** with `npm run coverage` if the module supports it
34
+
35
+ Pull requests that break existing tests or lack coverage for new code will not be merged.
36
+
37
+ ## Code Style
38
+
39
+ Follow the conventions of the module you are working in. The general Retold style is:
40
+
41
+ - **Tabs** for indentation, never spaces
42
+ - **Plain JavaScript** only (no TypeScript)
43
+ - **Allman-style braces** (opening brace on its own line)
44
+ - **Variable naming:** `pVariable` for parameters, `tmpVariable` for temporaries, `libSomething` for imports
45
+
46
+ When in doubt, match what the surrounding code does.
47
+
48
+ ## Repository Structure
49
+
50
+ Each module is its own git repository. The [retold](https://github.com/stevenvelozo/retold) repository tracks module organization but does not contain module source code. Direct your pull request to the specific module repository where your change belongs.
package/README.md CHANGED
@@ -189,10 +189,15 @@ Run with coverage:
189
189
  npm run coverage
190
190
  ```
191
191
 
192
+ ## Related Packages
193
+
194
+ - [meadow](https://github.com/stevenvelozo/meadow) - Data access and ORM
195
+ - [fable](https://github.com/stevenvelozo/fable) - Application services framework
196
+
192
197
  ## License
193
198
 
194
- MIT - See [LICENSE](LICENSE) for details.
199
+ MIT
195
200
 
196
- ## Author
201
+ ## Contributing
197
202
 
198
- Steven Velozo - [steven@velozo.com](mailto:steven@velozo.com)
203
+ Pull requests are welcome. For details on our code of conduct, contribution process, and testing requirements, see the [Retold Contributing Guide](https://github.com/stevenvelozo/retold/blob/main/docs/contributing.md).
@@ -0,0 +1,19 @@
1
+ version: '3.8'
2
+
3
+ services:
4
+ mysql-test:
5
+ image: mysql:8
6
+ container_name: meadow-connection-mysql-test
7
+ environment:
8
+ MYSQL_ROOT_PASSWORD: "1234567890"
9
+ MYSQL_DATABASE: bookstore
10
+ ports:
11
+ - "23306:3306"
12
+ volumes:
13
+ - ./test/docker-init:/docker-entrypoint-initdb.d
14
+ healthcheck:
15
+ test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p1234567890"]
16
+ interval: 5s
17
+ timeout: 5s
18
+ retries: 20
19
+ start_period: 10s
@@ -1,5 +1,5 @@
1
1
  {
2
- "Generated": "2026-02-15T22:16:49.979Z",
2
+ "Generated": "2026-02-18T03:39:19.680Z",
3
3
  "GitHubOrg": "stevenvelozo",
4
4
  "DefaultBranch": "master",
5
5
  "Groups": [
@@ -57,6 +57,25 @@
57
57
  }
58
58
  ]
59
59
  },
60
+ {
61
+ "Name": "Docs",
62
+ "Key": "docs",
63
+ "Description": "",
64
+ "Modules": [
65
+ {
66
+ "Name": "css",
67
+ "Repo": "css",
68
+ "Group": "docs",
69
+ "Branch": "master",
70
+ "HasDocs": true,
71
+ "HasCover": false,
72
+ "Sidebar": [],
73
+ "DocFiles": [
74
+ "css/docuserve.css"
75
+ ]
76
+ }
77
+ ]
78
+ },
60
79
  {
61
80
  "Name": "Retold-harness",
62
81
  "Key": "retold-harness",
@@ -93,6 +112,23 @@
93
112
  "DocFiles": []
94
113
  }
95
114
  ]
115
+ },
116
+ {
117
+ "Name": "Test",
118
+ "Key": "test",
119
+ "Description": "",
120
+ "Modules": [
121
+ {
122
+ "Name": "docker-init",
123
+ "Repo": "docker-init",
124
+ "Group": "test",
125
+ "Branch": "master",
126
+ "HasDocs": false,
127
+ "HasCover": false,
128
+ "Sidebar": [],
129
+ "DocFiles": []
130
+ }
131
+ ]
96
132
  }
97
133
  ]
98
134
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "Generated": "2026-02-15T22:16:50.065Z",
2
+ "Generated": "2026-02-18T03:39:19.765Z",
3
3
  "DocumentCount": 0,
4
4
  "LunrIndex": {
5
5
  "version": "2.3.9",
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "meadow-connection-mysql",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Meadow MySQL Plugin",
5
5
  "main": "source/Meadow-Connection-MySQL.js",
6
6
  "scripts": {
7
- "coverage": "./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha -- -u tdd -R spec",
8
- "test": "./node_modules/mocha/bin/_mocha -u tdd --exit -R spec",
7
+ "coverage": "npx quack coverage",
8
+ "test": "npx quack test",
9
+ "docker-mysql-start": "bash ./start-mysql.sh",
10
+ "docker-mysql-stop": "bash ./stop-mysql.sh",
11
+ "test-docker": "bash ./start-mysql.sh && npm test; bash ./stop-mysql.sh",
9
12
  "docker-dev-build": "docker build ./ -f Dockerfile_LUXURYCode -t retold/meadow-connection-mysql:local",
10
13
  "docker-dev-run": "docker run -it -d --name retold-meadow-connection-mysql-dev -p 38001:8080 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/meadow-connection-mysql\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" retold/meadow-connection-mysql:local",
11
14
  "docker-dev-shell": "docker exec -it retold-meadow-connection-mysql-dev /bin/bash"
@@ -42,25 +45,12 @@
42
45
  },
43
46
  "homepage": "https://github.com/stevenvelozo/meadow-connection-mysql",
44
47
  "devDependencies": {
45
- "@babel/core": "^7.23.2",
46
- "@babel/preset-env": "^7.23.2",
47
- "browserify": "^17.0.0",
48
- "chai": "4.3.10",
49
- "fable": "^3.1.53",
50
- "gulp": "^4.0.2",
51
- "gulp-babel": "^8.0.0",
52
- "gulp-env": "^0.4.0",
53
- "gulp-sourcemaps": "^3.0.0",
54
- "gulp-terser": "^2.1.0",
48
+ "fable": "^3.1.55",
55
49
  "gulp-util": "^3.0.8",
56
- "mocha": "10.2.0",
57
- "nyc": "^15.1.0",
58
- "quackage": "^1.0.48",
59
- "vinyl-buffer": "^1.0.1",
60
- "vinyl-source-stream": "^2.0.0"
50
+ "quackage": "^1.0.58"
61
51
  },
62
52
  "dependencies": {
63
- "fable-serviceproviderbase": "^3.0.16",
53
+ "fable-serviceproviderbase": "^3.0.19",
64
54
  "mysql2": "^3.6.3"
65
55
  }
66
56
  }
package/start-mysql.sh ADDED
@@ -0,0 +1,21 @@
1
+ #!/bin/bash
2
+ # Start the MySQL test server in Docker
3
+ # Uses port 23306 to avoid conflicts with any local MySQL instance
4
+
5
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
+
7
+ echo "Starting MySQL test server on port 23306..."
8
+ docker compose -f "${SCRIPT_DIR}/docker-compose.yml" up -d
9
+
10
+ echo "Waiting for MySQL to be ready..."
11
+ until docker compose -f "${SCRIPT_DIR}/docker-compose.yml" exec -T mysql-test mysqladmin ping -h localhost -u root -p1234567890 --silent 2>/dev/null; do
12
+ sleep 2
13
+ echo " ...still waiting"
14
+ done
15
+
16
+ echo "MySQL test server is ready on port 23306"
17
+ echo " Host: 127.0.0.1"
18
+ echo " Port: 23306"
19
+ echo " User: root"
20
+ echo " Password: 1234567890"
21
+ echo " Database: bookstore"
package/stop-mysql.sh ADDED
@@ -0,0 +1,9 @@
1
+ #!/bin/bash
2
+ # Stop and remove the MySQL test server Docker container
3
+
4
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
+
6
+ echo "Stopping MySQL test server..."
7
+ docker compose -f "${SCRIPT_DIR}/docker-compose.yml" down -v
8
+
9
+ echo "MySQL test server stopped and volumes removed."
@@ -33,11 +33,9 @@ const _FableConfig = (
33
33
  "MySQL":
34
34
  {
35
35
  "Server": "127.0.0.1",
36
- // October 2025 - updated this to match retold harness running locally either in docker or natively
37
- "Port": 31306,
38
- //"Port": 3306,
36
+ "Port": 23306,
39
37
  "User": "root",
40
- "Password": "123456789",
38
+ "Password": "1234567890",
41
39
  "Database": "bookstore",
42
40
  "ConnectionPoolLimit": 20
43
41
  }
@@ -70,12 +68,12 @@ suite
70
68
  _Fable.MeadowMySQLProvider.connect();
71
69
 
72
70
  // We should now have a fully charged MySQL connection pool utensil
73
- _Fable.MeadowMySQLProvider.pool.query(`SELECT * FROM Book LIMIT 10`,
71
+ _Fable.MeadowMySQLProvider.pool.query(`SELECT * FROM Book ORDER BY IDBook ASC LIMIT 10`,
74
72
  (pError, pRows, pFields) =>
75
73
  {
76
74
  Expect(pRows).to.be.an('array');
77
75
  Expect(pRows.length).to.equal(10);
78
- Expect(pRows[0].Title).to.equal(`Angels & Demons`);
76
+ Expect(pRows[0].Title).to.equal(`The Hunger Games`);
79
77
  return fDone();
80
78
  });
81
79
  }
@@ -95,7 +93,7 @@ suite
95
93
  _Fable.MeadowMySQLProvider.connect();
96
94
 
97
95
  // We should now have a fully charged MySQL connection pool utensil
98
- _Fable.MeadowMySQLProvider.pool.query(`SELECT * FROM Book LIMIT 10`,
96
+ _Fable.MeadowMySQLProvider.pool.query(`SELECT * FROM Book ORDER BY IDBook ASC LIMIT 10`,
99
97
  (pError, pRows, pFields) =>
100
98
  {
101
99
  Expect(pRows).to.be.an('array');
@@ -121,7 +119,7 @@ suite
121
119
  function (pError, pConnectionPool)
122
120
  {
123
121
  // We should now have a fully charged MySQL connection pool utensil
124
- _Fable.MeadowMySQLProvider.pool.query(`SELECT * FROM Book LIMIT 10`,
122
+ _Fable.MeadowMySQLProvider.pool.query(`SELECT * FROM Book ORDER BY IDBook ASC LIMIT 10`,
125
123
  (pError, pRows, pFields) =>
126
124
  {
127
125
  Expect(pRows).to.be.an('array');
@@ -148,7 +146,7 @@ suite
148
146
  Expect(_Fable.MeadowMySQLProvider).to.be.an('object');
149
147
 
150
148
  // We should now have a fully charged MySQL connection pool utensil
151
- _Fable.MeadowMySQLProvider.pool.query(`SELECT * FROM Book LIMIT 10`,
149
+ _Fable.MeadowMySQLProvider.pool.query(`SELECT * FROM Book ORDER BY IDBook ASC LIMIT 10`,
152
150
  (pError, pRows, pFields) =>
153
151
  {
154
152
  Expect(pRows).to.be.an('array');
@@ -0,0 +1,115 @@
1
+ -- Bookstore schema and seed data for meadow-connection-mysql tests
2
+
3
+ USE bookstore;
4
+
5
+ -- [ Book ]
6
+ CREATE TABLE IF NOT EXISTS
7
+ Book
8
+ (
9
+ IDBook INT UNSIGNED NOT NULL AUTO_INCREMENT,
10
+ GUIDBook CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
11
+ CreateDate DATETIME,
12
+ CreatingIDUser INT NOT NULL DEFAULT '0',
13
+ UpdateDate DATETIME,
14
+ UpdatingIDUser INT NOT NULL DEFAULT '0',
15
+ Deleted TINYINT NOT NULL DEFAULT '0',
16
+ DeleteDate DATETIME,
17
+ DeletingIDUser INT NOT NULL DEFAULT '0',
18
+ Title CHAR(200) NOT NULL DEFAULT '',
19
+ Type CHAR(32) NOT NULL DEFAULT '',
20
+ Genre CHAR(128) NOT NULL DEFAULT '',
21
+ ISBN CHAR(64) NOT NULL DEFAULT '',
22
+ Language CHAR(12) NOT NULL DEFAULT '',
23
+ ImageURL CHAR(254) NOT NULL DEFAULT '',
24
+ PublicationYear INT NOT NULL DEFAULT '0',
25
+
26
+ PRIMARY KEY (IDBook)
27
+ ) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
28
+
29
+ -- [ BookAuthorJoin ]
30
+ CREATE TABLE IF NOT EXISTS
31
+ BookAuthorJoin
32
+ (
33
+ IDBookAuthorJoin INT UNSIGNED NOT NULL AUTO_INCREMENT,
34
+ GUIDBookAuthorJoin CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
35
+ IDBook INT NOT NULL DEFAULT '0',
36
+ IDAuthor INT NOT NULL DEFAULT '0',
37
+
38
+ PRIMARY KEY (IDBookAuthorJoin)
39
+ ) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
40
+
41
+ -- [ Author ]
42
+ CREATE TABLE IF NOT EXISTS
43
+ Author
44
+ (
45
+ IDAuthor INT UNSIGNED NOT NULL AUTO_INCREMENT,
46
+ GUIDAuthor CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
47
+ CreateDate DATETIME,
48
+ CreatingIDUser INT NOT NULL DEFAULT '0',
49
+ UpdateDate DATETIME,
50
+ UpdatingIDUser INT NOT NULL DEFAULT '0',
51
+ Deleted TINYINT NOT NULL DEFAULT '0',
52
+ DeleteDate DATETIME,
53
+ DeletingIDUser INT NOT NULL DEFAULT '0',
54
+ Name CHAR(200) NOT NULL DEFAULT '',
55
+
56
+ PRIMARY KEY (IDAuthor)
57
+ ) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
58
+
59
+ -- [ BookPrice ]
60
+ CREATE TABLE IF NOT EXISTS
61
+ BookPrice
62
+ (
63
+ IDBookPrice INT UNSIGNED NOT NULL AUTO_INCREMENT,
64
+ GUIDBookPrice CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
65
+ CreateDate DATETIME,
66
+ CreatingIDUser INT NOT NULL DEFAULT '0',
67
+ UpdateDate DATETIME,
68
+ UpdatingIDUser INT NOT NULL DEFAULT '0',
69
+ Deleted TINYINT NOT NULL DEFAULT '0',
70
+ DeleteDate DATETIME,
71
+ DeletingIDUser INT NOT NULL DEFAULT '0',
72
+ Price DECIMAL(8,2),
73
+ StartDate DATETIME,
74
+ EndDate DATETIME,
75
+ Discountable TINYINT NOT NULL DEFAULT '0',
76
+ CouponCode CHAR(16) NOT NULL DEFAULT '',
77
+ IDBook INT NOT NULL DEFAULT '0',
78
+
79
+ PRIMARY KEY (IDBookPrice)
80
+ ) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
81
+
82
+ -- [ Review ]
83
+ CREATE TABLE IF NOT EXISTS
84
+ Review
85
+ (
86
+ IDReviews INT UNSIGNED NOT NULL AUTO_INCREMENT,
87
+ GUIDReviews CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
88
+ CreateDate DATETIME,
89
+ CreatingIDUser INT NOT NULL DEFAULT '0',
90
+ UpdateDate DATETIME,
91
+ UpdatingIDUser INT NOT NULL DEFAULT '0',
92
+ Deleted TINYINT NOT NULL DEFAULT '0',
93
+ DeleteDate DATETIME,
94
+ DeletingIDUser INT NOT NULL DEFAULT '0',
95
+ Text TEXT,
96
+ Rating INT NOT NULL DEFAULT '0',
97
+ IDBook INT NOT NULL DEFAULT '0',
98
+
99
+ PRIMARY KEY (IDReviews)
100
+ ) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
101
+
102
+ -- Seed data: 12 books (tests require at least 10)
103
+ INSERT INTO Book (Title, Type, Genre, ISBN, Language, PublicationYear) VALUES
104
+ ('The Hunger Games', 'Paper', 'UNKNOWN', '439023483', 'eng', 2008),
105
+ ('Harry Potter and the Philosopher''s Stone', 'Paper', 'UNKNOWN', '439554934', 'eng', 1997),
106
+ ('Twilight', 'Paper', 'UNKNOWN', '316015849', 'en-US', 2005),
107
+ ('To Kill a Mockingbird', 'Paper', 'UNKNOWN', '61120081', 'eng', 1960),
108
+ ('The Great Gatsby', 'Paper', 'UNKNOWN', '743273567', 'eng', 1925),
109
+ ('The Fault in Our Stars', 'Paper', 'UNKNOWN', '525478817', 'eng', 2012),
110
+ ('The Hobbit', 'Paper', 'UNKNOWN', '618260307', 'en-US', 1937),
111
+ ('The Catcher in the Rye', 'Paper', 'UNKNOWN', '316769177', 'eng', 1951),
112
+ ('Angels & Demons', 'Paper', 'UNKNOWN', '1416524797', 'en-CA', 2000),
113
+ ('Pride and Prejudice', 'Paper', 'UNKNOWN', '679783261', 'eng', 1813),
114
+ ('The Kite Runner', 'Paper', 'UNKNOWN', '1594480001', 'eng', 2003),
115
+ ('Divergent', 'Paper', 'UNKNOWN', '62024035', 'eng', 2011);