package ink.wgink.database.service.jdbc;

import ink.wgink.database.pojo.vos.sql.SqlVO;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultList;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

/**
 * @ClassName: IJdbcService
 * @Description: jdbc
 * @Author: wanggeng
 * @Date: 2021/10/27 9:59 上午
 * @Version: 1.0
 */
public interface IJdbcService {

    Boolean isConnected(String mysqlId);

    void openConnection(String mysqlId) throws SQLException;

    void closeConnection(String mysqlId) throws SQLException;

    List<Map<String, Object>> listSchemata(String mysqlId) throws SQLException;

    List<Map<String, Object>> listTable(String mysqlId, String schemata) throws SQLException;

    List<Map<String, Object>> listField(String mysqlId, String schemata, String table) throws SQLException;

    List<Map<String, Object>> listData(String mysqlId, String schemata, String table) throws SQLException;

    List<Map<String, Object>> listData(String mysqlId, String schemata, String table, SqlVO sqlVO) throws SQLException;

    SuccessResultList<List<Map<String, Object>>> listPageData(String mysqlId, String schemata, String table, int index, int size) throws SQLException;

    SuccessResult listPageQuerySql(String mysqlId, int page, int size, SqlVO sqlVO) throws SQLException;

    void updateSql(String mysqlId, SqlVO sqlVO) throws SQLException;
}
