On Monday, December 20, 2010 11:09:17 am Ed Leafe wrote: > On Dec 19, 2010, at 5:39 PM, marcelo nicolet wrote: > > But it would be nice to take advantage of the arrays this engine > > supports. In fact, the business model of the project focuses on a vector > > of integers, which is very inconvenient to manage in true normalized > > form, and also as a set of scalars in the same relation. > > So, I am asking for an example of how to integrate non standard types > > from the backend into dabo. > > I would assume that you would have to create custom handlers for these > data types. I would imagine that psycopg would make the necessary > conversion from the PostegreSQL datatype to the nearest Python type (list > in this case). I'm not sure how Dabo would handle lists as column values, > as I've never tried anything like that. However, if you do try and get > errors at the Dabo level, please paste the tracebacks here so that we can > see what would have to be improved in order to handle these correctly. > > > > -- Ed Leafe
The question in my mind is where would the special/custom handlers be created? As you are aware I have considered this issue several times. Postgres arrays can contain any data type (include other arrays). Which means that the code needs to look into the array to determine each python data type (also it would need to be recursive). Then create the python list. The next question is how would Dabo use the python list provided for such items as a DataFields. In my mind it is not a straight forward as just assigning list[0]. And of course there are many Postgres array functions that would have to be considered: several concatenations The test operators regexp_split_to_table function might even be considered part of the array functions. There are many others. As Dabo stands today I would suggest using direct querys and use what psycopg provides. The steps I would consider follows: Create a DataSource Create method to retrieve and populate the datasource Create methods to insert and save the data. Specal methods could be used to extract the array info. Array data size is unlimited and will need special care. Johnf _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[email protected]
