[Ur] Sql.easy_insertOrUpdate

Adam Chlipala adamc at csail.mit.edu
Wed Sep 28 19:25:41 EDT 2016


Yup, that's the reply I had in mind when I read your first message!


On 09/28/2016 06:54 PM, Saulo Araujo wrote:
> Hi,
>
> Apparently, the way to go is to make the arguments explicit. 
> Therefore, rather than writing:
>
> Sql.easy_insertOrUpdate [[cellTableGroupForeignKeyColumnName = _,
>  cellTableRowForeignKeyColumnName = _,
>  cellTableDateColumnName = _]]
> cellTable
> ({cellTableGroupForeignKeyColumnName = groupId,
>  cellTableRowForeignKeyColumnName = rowId,
>  cellTableDateColumnName = date} ++ contents)
>
> one has to write:
>
> @Sql.easy_insertOrUpdate
> [[cellTableGroupForeignKeyColumnName = _, 
> cellTableRowForeignKeyColumnName = _, cellTableDateColumnName = _]]
> !
> _
> cellTableOtherColumnsInjectable
> _
> cellTableOtherColumnsFolder
> cellTable
> ({cellTableGroupForeignKeyColumnName = groupId, 
> cellTableRowForeignKeyColumnName = rowId, cellTableDateColumnName = 
> date} ++ contents)
>
> Sincerely,
> Saulo
>
> On Wed, Sep 28, 2016 at 5:47 PM, Saulo Araujo <saulo2 at gmail.com 
> <mailto:saulo2 at gmail.com>> wrote:
>
>     Hi,
>
>     I am trying to use the function Sql.easy_insertOrUpdate in the
>     code
>     https://github.com/saulo2/timesheet-upo/blob/master/timeSheet.ur
>     <https://github.com/saulo2/timesheet-upo/blob/master/timeSheet.ur>
>     but I am getting the following compiler errors:
>
>     /home/saulo/Programming/projects/timesheet-upo/timeSheet.ur:103:1:
>     (to 105:35) Can't resolve type class instance
>     Class constraint:  $(map sql_injectable S.cellTableOtherColumns)
>     /home/saulo/Programming/projects/timesheet-upo/timeSheet.ur:103:1:
>     (to 105:35) Can't resolve type class instance
>     Class constraint:  Top.folder[[Type]] S.cellTableOtherColumns
>
>     I faced similar errors before, and I got rid of them by declaring
>     the type class instances in the SCHEMA signature. However, doing
>     the same did not work for
>
>     $(map sql_injectable S.cellTableOtherColumns)
>
>     and
>
>     folder cellTableOtherColumns.
>
>     Does anyone know why?
>
>     Sincerely,
>     Saulo
>
>
>
>
> _______________________________________________
> Ur mailing list
> Ur at impredicative.com
> http://www.impredicative.com/cgi-bin/mailman/listinfo/ur

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20160928/c640fa95/attachment.html>


More information about the Ur mailing list