@stonyx/orm 0.2.1-alpha.13 → 0.2.1-alpha.14
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
|
@@ -113,7 +113,7 @@ export default class Orm {
|
|
|
113
113
|
// Wire up memory resolver so store.find() can check model memory flags
|
|
114
114
|
Orm.store._memoryResolver = (modelName) => {
|
|
115
115
|
const { modelClass } = this.getRecordClasses(modelName);
|
|
116
|
-
return modelClass?.memory
|
|
116
|
+
return modelClass?.memory === true;
|
|
117
117
|
};
|
|
118
118
|
|
|
119
119
|
// 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
|
@@ -117,7 +117,7 @@ export default class Store {
|
|
|
117
117
|
*/
|
|
118
118
|
_isMemoryModel(modelName) {
|
|
119
119
|
if (this._memoryResolver) return this._memoryResolver(modelName);
|
|
120
|
-
return
|
|
120
|
+
return false; // default to non-memory if resolver not set yet
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
set(key, value) {
|