(
compiler, stmt, c, implicit_return_defaults, values, kw
)
| 1185 | |
| 1186 | |
| 1187 | def _append_param_insert_hasdefault( |
| 1188 | compiler, stmt, c, implicit_return_defaults, values, kw |
| 1189 | ): |
| 1190 | if c.default.is_sequence: |
| 1191 | if compiler.dialect.supports_sequences and ( |
| 1192 | not c.default.optional or not compiler.dialect.sequences_optional |
| 1193 | ): |
| 1194 | accumulated_bind_names: Set[str] = set() |
| 1195 | values.append( |
| 1196 | ( |
| 1197 | c, |
| 1198 | compiler.preparer.format_column(c), |
| 1199 | compiler.process( |
| 1200 | c.default, |
| 1201 | accumulate_bind_names=accumulated_bind_names, |
| 1202 | **kw, |
| 1203 | ), |
| 1204 | accumulated_bind_names, |
| 1205 | ) |
| 1206 | ) |
| 1207 | if implicit_return_defaults and c in implicit_return_defaults: |
| 1208 | compiler.implicit_returning.append(c) |
| 1209 | elif not c.primary_key: |
| 1210 | compiler.postfetch.append(c) |
| 1211 | elif c.default.is_clause_element: |
| 1212 | accumulated_bind_names = set() |
| 1213 | values.append( |
| 1214 | ( |
| 1215 | c, |
| 1216 | compiler.preparer.format_column(c), |
| 1217 | compiler.process( |
| 1218 | c.default.arg.self_group(), |
| 1219 | accumulate_bind_names=accumulated_bind_names, |
| 1220 | **kw, |
| 1221 | ), |
| 1222 | accumulated_bind_names, |
| 1223 | ) |
| 1224 | ) |
| 1225 | |
| 1226 | if implicit_return_defaults and c in implicit_return_defaults: |
| 1227 | compiler.implicit_returning.append(c) |
| 1228 | elif not c.primary_key: |
| 1229 | # don't add primary key column to postfetch |
| 1230 | compiler.postfetch.append(c) |
| 1231 | else: |
| 1232 | values.append( |
| 1233 | ( |
| 1234 | c, |
| 1235 | compiler.preparer.format_column(c), |
| 1236 | _create_insert_prefetch_bind_param(compiler, c, **kw), |
| 1237 | (c.key,), |
| 1238 | ) |
| 1239 | ) |
| 1240 | |
| 1241 | |
| 1242 | def _append_param_insert_select_hasdefault( |
no test coverage detected