From: Alex B. <en...@tu...> - 2001-08-22 17:45:53
|
> 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. I would almost prefer to standardize db field names rather than avoid using array keys, which are helpful for coding and debugging. > 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"). Why here? (I.e. in init, so early) why shouldn't query loading be the responsibility of the code that needs the query? > 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? I like the format above, nice n' clean :) _a |