comparison src/luan/host/Util.luan @ 1407:1979cff9aad2

add sql/Web_query
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 20 Sep 2019 17:00:30 -0600
parents a5f61890ad84
children db57d562c4bd
comparison
equal deleted inserted replaced
1406:8187ddb0e827 1407:1979cff9aad2
62 function Util.set_postgres_password(domain,password) 62 function Util.set_postgres_password(domain,password)
63 if pg_admin == nil then 63 if pg_admin == nil then
64 return 64 return
65 end 65 end
66 local db = database(pg_admin) 66 local db = database(pg_admin)
67 local exists = db.query("select rolname from pg_roles where rolname=?",domain)() ~= nil; 67 local exists = db.query("select rolname from pg_roles where rolname=?",domain).results() ~= nil;
68 --logger.info("exists "..exists) 68 --logger.info("exists "..exists)
69 if exists then 69 if exists then
70 db.update( [[alter role "]]..domain..[[" with encrypted password ']]..password..[[']] ) 70 db.update( [[alter role "]]..domain..[[" with encrypted password ']]..password..[[']] )
71 end 71 end
72 db.close() 72 db.close()