liquid_feedback_frontend
view env/encode/pg_hstore.lua @ 1073:f9c1acb859d0
Fixed errors in registration after import of LDAP patch, updated registration layout
author | bsw |
---|---|
date | Fri Jul 18 23:13:19 2014 +0200 (2014-07-18) |
parents | 58f48a8a202a |
children |
line source
1 -- Encodes a Lua table as PostgreSQL hstore text input
2 -- TODO This should be implemented in the SQL abstraction layer
4 function encode.pg_hstore(hstore_values)
6 local entries = {}
8 for key, val in pairs(hstore_values) do
9 local escaped_key = encode.pg_hstore_value(key)
10 local escaped_val = encode.pg_hstore_value(val)
11 entries[#entries+1] = escaped_key .. "=>" .. escaped_val
12 end
14 return table.concat(entries, ", ")
16 end