Segfault-Inc / Multicorn

Data Access Library
https://multicorn.org/
PostgreSQL License
700 stars 145 forks source link

Order of columns pass to `.execute` is seemingly unpredictable. #36

Closed solidsnack closed 10 years ago

solidsnack commented 10 years ago

Would it not be better if p_targets_set were a Python sequence/list?

The order of arguments passed to my execute method does not match that given in the table definition, which makes it impossible to filter columns in some circumstances (for example, in CSV-like wrappers).

rdunklau commented 10 years ago

The columns are passed as an OrderedDict to the init method. You can keep the order here.

Example:

self.indices = dict((key, i) for key, i in enumerate(fdw_columns.keys())

solidsnack commented 10 years ago

Yes, I see that now. Thanks for your help.