-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Cursor.definition property #131
Comments
From rogerbinns on May 11, 2012 13:15:44 If you are happy with the description property returning the same as getdescription with 5 Nones appended them I'm happy to add this. I usually shy away from DB API stuff like this since SQLite really doesn't work that way and providing the methods can easily mislead that it does. Status: Accepted |
From piranna on May 11, 2012 13:19:17 Yes, it's just what i was asking for :-D In fact i have just made a clone to try to do it and send you a pull request :-) |
From rogerbinns on May 11, 2012 13:26:17 Don't worry about doing it yourself. It isn't much code, and the test code will be longer anyway. This will be in 3.7.12 which is awaiting that SQLite version. It should be happening very soon. |
From piranna on May 11, 2012 13:28:00 Ok, thanks :-) |
From rogerbinns on May 13, 2012 18:09:44 This issue was closed by revision d1b234e5ceb9 . Status: Fixed |
From piranna on May 11, 2012 12:44:25
On DB-API 2.0, the Cursor instances has a
definition
property that has the same purpose and return similar data that thegetdefinition()
method, and also the most used data of the returned tuples (the name of the columns) is in both at the offset 0, but since you can't subclass the APSW Cursor class you can't be able to add the property and develop portable code at this point. The fact is that is easy to get over this with some code like:but it's ugly since you have to had specialized code for something fairly trivial. Since that, i propose to add a
definition
property according to the DB-API 2.0. This states that it have to return a tuple with the next fields:Since the first two are the same that the
getattribute()
method it should be fairly trivial, while for the other five since don't have sense on SQLite it could be possible to do the same that PySqlite does, that it's just return None on the fields.Original issue: http://code.google.com/p/apsw/issues/detail?id=131
The text was updated successfully, but these errors were encountered: