From: Andreas A. <a.a...@th...> - 2001-08-22 10:47:08
|
Hi All, I think now is the time to establish some standards how query results and queries are handled in bc. RESULT FETCHING: There are portability problems using array field names as array keys for data. Because different dbms truncate the column headers differently It might lead to unpredicted results. So we should use indexed array for the result retrieving only. I'm not sure how this will fit with EntityManager (I briefly looked over the code and saw that by doing queries the $headers switch is turned on) but if it really needs that a mapping could be done in EntityManager not in QueryManager. STORED QUERIES: QueryManager does have the abiliy to load stored queries. This is used in EntityManager to load queries related to entities. But there might be the need to load user queries for one page call. My proposal is to use the query load system on init, optionally of course. So we could have a syntax like this <database> <mcrypt>true</mrypt> .. <queries> <query>user.db.qry.UserQueriesFoo</query> <query>user.db.qry.UserQueryBar</query> </queries> On Init the file user.db.qry.UserQueriesFoo is importet and the queries are added to the queryList. The user then does have the abiliy to execute his querys directly: qm->DoQuery("QRY_USER_MYQUERYNAME"). The query file would contain: <queries> <query> <name>QRY_USER_MYQUERY</name> <query>SELECT FROM ? WHERE newsId = ?</query> <argtypes> <type>text</type> <type>integer</type> </argtypes> </query> <query> another query </query> </queries> Or something similar. Comments? |