33
44use DisciteDB \Config \Enums \TableUsage ;
55use DisciteDB \Core \DebugManager ;
6- use DisciteDB \Core \ExceptionsManager ;
76use DisciteDB \Core \KeysManager ;
87use DisciteDB \Core \LogsManager ;
9- use DisciteDB \Core \QueryManager ;
108use DisciteDB \Core \SecurityManager ;
119use DisciteDB \Core \TablesManager ;
1210use DisciteDB \Core \UsersManager ;
13- use DisciteDB \Exceptions \TableException ;
14- use DisciteDB \Keys \BaseKey ;
1511use DisciteDB \QueryHandler \QueryResult ;
16- use DisciteDB \Sql \Loading \Handler ;
1712use DisciteDB \Sql \Loading \HandlerDatabase ;
1813use DisciteDB \Sql \Loading \HandlerFile ;
19- use DisciteDB \Tables \BaseTable ;
2014use DisciteDB \Tables \TableInterface ;
21- use DisciteDB \Users \BaseUser ;
2215use mysqli ;
2316
2417/**
@@ -79,6 +72,12 @@ class Database
7972 */
8073 protected DebugManager $ debugManager ;
8174
75+
76+ /**
77+ * @var ?array map of SQL file or from SQL Database.
78+ */
79+ protected ?array $ sqlMap ;
80+
8281 /**
8382 * Database constructor.
8483 *
@@ -257,7 +256,7 @@ public function __get(string $name): QueryResult|TableInterface
257256 */
258257 public function loadFromDatabase () : void
259258 {
260- new HandlerDatabase ($ this ->connection ()->get (), $ this );
259+ $ this -> sqlMap = ( new HandlerDatabase ($ this ->connection ()->get (), $ this ))-> getArray ( );
261260 }
262261
263262 /**
@@ -273,7 +272,7 @@ public function loadFromDatabase() : void
273272 */
274273 public function loadFromFile (string $ path , int $ updatingTime ) : void
275274 {
276- new HandlerFile ($ path , $ updatingTime , $ this ->connection ()->get (), $ this );
275+ $ this -> sqlMap = ( new HandlerFile ($ path , $ updatingTime , $ this ->connection ()->get (), $ this ))-> getArray ( );
277276 }
278277
279278
0 commit comments