Explorer

definy.sql-in-statements

description
Statements prefix + (?, ...) with items as the parameters, 50 at a time (D1 limits the parameters of a statement)
type
Fn(prefix: String, items: List<String>) -> List<@definy.sql-statement>
expression
fn(prefix$0, items$1) =>
  @core.list-map(
    T: List<String>,
    U: @definy.sql-statement,
    f: fn(item$2) =>
      {
        sql: @core.string-concat(
          left: @core.string-concat(left: $0, right: "("),
          right: @core.string-concat(left: @definy.sql-placeholders(count: @core.list-length(value: $2)), right: ")")
        ),
        params: @core.list-map(
          T: String,
          U: @definy.sql-value,
          f: fn(item$3) =>
            #text<@definy.sql-value>($3),
          xs: $2
        )
      },
    xs: @definy.string-chunks(items: $1, size: 50, start: 0)
  )
visibility
public
definy.sql-in-statements (project definy, branch release-time-compare, snapshot JJrRgQW_LZN6tN8CbYr1dN7HosqNTuIWWYx7ACbt1n0)
id: cREIvZvTgCtz-es7cQE-Zmb2P7JGc0zSz6mMVmrOo_g
content hash: CP89eE-VfetpPZKpcZcTX7xHXZUuwjgpa03T1tWZ2j0