Skip to content
Search
DSL · Pg query

values_table

Definition

/**
 * Create a VALUES clause as a table reference.
 *
 * Usage:
 *   select()->from(
 *       values_table(
 *           row_expr([literal(1), literal('Alice')]),
 *           row_expr([literal(2), literal('Bob')])
 *       )->as('t', ['id', 'name'])
 *   )
 *
 * Generates: SELECT * FROM (VALUES (1, 'Alice'), (2, 'Bob')) AS t(id, name)
 */
values_table(RowExpression $rows) : ValuesTable

Contributors

Built in the open.

Join us on GitHub
scroll back to top