Changeset 839
- Timestamp:
- 03/12/07 20:49:45 (1 year ago)
- Files:
-
- pg8000/trunk/pg8000.py (modified) (3 diffs)
- pg8000/trunk/pg8000-test.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pg8000/trunk/pg8000.py
r838 r839 280 280 description = property(lambda self: self._getDescription()) 281 281 def _getDescription(self): 282 return None 282 if self.cursor.row_description == None: 283 return None 284 columns = [] 285 for col in self.cursor.row_description: 286 columns.append((col["name"], col["type_oid"])) 287 return columns 283 288 284 289 def execute(self, operation, args=()): … … 412 417 self.c.close_statement(self._statement_name) 413 418 419 row_description = property(lambda self: self._getRowDescription()) 420 def _getRowDescription(self): 421 return self._row_desc.fields 422 414 423 ## 415 424 # Run the SQL prepared statement with the given parameters. … … 529 538 self.connection = connection 530 539 self._stmt = None 540 541 row_description = property(lambda self: self._getRowDescription()) 542 def _getRowDescription(self): 543 if self._stmt == None: 544 return None 545 return self._stmt.row_description 531 546 532 547 ## pg8000/trunk/pg8000-test.py
r834 r839 67 67 cur1 = pg8000.Cursor(db) 68 68 cur1.execute("SELECT * FROM t1") 69 print repr(cur1.row_description) 69 70 s1 = pg8000.PreparedStatement(db, "SELECT f1, f2 FROM t1 WHERE f1 > $1", int) 70 71 i = 0
