Skip to content

Commit 1f14e34

Browse files
committed
新增支持 增删改
1 parent 4a91f0d commit 1f14e34

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/main/java/apijson/surrealdb/SurrealDBUtil.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,16 @@ public static <T> int execUpdate(SQLConfig<T> config, String sql) throws Excepti
178178
return result.getIntValue(JSONResponse.KEY_COUNT);
179179
}
180180

181-
public static <T> JSONObject executeUpdate(SQLConfig<T> config, String sql) throws Exception {
181+
public static <T> JSONObject executeUpdate(@NotNull SQLConfig<T> config, String sql) throws Exception {
182182
return executeUpdate(null, config, sql);
183183
}
184-
public static <T> JSONObject executeUpdate(Surreal client, SQLConfig<T> config, String sql) throws Exception {
184+
public static <T> JSONObject executeUpdate(Surreal client, @NotNull SQLConfig<T> config, String sql) throws Exception {
185185
if (client == null) {
186186
client = getClient(config);
187187
}
188188

189-
// TODO client.update(StringUtil.isEmpty(sql) ? config.getSQL(false) : sql);
189+
List<JSONObject> list = executeQuery(config, sql, false);
190+
// 返回的是当前插入的表记录 JSONObject first = list == null || list.isEmpty() ? null : list.get(0);
190191

191192
JSONObject result = AbstractParser.newSuccessResult();
192193

0 commit comments

Comments
 (0)