L
Lee Harr
Is there a special DB API style for inserting array values in
to a database?
In postgres, the values needs to end up like ARRAY[1, 2, 3]
so I am just putting the word ARRAY in to the query string
like this:
q = "INSERT INTO foo VALUES (ARRAY%(bar)s)" % {'bar': [1, 2, 3]}
That works, but it seems to me there may be a better way.
Thanks for your time.
to a database?
In postgres, the values needs to end up like ARRAY[1, 2, 3]
so I am just putting the word ARRAY in to the query string
like this:
q = "INSERT INTO foo VALUES (ARRAY%(bar)s)" % {'bar': [1, 2, 3]}
That works, but it seems to me there may be a better way.
Thanks for your time.