浏览代码

完成update的基本结构

yjp 1 年之前
父节点
当前提交
4e58c1610a
共有 1 个文件被更改,包括 10 次插入1 次删除
  1. 10 1
      v1.go

+ 10 - 1
v1.go

@@ -145,7 +145,16 @@ func deleteMap(clause *deleteClause) map[string]any {
 }
 
 func updateMap(clause *updateClause) map[string]any {
-	return map[string]any{}
+	newTableRows := make(map[string]any)
+	for columnName, value := range clause.newTableRow {
+		newTableRows[columnName] = value.value
+	}
+
+	return map[string]any{
+		"table":         clause.table,
+		"where":         clause.where,
+		"new_table_row": newTableRows,
+	}
 }
 
 func selectMap(clause *selectClause) map[string]any {