@stonyx/orm 0.2.1-beta.42 → 0.2.1-beta.44
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/package.json +1 -1
- package/src/main.js +1 -1
- package/src/model.js +4 -4
- package/src/mysql/schema-introspector.js +1 -1
- package/src/store.js +1 -1
package/package.json
CHANGED
package/src/main.js
CHANGED
|
@@ -128,7 +128,7 @@ export default class Orm {
|
|
|
128
128
|
// Wire up memory resolver so store.find() can check model memory flags
|
|
129
129
|
Orm.store._memoryResolver = (modelName) => {
|
|
130
130
|
const { modelClass } = this.getRecordClasses(modelName);
|
|
131
|
-
return modelClass?.memory
|
|
131
|
+
return modelClass?.memory === true;
|
|
132
132
|
};
|
|
133
133
|
|
|
134
134
|
// Wire up MySQL reference for on-demand queries from store.find()/findAll()
|
package/src/model.js
CHANGED
|
@@ -4,12 +4,12 @@ export default class Model {
|
|
|
4
4
|
/**
|
|
5
5
|
* Controls whether records of this model are loaded into memory on startup.
|
|
6
6
|
*
|
|
7
|
-
* - true → loaded on boot, kept in store
|
|
8
|
-
* - false → never cached; find() always queries MySQL
|
|
7
|
+
* - true → loaded on boot, kept in store
|
|
8
|
+
* - false → never cached; find() always queries MySQL (default)
|
|
9
9
|
*
|
|
10
|
-
* Override in subclass: static memory =
|
|
10
|
+
* Override in subclass: static memory = true;
|
|
11
11
|
*/
|
|
12
|
-
static memory =
|
|
12
|
+
static memory = false;
|
|
13
13
|
static pluralName = undefined;
|
|
14
14
|
|
|
15
15
|
id = attr('number');
|
package/src/store.js
CHANGED
|
@@ -136,7 +136,7 @@ export default class Store {
|
|
|
136
136
|
*/
|
|
137
137
|
_isMemoryModel(modelName) {
|
|
138
138
|
if (this._memoryResolver) return this._memoryResolver(modelName);
|
|
139
|
-
return
|
|
139
|
+
return false; // default to non-memory if resolver not set yet
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
set(key, value) {
|