You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

23 lines
555 B

const dbClientes = _db.query(`
SELECT
cliente.nome AS cliente_nome, cliente.email, cliente.uid, pais.nome AS pais_nome
FROM cliente
INNER JOIN pais ON pais.id = cliente.pais_id
`);
const clientes = _val.list();
for (dbCliente of dbClientes) {
clientes.add(
_val.map()
.set("nome", dbCliente.getString("cliente_nome"))
.set("email", dbCliente.getString("email"))
.set("uid", dbCliente.getString("uid"))
.set("pais", dbCliente.getString("pais_nome"))
)
};
_out.json(
_val.map()
.set("results",clientes)
)