Create a values list based relation, and the schema is inferred from data, consuming `value`. See the [Postgres VALUES](https://www.postgresql.org/docs/current/queries-values.html) documentation for more details. so it's usually better to override the default names with a table alias list. If the values include params/binders such as $1, $2, $3, etc, then the `param_data_types` should be provide
(values: Vec<Vec<Expr>>)
| 208 | /// |
| 209 | /// If the values include params/binders such as $1, $2, $3, etc, then the `param_data_types` should be provided. |
| 210 | pub fn values(values: Vec<Vec<Expr>>) -> Result<Self> { |
| 211 | if values.is_empty() { |
| 212 | return plan_err!("Values list cannot be empty"); |
| 213 | } |
| 214 | let n_cols = values[0].len(); |
| 215 | if n_cols == 0 { |
| 216 | return plan_err!("Values list cannot be zero length"); |
| 217 | } |
| 218 | for (i, row) in values.iter().enumerate() { |
| 219 | if row.len() != n_cols { |
| 220 | return plan_err!( |
| 221 | "Inconsistent data length across values list: got {} values in row {} but expected {}", |
| 222 | row.len(), |
| 223 | i, |
| 224 | n_cols |
| 225 | ); |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | // Infer from data itself |
| 230 | Self::infer_data(values) |
| 231 | } |
| 232 | |
| 233 | /// Create a values list based relation, and the schema is inferred from data itself or table schema if provided, consuming |
| 234 | /// `value`. See the [Postgres VALUES](https://www.postgresql.org/docs/current/queries-values.html) |