This commit is contained in:
Jan Prochazka
2020-11-26 14:23:31 +01:00
parent c96cb08cfd
commit 06e98cff9f
6 changed files with 7 additions and 9 deletions

View File

@@ -12,10 +12,6 @@
"license": "GPL",
"keywords": [
"sql",
"mssql",
"mssql",
"postgresql",
"excel",
"json",
"import",
"export",

View File

@@ -27,7 +27,7 @@ async function loadPackageInfo(dir) {
module.exports = {
script_meta: 'get',
async script({ packageName }) {
const file = path.join(pluginsdir(), packageName, 'lib', 'frontend.js');
const file = path.join(pluginsdir(), packageName, 'dist', 'frontend.js');
const data = await fs.readFile(file, {
encoding: 'utf-8',
});

View File

@@ -18,6 +18,7 @@ class ParseStream extends stream.Transform {
}
if (!this.limitRows || this.rowsWritten < this.limitRows) {
this.push(obj);
this.rowsWritten += 1;
}
done();
}

View File

@@ -13,7 +13,7 @@ function requirePlugin(packageName, requiredPlugin = null) {
if (requiredPlugin == null) {
console.log('Loading module', packageName);
const module = require(path.join(pluginsdir(), packageName, 'lib', 'backend.js'));
const module = require(path.join(pluginsdir(), packageName, 'dist', 'backend.js'));
requiredPlugin = module.__esModule ? module.default : module;
}
loadedPlugins[packageName] = requiredPlugin;

View File

@@ -424,6 +424,7 @@ export abstract class GridDisplay {
}
getPageQuery(offset: number, count: number) {
if (!this.driver) return null;
const select = this.createSelect();
if (!select) return null;
if (this.driver.dialect.rangeSelect) select.range = { offset: offset, limit: count };

View File

@@ -50,7 +50,7 @@ export default function TableDataGrid({
const [childCache, setChildCache] = React.useState(createGridCache());
const [refReloadToken, setRefReloadToken] = React.useState(0);
const [myLoadedTime, setMyLoadedTime] = React.useState(0);
const extension = useExtensions();
const extensions = useExtensions();
const { childConfig } = config;
const setChildConfig = (value, reference = undefined) => {
@@ -77,7 +77,7 @@ export default function TableDataGrid({
return connection
? new TableGridDisplay(
{ schemaName, pureName },
findEngineDriver(connection, extension),
findEngineDriver(connection, extensions),
config,
setConfig,
cache || myCache,
@@ -99,7 +99,7 @@ export default function TableDataGrid({
if (!newDisplay) return;
if (display && display.isLoadedCorrectly && !newDisplay.isLoadedCorrectly) return;
setDisplay(newDisplay);
}, [connection, config, cache || myCache, conid, database, schemaName, pureName, dbinfo]);
}, [connection, config, cache || myCache, conid, database, schemaName, pureName, dbinfo, extensions]);
const handleDatabaseStructureChanged = React.useCallback(() => {
(setCache || setMyCache)(createGridCache());