// assumes main concepts are empty before // only works when you call db() afterwards svoid quickImportMainConcepts(virtual Concepts oldConcepts, IF0 enabled default null) { if (!shortNameIs(oldConcepts, "Concepts")) ret; Concepts concepts = db_mainConcepts(); concepts.miscMapPut("dbGrabber", func -> Bool { concepts.miscMapRemove("dbGrabber"); pcall { if (isFalse(callF(enabled))) false; concepts.idCounter = getLong idCounter(oldConcepts); printVars_str(idCounter := concepts.idCounter); Map oldMap = cast _get concepts(oldConcepts); printVars_str(+oldMap); new RealmCopy rc; rc.nonTransientOnly = true; rc.fullCopy = true; rc.overrideCollectionOrMapCopy = o -> { rc.classMap.put(_getClass(o), _getClass(o)); false; }; { temp tempSetTL(dynamicObjectIsLoading_threadLocal(), true); concepts.concepts.putAll((Map) rc.copy(oldMap)); } pnl("quickImportDB", mapSortedByFunctionOnKey str(rc.classMap)); // Note: this calls _doneLoading2() on all concepts concepts.assignConceptsToUs(); print(nConcepts(countConcepts()) + " quick-imported"); true; } false; }); }