Package: python-gadfly
Version: 1.0.0-15.1
Severity: normal

Hi.

I suspect there's a problem with gadfly with Python 2.7 at the moment.

It seems I can't retrieve a table that I have created, wheras gfplus is able to 
query it :-/

Here's my first program which populates a DB :
$ mkdir gadflybd/

$ python createdb.py :
-----
#!/usr/bin/python
# -*- coding: utf-8 -*-

import gadfly

connection = gadfly.gadfly()

connection.startup("MYDATABASE", "gadflybd")

cursor = connection.cursor()

cursor.execute("CREATE TABLE TEL (NOM VARCHAR, TEL VARCHAR)")
connection.commit()

cursor.execute("INSERT INTO TEL(NOM, TEL) VALUES ('christian', '4098')")
connection.commit()

cursor.execute("SELECT * FROM TEL")

for x in cursor.fetchall():
    print x

connection.commit()

cursor.execute("select * from __table_names__")
print cursor.pp()
-----

Which gives :

('christian', '4098')
TABLE_NAME      | IS_VIEW
=========================
__INDEXCOLS__   | 1      
__COLUMNS__     | 1      
TEL             | 0      
__TABLE_NAMES__ | 1      
DUAL            | 1      
__INDICES__     | 1      
__DATADEFS__    | 1      


Gfplus also reports :

$ gfplus MYDATABASE gadflybd

GF> select * from tel;
NOM       | TEL 
================
christian | 4098


Then if I run a little script to query the same DB :

$ python readdb.py
-----
#!/usr/bin/python
# -*- coding: utf-8 -*-

import gadfly

connection = gadfly.gadfly()

connection.startup("MYDATABASE", "gadflybd")

cursor = connection.cursor()

cursor.execute("select * from __table_names__")
print cursor.pp()

cursor.execute("SELECT * FROM TEL")

for x in cursor.fetchall():
    print x

connection.commit()
-----

Then, I get an error :

TABLE_NAME      | IS_VIEW
=========================
__INDEXCOLS__   | 1      
__COLUMNS__     | 1      
__TABLE_NAMES__ | 1      
DUAL            | 1      
__INDICES__     | 1      
__DATADEFS__    | 1      
Traceback (most recent call last):
  File "schu/Codes/readdb.py", line 15, in <module>
    cursor.execute("SELECT * FROM TEL")
  File "/usr/lib/python2.7/dist-packages/gadfly/database.py", line 366, in 
execute
    cs[i] = cs[i].relbind(database)
  File "/usr/lib/python2.7/dist-packages/gadfly/semantics.py", line 2548, in 
relbind
    test = db.bindings(tl)
  File "/usr/lib/python2.7/dist-packages/gadfly/store.py", line 288, in bindings
    raise NameError, `name` + " no such relation in DB"
NameError: 'TEL' no such relation in DB

Indeed, the instrospection didn't find the table :-/

Thanks in advance.

Best regards,

-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (900, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-4-686-pae (SMP w/2 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-gadfly depends on:
ii  python  2.7.3-4

Versions of packages python-gadfly recommends:
ii  python-kjbuckets  1:1.0.0-15.1

python-gadfly suggests no packages.

-- debconf-show failed


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to