Problems with Gadfly (Python 2.3/Win32)


Posted

in


Hmm, I seem to be banging my head against the wall here.  I’ve been looking at Gadfly, a python database that supports a subset of SQL.  I haven’t tested it against other versions of Python on other platforms, but I’m having some issues with it under Python 2.3 on Win32.  Here’s a code snippet copied and pasted from the Gadfly documentation:


import gadfly
connection = gadfly.gadfly()
connection.startup("mydatabase", "./")
cursor = connection.cursor()
cursor.execute("create table ph (nm varchar, ph varchar)")
cursor.execute("insert into ph(nm, ph) values ('arw', '3367')")
cursor.execute("select * from ph")
for x in cursor.fetchall():
  print x
# prints ('arw', '3367')
connection.commit()

The only problem is, here’s what I get as output:

 ('3367', 'arw') 

A simple reversing wouldn’t be too hard to deal with, but in a more complex situation, I had an ID field first that was ending up somewhere in the middle during output.  It definately wasn’t the order that I was expecting.

Any thoughts?  At first I thought that I was doing something horribly stupid, but I’m supposed to get one answer and I’m getting another! 🙂