| 213 | ) |
| 214 | |
| 215 | def test_inline_defaults(self): |
| 216 | m = MetaData() |
| 217 | foo = Table("foo", m, Column("id", Integer)) |
| 218 | |
| 219 | t = Table( |
| 220 | "test", |
| 221 | m, |
| 222 | Column("col1", Integer, default=func.foo(1)), |
| 223 | Column( |
| 224 | "col2", |
| 225 | Integer, |
| 226 | default=select(func.coalesce(func.max(foo.c.id))), |
| 227 | ), |
| 228 | ) |
| 229 | |
| 230 | self.assert_compile( |
| 231 | t.insert().values({}), |
| 232 | "INSERT INTO test (col1, col2) VALUES (foo(:foo_1), " |
| 233 | "(SELECT coalesce(max(foo.id)) AS coalesce_1 FROM " |
| 234 | "foo))", |
| 235 | ) |
| 236 | |
| 237 | self.assert_compile( |
| 238 | t.insert().inline().values({}), |
| 239 | "INSERT INTO test (col1, col2) VALUES (foo(:foo_1), " |
| 240 | "(SELECT coalesce(max(foo.id)) AS coalesce_1 FROM " |
| 241 | "foo))", |
| 242 | ) |
| 243 | |
| 244 | def test_generic_insert_bind_params_all_columns(self): |
| 245 | table1 = self.tables.mytable |