Thread: [Mysql-cocoa-users] MCPQuery
Brought to you by:
sergecohen
|
From: Camille GOUREAU-S. <ca...@lu...> - 2004-08-13 21:37:42
|
Hi, I've created (part of) a classe I called MCPQuery. It provides me query (NSString*) when feeded with information. Has one of you already worked on such a thing ? Is it a non sense ? Is there a better way to avoid re-writing the sames lines of code ? Here are the functions I implemented : + (NSString*) selectQueryWithSelect: (NSDictionary*) fields andWhere: (NSString*) where ; // returns a "select from xhere" string with the fields extracted from fields and the from also + (NSString*) fromStringWithFields: (NSDictionary*) fields ; + (NSString*) queryEmptyInsertInTable: (NSString*) table ; + (NSString*) queryShowColumnsFromTable: (NSString*) table ; + (NSString*) queryUpdateFields: (NSDictionary*) fields inTable: (NSString*) table where: (NSString*) where ; + (NSString*) queryInsertFields: (NSDictionary*) fields inTable: (NSString*) table ; |
|
From: Aaron J. <aj...@ed...> - 2004-08-13 22:51:53
Attachments:
PGP.sig
|
Sounds like an interesting idea. Based on your method declarations, this seems to really just be a collection of functions - there's nothing object oriented about it. I recommend making this into an actual object, and modifying the SMySQL methods to take MCPQuery objects instead of NSStrings. That might open up some more interesting possibilities. Aaron On Aug 13, 2004, at 4:39 PM, Camille GOUREAU-SUIGNARD wrote: > Hi, > > I've created (part of) a classe I called MCPQuery. > It provides me query (NSString*) when feeded with information. > Has one of you already worked on such a thing ? > Is it a non sense ? > Is there a better way to avoid re-writing the sames lines of code ? > > Here are the functions I implemented : > > + (NSString*) selectQueryWithSelect: (NSDictionary*) fields andWhere: > (NSString*) where ; > // returns a "select from xhere" string with the fields extracted > from fields and the from also > + (NSString*) fromStringWithFields: (NSDictionary*) fields ; > + (NSString*) queryEmptyInsertInTable: (NSString*) table ; > + (NSString*) queryShowColumnsFromTable: (NSString*) table ; > + (NSString*) queryUpdateFields: (NSDictionary*) fields inTable: > (NSString*) table where: (NSString*) where ; > + (NSString*) queryInsertFields: (NSDictionary*) fields inTable: > (NSString*) table ; > > > > ------------------------------------------------------- > SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media > 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 > Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. > http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 > _______________________________________________ > Mysql-cocoa-users mailing list > Mys...@li... > https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users |
|
From: Serge C. <ser...@us...> - 2004-08-13 23:36:11
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi;=0D =0D Do people feel like it would be nice to have a repository of code =0D contributed by SMySQL users?=0D How many people on this list would be interested in sharing some of =0D there code, so that there's a place to look for some examples =0D sources...=0D =0D Serge.=0D =0D PS: Note that I'm developping some kind of enterprise layer on top of =0D= SMySQL. This is a way to easily use a MySQL DB server to ensure =0D persistence of your data, providing an easy way to map an object (of a =0D= given class) to a row (of a precise table, depending on the class of =0D the object).=0D Then the MCPQuery you're developping can become some how (in EOF =0D parlance) a FetchSpecification... But I'm not there yet!=0D =0D =0D Le 13 ao=FBt 04, =E0 17:51, Aaron Jacobs a =E9crit :=0D =0D > Sounds like an interesting idea. Based on your method declarations, =0D= > this seems to really just be a collection of functions - there's =0D > nothing object oriented about it. I recommend making this into an =0D > actual object, and modifying the SMySQL methods to take MCPQuery =0D > objects instead of NSStrings. That might open up some more =0D > interesting possibilities.=0D >=0D > Aaron=0D >=0D >=0D >=0D > On Aug 13, 2004, at 4:39 PM, Camille GOUREAU-SUIGNARD wrote:=0D >=0D >> Hi,=0D >>=0D >> I've created (part of) a classe I called MCPQuery.=0D >> It provides me query (NSString*) when feeded with information.=0D >> Has one of you already worked on such a thing ?=0D >> Is it a non sense ?=0D >> Is there a better way to avoid re-writing the sames lines of code ?=0D= >>=0D >> Here are the functions I implemented :=0D >>=0D >> + (NSString*) selectQueryWithSelect: (NSDictionary*) fields andWhere: = =0D >> (NSString*) where ;=0D >> // returns a "select from xhere" string with the fields = extracted =0D >> from fields and the from also=0D >> + (NSString*) fromStringWithFields: (NSDictionary*) fields ;=0D >> + (NSString*) queryEmptyInsertInTable: (NSString*) table ;=0D >> + (NSString*) queryShowColumnsFromTable: (NSString*) table ;=0D >> + (NSString*) queryUpdateFields: (NSDictionary*) fields inTable: =0D >> (NSString*) table where: (NSString*) where ;=0D >> + (NSString*) queryInsertFields: (NSDictionary*) fields inTable: =0D >> (NSString*) table ;=0D >>=0D >>=0D >>=0D >> -------------------------------------------------------=0D >> SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank = Media=0D >> 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33=0D >> Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.=0D >> http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285=0D >> _______________________________________________=0D >> Mysql-cocoa-users mailing list=0D >> Mys...@li...=0D >> https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users=0D >>=0D *******************************************=0D Serge Cohen=0D =0D GPG Key ID: 9CBB58FB=0D *******************************************=0D =0D -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (Darwin) iD8DBQFBHVBk5EPeG5y7WPsRAnlpAKC/dXhR3e+0W653LDYtET5n59zCyACg7+Bk NqLQQRRIT14oy1HzDxSpdkE=3D =3DMeoT -----END PGP SIGNATURE----- |
|
From: Aaron J. <aj...@ed...> - 2004-08-13 23:38:01
Attachments:
PGP.sig
|
Serge, Will you be releasing this layer under the GPL? Also, where can I get=20= a copy of your GPG key? Aaron On Aug 13, 2004, at 6:35 PM, Serge Cohen wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi; > > Do people feel like it would be nice to have a repository of code=20 > contributed by SMySQL users? > How many people on this list would be interested in sharing some of=20 > there code, so that there's a place to look for some examples=20 > sources... > > Serge. > > PS: Note that I'm developping some kind of enterprise layer on top of=20= > SMySQL. This is a way to easily use a MySQL DB server to ensure=20 > persistence of your data, providing an easy way to map an object (of a=20= > given class) to a row (of a precise table, depending on the class of=20= > the object). > Then the MCPQuery you're developping can become some how (in EOF=20 > parlance) a FetchSpecification... But I'm not there yet! > > > Le 13 ao=FBt 04, =E0 17:51, Aaron Jacobs a =E9crit : > >> Sounds like an interesting idea. Based on your method declarations,=20= >> this seems to really just be a collection of functions - there's=20 >> nothing object oriented about it. I recommend making this into an=20 >> actual object, and modifying the SMySQL methods to take MCPQuery=20 >> objects instead of NSStrings. That might open up some more=20 >> interesting possibilities. >> >> Aaron >> >> >> >> On Aug 13, 2004, at 4:39 PM, Camille GOUREAU-SUIGNARD wrote: >> >>> Hi, >>> >>> I've created (part of) a classe I called MCPQuery. >>> It provides me query (NSString*) when feeded with information. >>> Has one of you already worked on such a thing ? >>> Is it a non sense ? >>> Is there a better way to avoid re-writing the sames lines of code ? >>> >>> Here are the functions I implemented : >>> >>> + (NSString*) selectQueryWithSelect: (NSDictionary*) fields=20 >>> andWhere: (NSString*) where ; >>> // returns a "select from xhere" string with the fields = extracted=20 >>> from fields and the from also >>> + (NSString*) fromStringWithFields: (NSDictionary*) fields ; >>> + (NSString*) queryEmptyInsertInTable: (NSString*) table ; >>> + (NSString*) queryShowColumnsFromTable: (NSString*) table ; >>> + (NSString*) queryUpdateFields: (NSDictionary*) fields inTable:=20 >>> (NSString*) table where: (NSString*) where ; >>> + (NSString*) queryInsertFields: (NSDictionary*) fields inTable:=20 >>> (NSString*) table ; >>> >>> >>> >>> ------------------------------------------------------- >>> SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank=20 >>> Media >>> 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 >>> Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. >>> http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 >>> _______________________________________________ >>> Mysql-cocoa-users mailing list >>> Mys...@li... >>> https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users >>> > ******************************************* > Serge Cohen > > GPG Key ID: 9CBB58FB > ******************************************* > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.3 (Darwin) > > iD8DBQFBHVBk5EPeG5y7WPsRAnlpAKC/dXhR3e+0W653LDYtET5n59zCyACg7+Bk > NqLQQRRIT14oy1HzDxSpdkE=3D > =3DMeoT > -----END PGP SIGNATURE----- > |
|
From: Serge C. <ser...@us...> - 2004-08-14 03:06:56
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Aaron;=0D =0D It will be under GPL.=0D In the mean time (as I stated previously in this list), I can think of =0D= releasing under different license, provided that I have some =0D 'customers' : MySQL is under GPL (so all software that uses MySQL as =0D sole DB server as to be GPL), and if I want to release under non-GPL I =0D= have to buy myself a MySQL license.=0D =0D Indeed it's not all clear how to do that, and I'd rather spend the time =0D= only if there is a demand.=0D =0D Serge.=0D =0D Le 13 ao=FBt 04, =E0 18:37, Aaron Jacobs a =E9crit :=0D =0D > Serge,=0D >=0D > Will you be releasing this layer under the GPL? Also, where can I get = =0D > a copy of your GPG key?=0D >=0D > Aaron=0D >=0D >=0D >=0D > On Aug 13, 2004, at 6:35 PM, Serge Cohen wrote:=0D >=0D >> -----BEGIN PGP SIGNED MESSAGE-----=0D >> Hash: SHA1=0D >>=0D >> Hi;=0D >>=0D >> Do people feel like it would be nice to have a repository of code =0D >> contributed by SMySQL users?=0D >> How many people on this list would be interested in sharing some of =0D= >> there code, so that there's a place to look for some examples =0D >> sources...=0D >>=0D >> Serge.=0D >>=0D >> PS: Note that I'm developping some kind of enterprise layer on top of = =0D >> SMySQL. This is a way to easily use a MySQL DB server to ensure =0D >> persistence of your data, providing an easy way to map an object (of =0D= >> a given class) to a row (of a precise table, depending on the class =0D= >> of the object).=0D >> Then the MCPQuery you're developping can become some how (in EOF =0D >> parlance) a FetchSpecification... But I'm not there yet!=0D >>=0D >>=0D >> Le 13 ao=FBt 04, =E0 17:51, Aaron Jacobs a =E9crit :=0D >>=0D >>> Sounds like an interesting idea. Based on your method declarations, = =0D >>> this seems to really just be a collection of functions - there's =0D >>> nothing object oriented about it. I recommend making this into an =0D= >>> actual object, and modifying the SMySQL methods to take MCPQuery =0D >>> objects instead of NSStrings. That might open up some more =0D >>> interesting possibilities.=0D >>>=0D >>> Aaron=0D >>>=0D >>>=0D >>>=0D >>> On Aug 13, 2004, at 4:39 PM, Camille GOUREAU-SUIGNARD wrote:=0D >>>=0D >>>> Hi,=0D >>>>=0D >>>> I've created (part of) a classe I called MCPQuery.=0D >>>> It provides me query (NSString*) when feeded with information.=0D >>>> Has one of you already worked on such a thing ?=0D >>>> Is it a non sense ?=0D >>>> Is there a better way to avoid re-writing the sames lines of code ?=0D= >>>>=0D >>>> Here are the functions I implemented :=0D >>>>=0D >>>> + (NSString*) selectQueryWithSelect: (NSDictionary*) fields =0D >>>> andWhere: (NSString*) where ;=0D >>>> // returns a "select from xhere" string with the fields = extracted =0D >>>> from fields and the from also=0D >>>> + (NSString*) fromStringWithFields: (NSDictionary*) fields ;=0D >>>> + (NSString*) queryEmptyInsertInTable: (NSString*) table ;=0D >>>> + (NSString*) queryShowColumnsFromTable: (NSString*) table ;=0D >>>> + (NSString*) queryUpdateFields: (NSDictionary*) fields inTable: =0D= >>>> (NSString*) table where: (NSString*) where ;=0D >>>> + (NSString*) queryInsertFields: (NSDictionary*) fields inTable: =0D= >>>> (NSString*) table ;=0D >>>>=0D >>>>=0D >>>>=0D >>>> -------------------------------------------------------=0D >>>> SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank =0D= >>>> Media=0D >>>> 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33=0D= >>>> Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.=0D= >>>> http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285=0D >>>> _______________________________________________=0D >>>> Mysql-cocoa-users mailing list=0D >>>> Mys...@li...=0D >>>> https://lists.sourceforge.net/lists/listinfo/mysql-cocoa-users=0D >>>>=0D >> *******************************************=0D >> Serge Cohen=0D >>=0D >> GPG Key ID: 9CBB58FB=0D >> *******************************************=0D >>=0D >> -----BEGIN PGP SIGNATURE-----=0D >> Version: GnuPG v1.2.3 (Darwin)=0D >>=0D >> iD8DBQFBHVBk5EPeG5y7WPsRAnlpAKC/dXhR3e+0W653LDYtET5n59zCyACg7+Bk=0D >> NqLQQRRIT14oy1HzDxSpdkE=3D=0D >> =3DMeoT=0D >> -----END PGP SIGNATURE-----=0D >>=0D >>=0D *******************************************=0D Serge Cohen=0D =0D GPG Key ID: 9CBB58FB=0D *******************************************=0D =0D -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (Darwin) iD8DBQFBHYHE5EPeG5y7WPsRAv86AJ0S2OoMiwNxcDXUKo4nSSwl3z/twACeNrL8 T5Sp9LNt7KHEmc+A6DDKNms=3D =3DCqY3 -----END PGP SIGNATURE----- |
|
From: Camille GOUREAU-S. <ca...@lu...> - 2004-08-14 07:20:57
|
Hi, 1. yes, it's a collection of function. I'll think about making it an object, but I'm not quite sure of the gain : each request seems to be different. 2. If my code is of any interest, i'll give it under whatever license is of best use for users. no need for propriety (knowing how I writes code, would make most of you laugh). Camille |