Path: news.cs.au.dk!news.net.uni-c.dk!howland.erols.net!europa.netcrusader.net!195.238.2.15!skynet.be!poster!not-for-mail From: Atle Newsgroups: comp.lang.beta Subject: Re: I have (TEMPORALLY!!) given up ... Date: Thu, 23 Nov 2000 21:19:20 +0100 Organization: Belgacom Skynet SA/NV Lines: 55 Message-ID: <3A1D7BC8.442165F9@skynet.be> References: <8virsg$6vg8q$1@gjallar.cs.au.dk> <3A1D4444.728522D0@ideogramic.com> NNTP-Posting-Host: dialup69.charleroi.skynet.be Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news1.skynet.be 975005989 7442 195.238.7.69 (23 Nov 2000 18:59:49 GMT) X-Complaints-To: abuse@skynet.be NNTP-Posting-Date: 23 Nov 2000 18:59:49 GMT X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14 i686) X-Accept-Language: en Xref: news.cs.au.dk comp.lang.beta:12652 Klaus Marius Hansen wrote: > > My first idea was to duplicate all the libpq functions and leave it at that. > > > > Well, one way to do it, would be to implement the BetaDBC interface for > the Postgres API. Something like this has been done in the next (5.2?) > release of the Mjolner System for MySQL and FrontBase. Check > > https://beta.cs.au.dk/doc/betadbc/index.html > > for the documentation of that. (I not sure about this, I am only > guessing based on the above URL.) > Well, I am actually having a blinding success with this libpq thing :-) I have already built a database of symptoms, there doesn't seem to be a glitch, and the interface gets to be real simple. I use two 'levels' so that the function conn = PQconnect(char *s) stays inside a PQ object in Beta PQ: (# PQconnect:external ... connect: (# t:^TEXT ENTER t[] .. #) .. #) This way, I can convert between native Beta-data (TEXT, etc.) and C-data inside the PQ object, so the whole thing looks more 'Beta-like' - this is how I use it: P:@PQ; I:@INTEGER; s:@TEXT; P.connect; 'INSERT INTO SYMPTOMS VALUES(%i,\'%s\')'->t.putformat(# ... #); t[]->P.exec; P.exec; P.finish; I don't think it gets easier than that :-) And the libpq is 'closer to the metal' than ODBC, so there is (theoretically) less chance of failure. .... Best wishes, Atle