[Mysql-cocoa-users] Re: static linking and MySQL
Brought to you by:
sergecohen
From: Serge C. <co...@em...> - 2002-03-11 19:47:33
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 For the moment I'm using the same model as in all the API for mySQL:=0D one object for the connection,=0D one object for the result of a query;=0D =0D This is the more obvious way: this is how it's done in C API, the basis =0D= of the framework.=0D If you look at it, you'll find an API which is much like the PHP API =0D indeed.=0D =0D Now my "problem" is to find the proper way to launch the server thread, =0D= whereas for all the other functions of the C API the first argument is =0D= either a connection (MYSQL*) or result structure, the function to start =0D= a server thread takes the arguments which should be put on the command =0D= line after mysqld (I'm not sure to be clear here...).=0D Most likely I'll make a new class for handling the server thread, with a = =0D couple of accessors to set the options of the server before starting the = =0D thread.=0D =0D Then I want a SMySQLConnection initialiser which take the "server" =0D object, so the user doesn't have to take care again of the socket... to =0D= which it should connect.=0D =0D I'll try to think about it. In the mean time, maybe you want to have a =0D= look at the framework (present version), you can use it with an external = =0D server in the mean time I'm developping the server object: the same =0D SMySQLConnection class will then just have to be initialised in a =0D different way.=0D =0D Serge.=0D =0D =0D Le lundi 11 mars 2002, =C3=A0 08:17 , Dan Guisinger a =C3=A9crit :=0D =0D > I'd be interested in what your general ObjC interface is right now, I=0D= > haven't had a chance to browse through it, maybe I should so I don't=0D= > have to bother you at looking it up.=0D >=0D > I know with my C++ and PHP experience, I have built objects with a few=0D= > simple methods.=0D >=0D > ->Connect();=0D > ->Query();=0D > ->NextRecord();=0D > ->Close();=0D >=0D > And then I have always derived classes which are table specific, which=0D= > overrides the query, uses the parent query to send it to mysql, and = has=0D > specific Create, Update, Delete, and Select methods designed around = the=0D > data of that table. I know I have always designed it as far as=0D > simplicity and abstraction of the contents.=0D >=0D > I'm curious how you are going about it.=0D >=0D > As far as starting and stopping the server....I would create a second=0D= > class.=0D >=0D > The way I am used to doing this is one object creates the query = objects.=0D > Therefore, the master object could be the server or client in either=0D= > case. Each data/child object would be created and returned by the = main,=0D > pre-connected.=0D >=0D > Therefore it's transparent whether or not a client or embedded server = is=0D > in use.=0D >=0D > Of course, this is all coming from my background that application code=0D= > doesn't really have to see the database or SQL, it just needs access = to=0D > the data, which is why I've always used abstraction when using MySQL.=0D= >=0D > Dan Guisinger=0D > Atacomm / Ataractic Corporation=0D > www.atacomm.com=0D >=0D > -----Original Message-----=0D > From: Serge Cohen [mailto:co...@em...]=0D > Sent: Monday, March 11, 2002 10:28 AM=0D > To: Dan Guisinger=0D > Cc: mys...@li...=0D > Subject: Re: static linking and MySQL=0D >=0D > -----BEGIN PGP SIGNED MESSAGE-----=0D > Hash: SHA1=0D >=0D > Hi;=0D >=0D >=0D >=0D > I really remember to have once compiled SMySQL (the framework) with=0D >=0D > libmysqlclient statically linked... I'll try again and let you know=0D >=0D > want's up.=0D >=0D >=0D >=0D > The second point for using libmysqld instead of libmysqlclient is to=0D= >=0D > start and stop the server. I still have to think of the obj-C = interface=0D >=0D > to the starting of the server thread... If you have ideas on what the=0D= >=0D > framework should propose as interface for this purpous, let me know. = (So=0D >=0D >=0D > far I'm thinking to use a NSArray of NSString to pass arguments to the=0D= >=0D > start server).=0D >=0D >=0D >=0D > Serge.=0D >=0D >=0D >=0D >=0D >=0D > Le samedi 9 mars 2002, =C3=A0 01:41 , Dan Guisinger a =C3=A9crit :=0D >=0D >=0D >=0D >> Sorry for not getting back sooner. I'm just totally swamped right=0D > now,=0D >=0D >> although I am really hoping to get 4.0 embedded going by the end of=0D= > the=0D >=0D >> month.=0D >=0D >> yeah, I'm looking at libmysqld, which is the integrated server, it=0D > only=0D >=0D >> allows connections from within the same process.=0D >=0D >>=0D >=0D >> I'm currently scrambling to catch up on the Windows version of my app=0D= >=0D >> as Cocoa was too fun to develop in and I actually have a deadline on=0D= >=0D >> the Win32 app (a client wanted a similar app, so I'm going to just=0D >=0D >> customize a copy of it for them....its nice to finally make money on=0D= >=0D >> this project of mine. lol)=0D >=0D >>=0D >=0D >> I know the embedded server and 4.0 are both experimental, however = this=0D >=0D >=0D >> app is basically a replacement for entourage and outlook. It doesn't=0D= >=0D >> use complex queries so I think chances are using Alpha will work just=0D= >=0D >> fine, and I have an auto update feature so that we can upgrade to 4.0=0D= >=0D >> gold when its available.=0D >=0D >> (However i'm sure you'd agree, using their database engine sure does=0D= >=0D >> cut down on the load of a programmer for creating an application like=0D= >=0D >> this, where searches and filters can be applied in real time)=0D >=0D >>=0D >=0D >> I'll try to get on the mailing list in the next day or two. If you=0D= >=0D >> want, I am on both MSN Messenger and AOL Instant Messenger.=0D >=0D >> dgu...@ho... and DANMN200 respectively.=0D >=0D >>=0D >=0D >> -Dan=0D >=0D >>=0D >=0D >>=0D >=0D >> On Tuesday, March 5, 2002, at 04:22 AM, Serge Cohen wrote:=0D >=0D >>=0D >=0D >>> -----BEGIN PGP SIGNED MESSAGE-----=0D >=0D >>> Hash: SHA1=0D >=0D >>>=0D >=0D >>> Hi;=0D >=0D >>>=0D >=0D >>> first, it would be great if we continue this discussion on the=0D > mailing=0D >=0D >>> list (for browsable archiving reasons).=0D >=0D >>>=0D >=0D >>> I guess what you want is to embed in a application the libmysql=0D >=0D >>> (embeded db)?=0D >=0D >>> For the moment I remind to have managed once to compile SMySQL=0D > classes=0D >=0D >>> with static libmysqlclient, but did not manage to repoduce that = since=0D >=0D >=0D >>> then.=0D >=0D >>>=0D >=0D >>> I can propose you an other solution: keep dynamic linking but put = the=0D >=0D >=0D >>> library in the application bundle (maybe in Frameworks, or create a=0D= >=0D >>> Library?). I know that the recommended way to use a Framework with = an=0D >=0D >=0D >>> app. maybe one can do it with library as well.=0D >=0D >>>=0D >=0D >>> About the emebeded system now. You saw it's a new feature of MySQL = 4.=0D >=0D >=0D >>> which is still alpha. I was waiting a bit (I have my PhD in=0D > Structural=0D >=0D >>> Biology to finish...) before supporting it. I did not understood you=0D= >=0D >>> were really waiting for it. I've tried once the installation (using=0D= >=0D >>> the same patch ... as for previous version), and that was straight=0D= >=0D >>> forward.=0D >=0D >>>=0D >=0D >>> I'll try to give you definitive answers for in a couple of days. = (try=0D >=0D >=0D >>> static link again, putting the lib in the app bundle -one as to=0D > change=0D >=0D >>> the library used : otool -L libmysqlclient.dylib... -, and try to=0D > make=0D >=0D >>> a correct install of mysql4.)=0D >=0D >>>=0D >=0D >>> Serge.=0D >=0D >>>=0D >=0D >>>=0D >=0D >>>=0D >=0D >>> Le mardi 5 mars 2002, =C3=A0 03:12 , Dan Guisinger a =C3=A9crit :=0D >=0D >>>=0D >=0D >>>> Have you figured this out yet?=0D >=0D >>>>=0D >=0D >>>> I've been pulling my hair out, and I don't even want the MySQL=0D >=0D >>>> client. I want MySQL Embedded and both are driving me crazy.=0D >=0D >>>>=0D >=0D >>>> If you need any help, I'll help out.=0D >=0D >>>> I'm looking to create a framework for MySQL Embedded Server 4.0.1.=0D= >=0D >>>>=0D >=0D >>>> My current plans are to open source the embedded server framework=0D= >=0D >>>> although the product I am putting it into isn't open source. MySQL=0D= >=0D >>>> AB seems a little aggressive these days and I fear linking directly=0D= >=0D >>>> into our product would be putting us on their radar.=0D >=0D >>>>=0D >=0D >>>> -Dan=0D >=0D >>>>=0D >=0D >>>>=0D >=0D >>> - ----------------------------------------------------=0D >=0D >>> Serge Cohen=0D >=0D >>>=0D >=0D >>> GPG Key ID: 1024D/69B1D346=0D >=0D >>> - ----------------------------------------------------=0D >=0D >>> -----BEGIN PGP SIGNATURE-----=0D >=0D >>> Version: GnuPG v1.0.6 (Darwin)=0D >=0D >>> Comment: For info see http://www.gnupg.org=0D >=0D >>>=0D >=0D >>> iD8DBQE8hJxtMygj1Wmx00YRAtAKAKCgNi+XCCxw05zfwu1Q7qRG+WszwgCfclkV=0D >=0D >>> DyQzIvmxtdtmqmCyfZPRZPA=3D=0D >=0D >>> =3DjsSL=0D >=0D >>> -----END PGP SIGNATURE-----=0D >=0D >>>=0D >=0D >>=0D >=0D >>=0D >=0D > - ----------------------------------------------------=0D >=0D > Serge Cohen=0D >=0D >=0D >=0D > GPG Key ID: 1024D/69B1D346=0D >=0D > - ----------------------------------------------------=0D >=0D > -----BEGIN PGP SIGNATURE-----=0D > Version: GnuPG v1.0.6 (Darwin)=0D > Comment: For info see http://www.gnupg.org=0D >=0D > iD8DBQE8jNsvMygj1Wmx00YRAkhZAJ9B5IZJB0Nx4Ds0GzqQ61wGEQtghACfSUDQ=0D > vNBuKgA/NVM4RUVT40gsg6I=3D=0D > =3DKI7d=0D > -----END PGP SIGNATURE-----=0D >=0D >=0D - ----------------------------------------------------=0D Serge Cohen=0D =0D GPG Key ID: 1024D/69B1D346=0D - ----------------------------------------------------=0D -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (Darwin) Comment: For info see http://www.gnupg.org iD8DBQE8jQopMygj1Wmx00YRAj5vAJwPAvi2pdmOLRNkhi2JD4Ew9wQrHQCfcnel jlpqZgh13DM0v1HJO0G9rJM=3D =3DBKTq -----END PGP SIGNATURE----- |