ppx_rapper icon indicating copy to clipboard operation
ppx_rapper copied to clipboard

SQL Syntax Error when input variable used as array length

Open kevinclancy opened this issue 9 months ago • 0 comments

The following code:

let create_countries =
  let country_alias_length = 3 in
  [%rapper
    execute
      {sql|
      CREATE TABLE countries(
        id int PRIMARY KEY,
        alias char( %int{country_alias_length} ),
        name char(20),
        time_created timestamp,
        UNIQUE(alias)
      )
      |sql}
  ]

Produces the following error message:

Error in ppx_rapper: Syntax error in SQL: 'syntax error at or near "?"'

kevinclancy avatar May 24 '24 21:05 kevinclancy