Materialized views syntax error

There's a bug I've spotted where the query engine generates paranthesis () around the select query which gives syntax error when it is run.

I cannot disclose the code but it had the following structure:

export const fullStatute = pgMaterializedView("statute_search", {
  * column names and their types
}).as(
  sql.raw(`
    SELECT 
       * some columns here
    FROM 
        * first table
    INNER JOIN 
        * second table 
    ON 
        * condition;
`),
);
image.png
Was this page helpful?