dataease-dm/backend/src/main/java/io/dataease/datasource/provider/DatasourceProvider.java

45 lines
957 B
Java
Raw Normal View History

2021-02-20 18:35:09 +08:00
package io.dataease.datasource.provider;
2021-02-22 15:30:15 +08:00
import io.dataease.base.domain.Datasource;
2021-02-22 18:06:37 +08:00
import io.dataease.datasource.dto.TableFiled;
2021-02-22 15:30:15 +08:00
2021-02-22 18:06:37 +08:00
import java.util.ArrayList;
2021-02-20 18:35:09 +08:00
import java.util.List;
public abstract class DatasourceProvider {
2021-02-22 15:30:15 +08:00
protected String query;
private int resultLimit = 30000;
protected Datasource datasource;
2021-02-20 18:35:09 +08:00
public String getQuery() {
return query;
}
public void setQuery(String query) {
this.query = query;
}
2021-02-22 15:30:15 +08:00
public Datasource getDatasource() {
return datasource;
2021-02-20 18:35:09 +08:00
}
2021-02-22 15:30:15 +08:00
public void setDatasource(Datasource datasource) {
this.datasource = datasource;
2021-02-20 18:35:09 +08:00
}
abstract public List<String[]> getData() throws Exception;
abstract public List<String> getTables() throws Exception;
2021-02-22 18:06:37 +08:00
public List<TableFiled> getTableFileds(String table) throws Exception{
return new ArrayList<>();
};
2021-02-20 18:35:09 +08:00
public void test() throws Exception {
getData();
}
}