Am 04.05.2016 um 07:34 schrieb D'Arcy J.M. Cain:
> If data is None use self for the dictionary.
>
>   db = DB()
>   db['table_id'] = key
>   db.select('table)
>
> Thoughts?

I would find it a bit confusing since the db instance would then combine two different responsibilities in one object, namely being both a database connection and a table row container. Normally you want to have a separation of concerns.

Also, if you have two different tables, would you merge the values together in one dict? And what would the select method return? Would it return another DB() instance with the same underlying connection, or would it return None and just change the existing instance? In the latter case, you could only work with one row at the same time, or you would need to open another connection. But the former case doesn't feel right, either.

-- Chris
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql

Reply via email to