Re: [eclipse-clp-users] Python Interface / PostgreSQL/MongoDB

From: Kish Shen <kisshen_at_cisco.com>
Date: Wed, 14 Nov 2012 03:01:57 +0000
Hi Gottfried,

I am not sure I understand what you are doing exactly, and there are 
several different issues I am not clear about:

1. What exactly do you mean by "the Python Interface"? Do you mean 
PyCLP, Oreste Berbardi's Python interface to ECLiPSe? This is an 
interface developed independently by Oreste, and I don't know much about 
it, so I can't really help you here.

2. If you are talking about PyCLP, I don't really understand how this 
relates to providing an interface to PostgreSQL for ECLiPSe. As I 
understand it, PyCLP allows you to call ECLiPSe code (goals) from 
Python, and I assume also for ECLiPSe code to call Phython code. I don't 
see what this has to do with PostgreSQL.

I took a quick look at the PostgreSQL documentation, and there is 
PL/Python, a server programming interface that allows user functions in 
PostgreSQL to be programmed in Python. However, I don't see how this 
helps you to interface ECLiPSe to PostgreSQL.

3. In addition, this interface is for server programming -- extending 
PostgreSQL's SQL. This is not what lib(dbi) -- ECLiPSe's interface to 
MySQL you mentioned -- does. What lib(dbi) does is to use MySQL as a 
database from ECLiPSe, i.e. to send data and SQL query/commands to 
MySQL, and receive data back from MySQL. This is done using the client 
interface of MySQL. PostgreSQL has the equivalent client interface, and 
like MySQL's, the API is for C, and from my very quick look, the API is 
similar to MySQL's.

So I think that if you want to interface to PostgreSQL (for ECLiPSe) in 
a way similar to what lib(dbi) does with MySQL -- you probably want to 
start with the existing lib(dbi) code and try to adapt the C part of the 
code to use PostgreSQL's API instead of MySQL's. Note that lib(dbi) 
itself was adapted in a similar way from an interface to (a very old 
version of) Oracle. I did this adaption, and I tried to write the C code 
in such a way that adapting the code for another SQL-based database 
should be relatively easy (assuming the API provides similar 
functionality as MySQL's), but unfortunately I don't think there is much 
implementation documentation for this library -- there is oci.txt, which 
is some brief notes for the old Oracle interface, and was what I used 
when I adapted the code for MySQL.

Cheers,

Kish

On 12/11/2012 17:17, Gottfried F. Zojer wrote:
> Hello to everyone,
>
> I can see within the source-code download that eclipseclp can be linked to
> Mysql.
> Just wondering if somebody is using eclipseclp with PostgreSQL via the
> Python Interface?
> Unfortunately I m getting error messages when installing the Python
> Interface ( cython distutils import )
>
> Thanks in advance for any feedback
>
> Best regards
>
> Gottfried
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_nov
>
>
>
> _______________________________________________
> ECLiPSe-CLP-Users mailing list
> ECLiPSe-CLP-Users_at_lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/eclipse-clp-users
>
Received on Wed Nov 14 2012 - 03:02:10 CET

This archive was generated by hypermail 2.2.0 : Thu Nov 22 2012 - 06:16:22 CET