try to fix virtual FK problem

This commit is contained in:
Jan Prochazka
2022-02-24 16:13:10 +01:00
parent eacb026603
commit 1afbf6049e
2 changed files with 12 additions and 9 deletions

View File

@@ -3,8 +3,8 @@
version: "3" version: "3"
services: services:
dbgate: dbgate:
build: docker # build: docker
# image: dbgate/dbgate:beta-alpine image: dbgate/dbgate:beta-alpine
restart: always restart: always
ports: ports:
- 3100:3000 - 3100:3000
@@ -14,8 +14,8 @@ services:
volumes: volumes:
- dbgate-data:/root/dbgate-data - dbgate-data:/root/dbgate-data
# environment: environment:
# WEB_ROOT: /dbgate WEB_ROOT: /dbgate
# volumes: # volumes:
# - /home/jena/test/chinook:/mnt/sqt # - /home/jena/test/chinook:/mnt/sqt

View File

@@ -29,7 +29,12 @@
let refTableName = null; let refTableName = null;
let refSchemaName = null; let refSchemaName = null;
$: refTableInfo = $dbInfo?.tables?.find(x => x.pureName == refTableName && x.schemaName == refSchemaName); $: tableList = [
..._.sortBy($dbInfo?.tables || [], ['schemaName', 'pureName']),
// ..._.sortBy($dbInfo?.views || [], ['schemaName', 'pureName']),
];
$: refTableInfo = tableList.find(x => x.pureName == refTableName && x.schemaName == refSchemaName);
// $dbInfo?.views?.find(x => x.pureName == refTableName && x.schemaName == refSchemaName); // $dbInfo?.views?.find(x => x.pureName == refTableName && x.schemaName == refSchemaName);
onMount(() => { onMount(() => {
@@ -43,6 +48,7 @@
} }
}); });
// $: console.log('conid, database', conid, database);
// $: console.log('$dbInfo?.tables', $dbInfo?.tables); // $: console.log('$dbInfo?.tables', $dbInfo?.tables);
</script> </script>
@@ -58,10 +64,7 @@
value={fullNameToString({ pureName: refTableName, schemaName: refSchemaName })} value={fullNameToString({ pureName: refTableName, schemaName: refSchemaName })}
isNative isNative
notSelected notSelected
options={[ options={tableList.map(tbl => ({
..._.sortBy($dbInfo?.tables || [], ['schemaName', 'pureName']),
// ..._.sortBy($dbInfo?.views || [], ['schemaName', 'pureName']),
].map(tbl => ({
label: fullNameToLabel(tbl), label: fullNameToLabel(tbl),
value: fullNameToString(tbl), value: fullNameToString(tbl),
}))} }))}