I would say you should join() the ids into a string using join (from strutils). 
If the ids are int64s, then first convert them to either an array of string and 
then join them, or immediately to a string using a loop.

Also, take a look at [Nexus](https://github.com/jfilby/nexus) which includes an 
ORM. You define your model in YAML, although I'm moving to Nim objects in a 
future version. Then you'd query with:
    
    
    let idList = @[ 1, 2, 3, 4, 5 ]
    
    filterMyTable(
      myContext.db,
      whereClause = "col in (?)",
      whereValues = join(idList, ", "))
    
    
    Run

The filterMyTable() proc is generated and calls db_postgres for you, returning 
an object type that descibes a record for the myTable model (the my_table 
table). You could then call updateMyTableByPk() per record returned, updating 
on the primary key. This approach is a bit slow, because you first have to 
fetch the records, but it seems to be a common problem with ORMs.

I also plan on reworking this sort of proc to be more flexible (use of Nim 
objects), but the code will be backwards compatible.

Reply via email to