honeysql

Bingen Galartza Iparragirre 2023-04-21T13:28:30.272249Z

Hi! is it possible to use the WITH _storage_parameter=value`_ ` options in the create table/view ddl operations using HoneySQL? I don't know if it's part of the SQL standard or PSQL specific. https://www.postgresql.org/docs/current/sql-creatematerializedview.html

iarenaza 2023-04-24T15:14:01.156999Z

@bingen.galartza This should do the trick:

user> (sql/format {:create-materialized-view [:product [[:with [:= :storage-parameter "value"]]]]
                   :select [:*]
                   :from [:table]
                   :where [:= :column "value"]
                   :with-data false})
["CREATE MATERIALIZED VIEW product WITH(storage_parameter = 'value') AS SELECT * FROM table WHERE column = ? WITH NO DATA"
 "value"]

Bingen Galartza Iparragirre 2023-04-24T15:42:37.889169Z

Great! Thanks a lot