Re: SWI-Prolog with mySQL
- From: Jan Wielemaker <jan@xxxxxxxxxxxxxxxxxxx>
- Date: 05 Nov 2007 08:44:28 GMT
On 2007-11-04, Philipp Kraus <philipp.kraus@xxxxxxxxxxxx> wrote:
Hi @all,
I had coded a routing system. My database is stored in a seperate
txt-file, which is included dynamicly, but now I would like to store
the data in a mySQL table and call them.
Is there any solution to run the SQL statement without unixODBC?
Not that I'm aware of, though it is not unlikely someone hacked
something together. The short route is of course to use unixODBC, which
is readily available for most platforms. The longer route is to write a
low-level interface using the mySQL client library and SWI-Prolog
foreign language interface. I don't know the mySQL client interface, but
a simple interface to answer basic SQL queries is probably not very
hard.
The whole lot generally is quite a bit of work, notably to realise a
good and programmable mapping between database types and Prolog types,
deal with transactions, etc. Doing all this work is probably only
justified if you need the performance gain that will probably result
from bypassing ODBC (I have no clue how large the overhead is) or you
want to distribute your program to a community where setting up unixODBC
adds a major hassle.
Can anyone post an example?
The odbc interface is -of course- part of the sources. It will give
you a clue how much work is involved doing a fairly complete interface.
I'd expect a straight mySQL interface to be a bit smaller and simpler
as the ODBC version has to take care of different capabilities of the
actual driver as well as bugs in some drivers.
--- Jan
.
Thanks a lot
Phil
- Follow-Ups:
- Re: SWI-Prolog with mySQL
- From: Philipp Kraus
- Re: SWI-Prolog with mySQL
- References:
- SWI-Prolog with mySQL
- From: Philipp Kraus
- SWI-Prolog with mySQL
- Prev by Date: Re: Using B-Prolog as a command line ?
- Next by Date: Re: Using B-Prolog as a command line ?
- Previous by thread: SWI-Prolog with mySQL
- Next by thread: Re: SWI-Prolog with mySQL
- Index(es):
Relevant Pages
|
|