feat:copy sql

This commit is contained in:
SwallowGG
2024-03-07 10:30:28 +08:00
parent 9fdc97a2d1
commit e4dae07b54
9 changed files with 146 additions and 12 deletions

View File

@ -112,6 +112,12 @@ public class TableController extends EmbeddingController {
return ListResult.of(tableVOS);
}
@GetMapping("/copy_dml_sql")
public DataResult<String> copyDmlSql(@Valid DmlSqlCopyRequest request) {
DmlSqlCopyParam queryParam = rdbWebConverter.dmlRequest2param(request);
return tableService.copyDmlSql(queryParam);
}
/**
* Query the table index under the current DB
*

View File

@ -254,4 +254,6 @@ public abstract class RdbWebConverter {
public abstract EsTableSchemaRequest req2req(TableBriefQueryRequest request);
public abstract TablePageQueryParam schemaReq2page(EsTableSchemaRequest request);
public abstract DmlSqlCopyParam dmlRequest2param(DmlSqlCopyRequest request) ;
}

View File

@ -0,0 +1,14 @@
package ai.chat2db.server.web.api.controller.rdb.request;
import ai.chat2db.server.web.api.controller.data.source.request.DataSourceBaseRequest;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
@Data
public class DmlSqlCopyRequest extends DataSourceBaseRequest {
@NotNull
private String tableName;
private String type;
}