Skip to content

Commit 312de70

Browse files
committed
Working update and revert
Signed-off-by: worksofliam <[email protected]>
1 parent 701ced1 commit 312de70

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-db2i",
33
"displayName": "Db2 for IBM i",
44
"description": "Db2 for IBM i tools in VS Code",
5-
"version": "1.6.3-scott6",
5+
"version": "1.6.3-scott8",
66
"engines": {
77
"vscode": "^1.95.0"
88
},

src/views/results/html.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,19 @@ document.getElementById('resultset').onclick = function(e){
129129
}
130130
}
131131
132-
const finishEditing = (currentNode) => {
133-
if (currentNode === undefined) return;
132+
const finishEditing = () => {
133+
if (editableNode === undefined) return;
134134
135135
// Remove keydown listener
136-
currentNode.removeEventListener('keydown', keydownEvent);
136+
editableNode.removeEventListener('keydown', keydownEvent);
137137
138-
currentNode.contentEditable = false;
139-
let newValue = currentNode.innerText;
138+
editableNode.contentEditable = false;
139+
let newValue = editableNode.innerText;
140140
141141
if (newValue === chosenValue) return;
142142
if (chosenColumnDetail.maxInputLength && newValue.length > chosenColumnDetail.maxInputLength) {
143143
newValue = newValue.substring(0, chosenColumnDetail.maxInputLength);
144-
currentNode.innerText = newValue;
144+
editableNode.innerText = newValue;
145145
}
146146
147147
const useRrn = updateKeyColumns.length === 1 && updateKeyColumns.some(col => col.name === 'RRN');
@@ -159,7 +159,7 @@ document.getElementById('resultset').onclick = function(e){
159159
bindings.push(newValue);
160160
updateStatement += '?';
161161
} else {
162-
currentNode.innerHTML = chosenValue;
162+
editableNode.innerHTML = chosenValue;
163163
return;
164164
}
165165
break;
@@ -196,9 +196,9 @@ document.getElementById('resultset').onclick = function(e){
196196
}
197197
}
198198
199-
currentNode = undefined;
199+
requestCellUpdate(editableNode, chosenValue, updateStatement, bindings);
200200
201-
requestCellUpdate(currentNode, chosenValue, updateStatement, bindings);
201+
editableNode = undefined;
202202
}
203203
204204
editableNode.addEventListener('blur', (e) => {

src/views/results/resultSetPanelProvider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export class ResultSetPanelProvider implements WebviewViewProvider {
6161

6262
case `update`:
6363
if (message.id && message.update && message.bindings) {
64+
console.log(message);
6465
try {
6566
const result = await JobManager.runSQL(message.update, {parameters: message.bindings});
6667
postCellResponse(message.id, true);
@@ -199,7 +200,7 @@ export class ResultSetPanelProvider implements WebviewViewProvider {
199200
currentColumns = tableInfo.map((column) => ({
200201
name: column.COLUMN_NAME,
201202
jsType: column.NUMERIC_PRECISION ? `number` : `asString`,
202-
useInWhere: column.IS_IDENTITY === `YES` || column.CONSTRAINT_NAME !== null,
203+
useInWhere: column.IS_IDENTITY === `YES`,
203204
maxInputLength: column.CHARACTER_MAXIMUM_LENGTH
204205
}));
205206

0 commit comments

Comments
 (0)