Commit 340074a
feat(codegen-kotlin): KotlinTypeMapper emits text() column for long strings (kind=text OR maxLength>4000)
StringField.exposedColumnSpec now dispatches to Exposed text(name) when
either @kind=text is set or @maxlength exceeds the VARCHAR/TEXT cutoff
(4000, the Postgres TOAST boundary). Otherwise behavior is unchanged:
varchar(name, N) with N defaulting to 255.
- new private constants: VARCHAR_TEXT_THRESHOLD=4000, KIND_TEXT, ATTR_KIND
- new helper: stringAttr(field, name) reads an own-only string attribute
for dispatch keys outside the registered StringField schema
- three new tests on KotlinTypeMapperTest (kind=text -> text, large
maxLength -> text, small maxLength -> varchar)
53 prior + 3 new = 56 tests green. Snapshot fixtures unaffected (no
existing fixture uses maxLength > 4000).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent a707984 commit 340074a
2 files changed
Lines changed: 61 additions & 1 deletion
File tree
- server/java/codegen-kotlin/src
- main/kotlin/com/metaobjects/generator/kotlin
- test/kotlin/com/metaobjects/generator/kotlin
Lines changed: 38 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
48 | 62 | | |
49 | 63 | | |
50 | 64 | | |
| |||
105 | 119 | | |
106 | 120 | | |
107 | 121 | | |
108 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
109 | 132 | | |
110 | 133 | | |
111 | 134 | | |
| |||
127 | 150 | | |
128 | 151 | | |
129 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
130 | 167 | | |
131 | 168 | | |
132 | 169 | | |
| |||
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
151 | 153 | | |
152 | 154 | | |
153 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
154 | 177 | | |
155 | 178 | | |
156 | 179 | | |
| |||
0 commit comments