cube-js / cube

📊 Cube — Universal semantic layer platform for AI, BI, spreadsheets, and embedded analytics
https://cube.dev
Other
17.96k stars 1.78k forks source link

`SELECT VERSION()` returns "version()" as column name in the SQL API #8911

Open Rayyan98 opened 2 weeks ago

Rayyan98 commented 2 weeks ago

Description I am seeing a problem when connecting to cube sql api using ORMs. I tried connecting to it with Knex, however, it fails to connect with knex not being able to infer the postgres version. This is happening because knex runs the select version() query and expects the returned rows to have column names / keys as version which is what happens on actual postgres. However, cube returns the version with the column name / key as version() and hence the ORM fails initialization. Images attached

To Reproduce Make a small project and install knex and pg libraries into it. Try connecting to cube sql api and running a query. Fails with a parseVersion hint in the stack trace

Expected behavior Should connect and run queries without problems

Screenshots image

image

image

Minimally reproducible Cube Schema Any schema