Typeorm query with Inner Join is coming empty

Asked

Viewed 363 times

2

I made two tables, Usuario 1 : N Produto

I made an Inner Join with Typeorm, but an empty array was coming, so I took the query it was generating to analyze it better. When I played the query in Dbeaver worked perfectly, the data came right, however, only when I call for the application it comes empty, someone could help me??

Query generated when using getQuery()

SELECT "Produto"."nome", "usuario"."nome" FROM "tb_produto" "Produto" INNER JOIN "tb_usuario" "usuario" ON "usuario"."id" = "Produto"."id_usuario"

Query that comes with the empty array in the application

const produtos = await createQueryBuilder(Produto)
                .innerJoinAndSelect('tb_usuario', 'usuario','usuario.id = Produto.id_usuario')
                .select('Produto.nome, usuario.nome')
                .getMany();

Picture of aid

inserir a descrição da imagem aqui

1 answer

1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.