Skip to content

Should it reuse values? #5

@Janpot

Description

@Janpot
SQL`INSERT into table(id, text) VALUES (${1}, ${'x'}), (${2}, ${'x'}), (${3}, ${'x'}), (${4}, ${'x'}), (${5}, ${'x'})`

currently results into

{
  text: 'INSERT into table(id, text) VALUES ($1, $2), ($3, $4), ($5, $6), ($7, $8), ($9, $10)',
  values: [1, 'x', 2, 'x', 3, 'x', 4, 'x', 5, 'x']
}

Could this be optimized to return

{
  text: 'INSERT into table(id, text) VALUES ($1, $2), ($3, $2), ($4, $2), ($5, $2), ($6, $2)',
  values: [1, 'x', 2, 3, 4, 5]
}

?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions