MCPcopy
hub / github.com/jOOQ/jOOQ / toSQLDDLTypeDeclarationDefault

Method toSQLDDLTypeDeclarationDefault

jOOQ/src/main/java/org/jooq/impl/Tools.java:6196–6207  ·  view source on GitHub ↗
(Context<?> ctx, DataType<?> type)

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 8

visitDefaultMethod · 0.95
defaultedMethod · 0.65
defaultValueMethod · 0.65
sqlMethod · 0.65
visitMethod · 0.65
containsMethod · 0.65
dialectMethod · 0.65
castModeMethod · 0.65

Tested by

no test coverage detected