Skip to content

Commit 3c3bf3e

Browse files
authored
Merge pull request #351 from codefori/fix/support_null_for_small_columns
Support for null in small columns
2 parents 026a5c3 + 4778d4f commit 3c3bf3e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/views/results/html.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,13 @@ document.getElementById('resultset').onclick = function(e){
143143
let bindings = [];
144144
let updateStatement = 'UPDATE ' + updateTable.table + ' t SET t.' + chosenColumn + ' = ';
145145
146-
if (newValue === 'null') {
146+
if (chosenColumnDetail.maxInputLength >= 4 && newValue === 'null') {
147+
// If the column can fit 'null', then set it to null value
147148
updateStatement += 'NULL';
148-
149+
} else if (chosenColumnDetail.maxInputLength < 4 && newValue === '-') {
150+
// If the column cannot fit 'null', then '-' is the null value
151+
updateStatement += 'NULL';
152+
149153
} else {
150154
switch (chosenColumnDetail.jsType) {
151155
case 'number':

0 commit comments

Comments
 (0)