Эх сурвалжийг харах

完成update的基本结构

yjp 1 жил өмнө
parent
commit
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 {