leoric 2.10.1 → 2.10.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.
- package/Readme.md +33 -0
- package/package.json +1 -1
- package/src/spell.js +1 -2
package/Readme.md
CHANGED
|
@@ -118,3 +118,36 @@ If you are interested in fixing issues and contributing directly to the code bas
|
|
|
118
118
|
## egg-orm
|
|
119
119
|
|
|
120
120
|
If developing web applications with [egg framework](https://eggjs.org/), it's highly recommended using the [egg-orm](https://github.com/eggjs/egg-orm) plugin. More detailed examples about setting up egg-orm with egg framework in either JavaScript or TypeScript can be found at <https://github.com/eggjs/egg-orm/tree/master/examples>
|
|
121
|
+
|
|
122
|
+
## mysql nuances
|
|
123
|
+
|
|
124
|
+
macOS binds localhost to ipv6 `::1`, yet both mysql and mysql2 connect database with localhost by default, which means both will try connecting to mysql with `::1`. However, the mysql distribution installed with HomeBrew sets `bind_address = 127.0.0.1`, hence causes following error:
|
|
125
|
+
|
|
126
|
+
```js
|
|
127
|
+
Error: connect ECONNREFUSED ::1:3306
|
|
128
|
+
at __node_internal_captureLargerStackTrace (node:internal/errors:490:5)
|
|
129
|
+
at __node_internal_exceptionWithHostPort (node:internal/errors:668:12)
|
|
130
|
+
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Please change the configuration as below:
|
|
134
|
+
|
|
135
|
+
```diff
|
|
136
|
+
diff --git a/usr/local/etc/my.cnf b/usr/local/etc/my.cnf
|
|
137
|
+
index 7218354..d31859c 100644
|
|
138
|
+
--- a/usr/local/etc/my.cnf
|
|
139
|
+
+++ b/usr/local/etc/my.cnf
|
|
140
|
+
@@ -1,5 +1,5 @@
|
|
141
|
+
# Default Homebrew MySQL server config
|
|
142
|
+
[mysqld]
|
|
143
|
+
# Only allow connections from localhost
|
|
144
|
+
-bind-address = 127.0.0.1
|
|
145
|
+
+bind-address = 127.0.0.1,::1
|
|
146
|
+
mysqlx-bind-address = 127.0.0.1
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
and restart the mysql service:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
brew services mysql restart
|
|
153
|
+
```
|
package/package.json
CHANGED
package/src/spell.js
CHANGED
|
@@ -389,10 +389,9 @@ class Spell {
|
|
|
389
389
|
Object.assign(this, {
|
|
390
390
|
whereConditions: [],
|
|
391
391
|
groups: [],
|
|
392
|
-
orders:
|
|
392
|
+
orders: JSON.parse(JSON.stringify(this.orders)),
|
|
393
393
|
havingConditions: [],
|
|
394
394
|
joins: {},
|
|
395
|
-
skip: 0,
|
|
396
395
|
subqueryIndex: 0,
|
|
397
396
|
rowCount: 0,
|
|
398
397
|
skip: 0,
|