(Context<?> ctx, DataType<?> type)
| 6194 | |
| 6195 | |
| 6196 | private static final void toSQLDDLTypeDeclarationDefault(Context<?> ctx, DataType<?> type) { |
| 6197 | if (type.defaulted()) { |
| 6198 | Field<?> v = type.defaultValue(); |
| 6199 | ctx.sql(' ').visit(K_DEFAULT).sql(' '); |
| 6200 | |
| 6201 | // [#17803] Some dialects can't handle expressions in defaults. |
| 6202 | if (NO_SUPPORT_DEFAULT_CAST.contains(ctx.dialect())) |
| 6203 | ctx.castMode(CastMode.NEVER, c -> visitDefault(c, type, v)); |
| 6204 | else |
| 6205 | visitDefault(ctx, type, v); |
| 6206 | } |
| 6207 | } |
| 6208 | |
| 6209 | private static final void visitDefault(Context<?> ctx, DataType<?> type, Field<?> v) { |
| 6210 | // [#15943] Some dialects require parentheses around expressions. We can't use AbstractField::parenthesised |
no test coverage detected