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", "license": "GPL",
"keywords": [ "keywords": [
"sql", "sql",
"mssql",
"mssql",
"postgresql",
"excel",
"json", "json",
"import", "import",
"export", "export",

View File

@@ -27,7 +27,7 @@ async function loadPackageInfo(dir) {
module.exports = { module.exports = {
script_meta: 'get', script_meta: 'get',
async script({ packageName }) { 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, { const data = await fs.readFile(file, {
encoding: 'utf-8', encoding: 'utf-8',
}); });

View File

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

View File

@@ -13,7 +13,7 @@ function requirePlugin(packageName, requiredPlugin = null) {
if (requiredPlugin == null) { if (requiredPlugin == null) {
console.log('Loading module', packageName); 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; requiredPlugin = module.__esModule ? module.default : module;
} }
loadedPlugins[packageName] = requiredPlugin; loadedPlugins[packageName] = requiredPlugin;

View File

@@ -424,6 +424,7 @@ export abstract class GridDisplay {
} }
getPageQuery(offset: number, count: number) { getPageQuery(offset: number, count: number) {
if (!this.driver) return null;
const select = this.createSelect(); const select = this.createSelect();
if (!select) return null; if (!select) return null;
if (this.driver.dialect.rangeSelect) select.range = { offset: offset, limit: count }; 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 [childCache, setChildCache] = React.useState(createGridCache());
const [refReloadToken, setRefReloadToken] = React.useState(0); const [refReloadToken, setRefReloadToken] = React.useState(0);
const [myLoadedTime, setMyLoadedTime] = React.useState(0); const [myLoadedTime, setMyLoadedTime] = React.useState(0);
const extension = useExtensions(); const extensions = useExtensions();
const { childConfig } = config; const { childConfig } = config;
const setChildConfig = (value, reference = undefined) => { const setChildConfig = (value, reference = undefined) => {
@@ -77,7 +77,7 @@ export default function TableDataGrid({
return connection return connection
? new TableGridDisplay( ? new TableGridDisplay(
{ schemaName, pureName }, { schemaName, pureName },
findEngineDriver(connection, extension), findEngineDriver(connection, extensions),
config, config,
setConfig, setConfig,
cache || myCache, cache || myCache,
@@ -99,7 +99,7 @@ export default function TableDataGrid({
if (!newDisplay) return; if (!newDisplay) return;
if (display && display.isLoadedCorrectly && !newDisplay.isLoadedCorrectly) return; if (display && display.isLoadedCorrectly && !newDisplay.isLoadedCorrectly) return;
setDisplay(newDisplay); 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(() => { const handleDatabaseStructureChanged = React.useCallback(() => {
(setCache || setMyCache)(createGridCache()); (setCache || setMyCache)(createGridCache());