| 225 | ) |
| 226 | |
| 227 | def test_inline_defaults(self): |
| 228 | m = MetaData() |
| 229 | foo = Table("foo", m, Column("id", Integer)) |
| 230 | |
| 231 | t = Table( |
| 232 | "test", |
| 233 | m, |
| 234 | Column("col1", Integer, default=func.foo(1)), |
| 235 | Column( |
| 236 | "col2", |
| 237 | Integer, |
| 238 | default=select(func.coalesce(func.max(foo.c.id))), |
| 239 | ), |
| 240 | ) |
| 241 | |
| 242 | self.assert_compile( |
| 243 | t.insert().values({}), |
| 244 | "INSERT INTO test (col1, col2) VALUES (foo(:foo_1), " |
| 245 | "(SELECT coalesce(max(foo.id)) AS coalesce_1 FROM " |
| 246 | "foo))", |
| 247 | ) |
| 248 | |
| 249 | self.assert_compile( |
| 250 | t.insert().inline().values({}), |
| 251 | "INSERT INTO test (col1, col2) VALUES (foo(:foo_1), " |
| 252 | "(SELECT coalesce(max(foo.id)) AS coalesce_1 FROM " |
| 253 | "foo))", |
| 254 | ) |
| 255 | |
| 256 | def test_generic_insert_bind_params_all_columns(self): |
| 257 | table1 = self.tables.mytable |