In honeysql-postgres/test/honeysql_postgres/postgres_test.clj
there’s a test for create-table
:
(deftest create-table-test
(testing "create table with two columns"
(is (= ["CREATE TABLE cities (city varchar(80) PRIMARY KEY, location point)"]
(-> (create-table :cities)
(with-columns [[:city (sql/call :varchar 80) (sql/call :primary-key)]
[:location :point]])
sql/format))))
`When I run
(-> (pg-helpers/create-table :cities)
(pg-helpers/with-columns [[:city (sql/call :varchar 80) (sql/call :primary-key)]
[:location :point]])
sql/format)
I get ["CREATE TABLE cities (city varchar(?) PRIMARY KEY, location point)"
80]
rather than ["CREATE TABLE cities (city varchar(80) PRIMARY KEY, location point)"]
as in the test fileThis generates an error when sent on to jdbc, PSQLException ERROR: syntax error at or near “$1”
So how do I get it to inline the 80
as per the test case?