System Information
- Strapi Version: v.4.2.0
- Operating System: Ubuntu 20
- Database: Postgres
- Node Version: v12.13.1
- NPM Version: 6.12.1
- Yarn Version: NA
I am using the following to get data from Postgres in custom-controllers of my collection in Strapi;
const result = await knex.raw(SELECT * FROM testset
)
There is no data in the table. But I still get a bunch of metadata in my result.
{“command”:“SELECT”,“rowCount”:0,“oid”:null,“rows”:[],“fields”:[{“name”:“id”,“tableID”:26968,“columnID”:1,“dataTypeID”:23,“dataTypeSize”:4,“dataTypeModifier”:-1,“format”:“text”},…
My question is, how can I NOT get this metadata and instead, maybe, get an empty array [ ]?
Thanks.