Merge pull request #1 from dbgate/master

update
This commit is contained in:
Quentin Laffont 2022-11-04 08:08:05 +01:00 committed by GitHub
commit 8c051ff5f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
56 changed files with 65 additions and 77 deletions

View File

@ -9,7 +9,7 @@ import {
AllowIdentityInsert, AllowIdentityInsert,
Expression, Expression,
} from 'dbgate-sqltree'; } from 'dbgate-sqltree';
import { NamedObjectInfo, DatabaseInfo } from 'dbgate-types'; import type { NamedObjectInfo, DatabaseInfo } from 'dbgate-types';
export interface ChangeSetItem { export interface ChangeSetItem {
pureName: string; pureName: string;

View File

@ -1,6 +1,6 @@
import _ from 'lodash'; import _ from 'lodash';
import { GridDisplay, ChangeCacheFunc, ChangeConfigFunc, DisplayColumn } from './GridDisplay'; import { GridDisplay, ChangeCacheFunc, ChangeConfigFunc, DisplayColumn } from './GridDisplay';
import { EngineDriver, ViewInfo, ColumnInfo, CollectionInfo } from 'dbgate-types'; import type { EngineDriver, ViewInfo, ColumnInfo, CollectionInfo } from 'dbgate-types';
import { GridConfig, GridCache } from './GridConfig'; import { GridConfig, GridCache } from './GridConfig';
function getObjectKeys(obj) { function getObjectKeys(obj) {

View File

@ -1,6 +1,6 @@
import _ from 'lodash'; import _ from 'lodash';
import { GridConfig, GridCache, GridConfigColumns, createGridCache, GroupFunc } from './GridConfig'; import { GridConfig, GridCache, GridConfigColumns, createGridCache, GroupFunc } from './GridConfig';
import { TableInfo, EngineDriver, DatabaseInfo, SqlDialect } from 'dbgate-types'; import type { TableInfo, EngineDriver, DatabaseInfo, SqlDialect } from 'dbgate-types';
import { getFilterValueExpression } from 'dbgate-filterparser'; import { getFilterValueExpression } from 'dbgate-filterparser';
import { ChangeCacheFunc, ChangeConfigFunc, DisplayColumn } from './GridDisplay'; import { ChangeCacheFunc, ChangeConfigFunc, DisplayColumn } from './GridDisplay';

View File

@ -1,5 +1,5 @@
import _ from 'lodash'; import _ from 'lodash';
import { EngineDriver, ViewInfo, ColumnInfo } from 'dbgate-types'; import type { EngineDriver, ViewInfo, ColumnInfo } from 'dbgate-types';
import { GridDisplay, ChangeCacheFunc, ChangeConfigFunc } from './GridDisplay'; import { GridDisplay, ChangeCacheFunc, ChangeConfigFunc } from './GridDisplay';
import { GridConfig, GridCache } from './GridConfig'; import { GridConfig, GridCache } from './GridConfig';
import { FreeTableModel } from './FreeTableModel'; import { FreeTableModel } from './FreeTableModel';

View File

@ -1,4 +1,4 @@
import { TableInfo } from 'dbgate-types'; import type { TableInfo } from 'dbgate-types';
export interface FreeTableModel { export interface FreeTableModel {
structure: TableInfo; structure: TableInfo;

View File

@ -1,6 +1,3 @@
import { DisplayColumn } from './GridDisplay';
import { TableInfo } from 'dbgate-types';
export interface GridConfigColumns { export interface GridConfigColumns {
hiddenColumns: string[]; hiddenColumns: string[];
expandedColumns: string[]; expandedColumns: string[];

View File

@ -1,6 +1,6 @@
import _ from 'lodash'; import _ from 'lodash';
import { GridConfig, GridCache, GridConfigColumns, createGridCache, GroupFunc, createGridConfig } from './GridConfig'; import { GridConfig, GridCache, GridConfigColumns, createGridCache, GroupFunc, createGridConfig } from './GridConfig';
import { import type {
ForeignKeyInfo, ForeignKeyInfo,
TableInfo, TableInfo,
ColumnInfo, ColumnInfo,

View File

@ -1,6 +1,5 @@
import _ from 'lodash'; import _ from 'lodash';
import { GridDisplay, ChangeCacheFunc, ChangeConfigFunc } from './GridDisplay'; import { GridDisplay, ChangeCacheFunc, ChangeConfigFunc } from './GridDisplay';
import { QueryResultColumn } from 'dbgate-types';
import { GridConfig, GridCache } from './GridConfig'; import { GridConfig, GridCache } from './GridConfig';
import { analyseCollectionDisplayColumns } from './CollectionGridDisplay'; import { analyseCollectionDisplayColumns } from './CollectionGridDisplay';

View File

@ -1,4 +1,3 @@
import { RangeDefinition } from 'dbgate-types';
import { PerspectiveDataLoadProps } from './PerspectiveDataProvider'; import { PerspectiveDataLoadProps } from './PerspectiveDataProvider';
import _pick from 'lodash/pick'; import _pick from 'lodash/pick';
import _zip from 'lodash/zip'; import _zip from 'lodash/zip';

View File

@ -1,4 +1,4 @@
import { DatabaseInfo, ForeignKeyInfo, NamedObjectInfo, TableInfo } from 'dbgate-types'; import type { DatabaseInfo, ForeignKeyInfo, NamedObjectInfo, TableInfo } from 'dbgate-types';
import uuidv1 from 'uuid/v1'; import uuidv1 from 'uuid/v1';
// export interface PerspectiveConfigColumns { // export interface PerspectiveConfigColumns {

View File

@ -1,6 +1,6 @@
import debug from 'debug'; import debug from 'debug';
import { Condition } from 'dbgate-sqltree'; import { Condition } from 'dbgate-sqltree';
import { RangeDefinition } from 'dbgate-types'; import type { RangeDefinition } from 'dbgate-types';
import { PerspectiveBindingGroup, PerspectiveCache } from './PerspectiveCache'; import { PerspectiveBindingGroup, PerspectiveCache } from './PerspectiveCache';
import { PerspectiveDataLoader } from './PerspectiveDataLoader'; import { PerspectiveDataLoader } from './PerspectiveDataLoader';
import { PerspectiveDataPatternDict } from './PerspectiveDataPattern'; import { PerspectiveDataPatternDict } from './PerspectiveDataPattern';

View File

@ -1,4 +1,4 @@
import { import type {
CollectionInfo, CollectionInfo,
ColumnInfo, ColumnInfo,
DatabaseInfo, DatabaseInfo,

View File

@ -1,7 +1,7 @@
import { FormViewDisplay } from './FormViewDisplay'; import { FormViewDisplay } from './FormViewDisplay';
import _ from 'lodash'; import _ from 'lodash';
import { ChangeCacheFunc, DisplayColumn, ChangeConfigFunc } from './GridDisplay'; import { ChangeCacheFunc, DisplayColumn, ChangeConfigFunc } from './GridDisplay';
import { EngineDriver, NamedObjectInfo, DatabaseInfo } from 'dbgate-types'; import type { EngineDriver, NamedObjectInfo, DatabaseInfo } from 'dbgate-types';
import { GridConfig, GridCache } from './GridConfig'; import { GridConfig, GridCache } from './GridConfig';
import { mergeConditions, Condition, OrderByExpression } from 'dbgate-sqltree'; import { mergeConditions, Condition, OrderByExpression } from 'dbgate-sqltree';
import { TableGridDisplay } from './TableGridDisplay'; import { TableGridDisplay } from './TableGridDisplay';

View File

@ -1,7 +1,7 @@
import _ from 'lodash'; import _ from 'lodash';
import { filterName, isTableColumnUnique } from 'dbgate-tools'; import { filterName, isTableColumnUnique } from 'dbgate-tools';
import { GridDisplay, ChangeCacheFunc, DisplayColumn, DisplayedColumnInfo, ChangeConfigFunc } from './GridDisplay'; import { GridDisplay, ChangeCacheFunc, DisplayColumn, DisplayedColumnInfo, ChangeConfigFunc } from './GridDisplay';
import { import type {
TableInfo, TableInfo,
EngineDriver, EngineDriver,
ViewInfo, ViewInfo,

View File

@ -1,6 +1,6 @@
import _ from 'lodash'; import _ from 'lodash';
import { GridDisplay, ChangeCacheFunc, ChangeConfigFunc } from './GridDisplay'; import { GridDisplay, ChangeCacheFunc, ChangeConfigFunc } from './GridDisplay';
import { EngineDriver, ViewInfo, ColumnInfo } from 'dbgate-types'; import type { EngineDriver, ViewInfo, ColumnInfo } from 'dbgate-types';
import { GridConfig, GridCache } from './GridConfig'; import { GridConfig, GridCache } from './GridConfig';
export class ViewGridDisplay extends GridDisplay { export class ViewGridDisplay extends GridDisplay {

View File

@ -1,6 +1,6 @@
import _ from 'lodash'; import _ from 'lodash';
import { Command, Insert, Update, Delete, UpdateField, Condition, AllowIdentityInsert } from 'dbgate-sqltree'; import { Command, Insert, Update, Delete, UpdateField, Condition, AllowIdentityInsert } from 'dbgate-sqltree';
import { NamedObjectInfo, DatabaseInfo, ForeignKeyInfo, TableInfo } from 'dbgate-types'; import type { NamedObjectInfo, DatabaseInfo, ForeignKeyInfo, TableInfo } from 'dbgate-types';
import { ChangeSet, ChangeSetItem, extractChangeSetCondition } from './ChangeSet'; import { ChangeSet, ChangeSetItem, extractChangeSetCondition } from './ChangeSet';
export interface ChangeSetDeleteCascade { export interface ChangeSetDeleteCascade {

View File

@ -1,5 +1,5 @@
import { findForeignKeyForColumn } from 'dbgate-tools'; import { findForeignKeyForColumn } from 'dbgate-tools';
import { DatabaseInfo, TableInfo, ViewInfo } from 'dbgate-types'; import type { DatabaseInfo, TableInfo, ViewInfo } from 'dbgate-types';
import { createPerspectiveNodeConfig, MultipleDatabaseInfo, PerspectiveConfig } from './PerspectiveConfig'; import { createPerspectiveNodeConfig, MultipleDatabaseInfo, PerspectiveConfig } from './PerspectiveConfig';
import { PerspectiveDataPattern, PerspectiveDataPatternDict } from './PerspectiveDataPattern'; import { PerspectiveDataPattern, PerspectiveDataPatternDict } from './PerspectiveDataPattern';
import { PerspectiveTableNode } from './PerspectiveTreeNode'; import { PerspectiveTableNode } from './PerspectiveTreeNode';

View File

@ -1,4 +1,4 @@
import { DatabaseInfo } from 'dbgate-types'; import type { DatabaseInfo } from 'dbgate-types';
export const chinookDbInfo: DatabaseInfo = { export const chinookDbInfo: DatabaseInfo = {
tables: [ tables: [

View File

@ -2,7 +2,7 @@ import P from 'parsimmon';
import moment from 'moment'; import moment from 'moment';
import { FilterType } from './types'; import { FilterType } from './types';
import { Condition } from 'dbgate-sqltree'; import { Condition } from 'dbgate-sqltree';
import { TransformType } from 'dbgate-types'; import type { TransformType } from 'dbgate-types';
import { interpretEscapes, token, word, whitespace } from './common'; import { interpretEscapes, token, word, whitespace } from './common';
const compoudCondition = conditionType => conditions => { const compoudCondition = conditionType => conditions => {

View File

@ -2,7 +2,6 @@ import P from 'parsimmon';
import moment from 'moment'; import moment from 'moment';
import { FilterType } from './types'; import { FilterType } from './types';
import { Condition } from 'dbgate-sqltree'; import { Condition } from 'dbgate-sqltree';
import { TransformType } from 'dbgate-types';
import { interpretEscapes, token, word, whitespace } from './common'; import { interpretEscapes, token, word, whitespace } from './common';
import { mongoParser } from './mongoParser'; import { mongoParser } from './mongoParser';
import { datetimeParser } from './datetimeParser'; import { datetimeParser } from './datetimeParser';

View File

@ -1,4 +1,4 @@
import { SqlDumper } from 'dbgate-types'; import type { SqlDumper } from 'dbgate-types';
import { Command, Select, Update, Delete, Insert } from './types'; import { Command, Select, Update, Delete, Insert } from './types';
import { dumpSqlExpression } from './dumpSqlExpression'; import { dumpSqlExpression } from './dumpSqlExpression';
import { dumpSqlFromDefinition, dumpSqlSourceRef } from './dumpSqlSource'; import { dumpSqlFromDefinition, dumpSqlSourceRef } from './dumpSqlSource';

View File

@ -1,4 +1,4 @@
import { SqlDumper } from 'dbgate-types'; import type { SqlDumper } from 'dbgate-types';
import { Condition, BinaryCondition } from './types'; import { Condition, BinaryCondition } from './types';
import { dumpSqlExpression } from './dumpSqlExpression'; import { dumpSqlExpression } from './dumpSqlExpression';
import { dumpSqlSelect } from './dumpSqlCommand'; import { dumpSqlSelect } from './dumpSqlCommand';

View File

@ -1,5 +1,5 @@
import _ from 'lodash'; import _ from 'lodash';
import { SqlDumper } from 'dbgate-types'; import type { SqlDumper } from 'dbgate-types';
import { Expression, ColumnRefExpression } from './types'; import { Expression, ColumnRefExpression } from './types';
import { dumpSqlSourceRef } from './dumpSqlSource'; import { dumpSqlSourceRef } from './dumpSqlSource';

View File

@ -1,5 +1,5 @@
import { Source, FromDefinition, Relation } from './types'; import { Source, FromDefinition, Relation } from './types';
import { SqlDumper } from 'dbgate-types'; import type { SqlDumper } from 'dbgate-types';
import { dumpSqlSelect } from './dumpSqlCommand'; import { dumpSqlSelect } from './dumpSqlCommand';
import { dumpSqlCondition } from './dumpSqlCondition'; import { dumpSqlCondition } from './dumpSqlCondition';

View File

@ -1,10 +1,6 @@
import { SqlDumper } from 'dbgate-types';
import _ from 'lodash'; import _ from 'lodash';
import { Condition, BinaryCondition } from './types'; import { Condition, BinaryCondition } from './types';
import { dumpSqlExpression } from './dumpSqlExpression';
import { link } from 'fs';
import { evaluateExpression } from './evaluateExpression'; import { evaluateExpression } from './evaluateExpression';
import { cond } from 'lodash';
function isEmpty(value) { function isEmpty(value) {
if (value == null) return true; if (value == null) return true;

View File

@ -1,4 +1,4 @@
import { NamedObjectInfo, RangeDefinition, TransformType } from 'dbgate-types'; import type { NamedObjectInfo, RangeDefinition, TransformType } from 'dbgate-types';
// export interface Command { // export interface Command {
// } // }

View File

@ -1,4 +1,4 @@
import { EngineDriver, SqlDumper } from 'dbgate-types'; import type { EngineDriver, SqlDumper } from 'dbgate-types';
import { Command, Condition } from './types'; import { Command, Condition } from './types';
import { dumpSqlCommand } from './dumpSqlCommand'; import { dumpSqlCommand } from './dumpSqlCommand';

View File

@ -1,5 +1,5 @@
import _ from 'lodash'; import _ from 'lodash';
import { import type {
ColumnInfo, ColumnInfo,
ConstraintInfo, ConstraintInfo,
EngineDriver, EngineDriver,

View File

@ -1,4 +1,4 @@
import { import type {
DatabaseInfo, DatabaseInfo,
EngineDriver, EngineDriver,
FunctionInfo, FunctionInfo,

View File

@ -1,5 +1,5 @@
import { DbDiffOptions, testEqualColumns, testEqualTables, testEqualSqlObjects } from './diffTools'; import { DbDiffOptions, testEqualColumns, testEqualTables, testEqualSqlObjects } from './diffTools';
import { DatabaseInfo, EngineDriver, SqlObjectInfo, TableInfo } from 'dbgate-types'; import type { DatabaseInfo, EngineDriver, SqlObjectInfo, TableInfo } from 'dbgate-types';
import _ from 'lodash'; import _ from 'lodash';
export function computeDiffRowsCore(sourceList, targetList, testEqual) { export function computeDiffRowsCore(sourceList, targetList, testEqual) {

View File

@ -1,4 +1,3 @@
import { EngineDriver } from 'dbgate-types';
import _intersection from 'lodash/intersection'; import _intersection from 'lodash/intersection';
import { prepareTableForImport } from './tableTransforms'; import { prepareTableForImport } from './tableTransforms';

View File

@ -1,4 +1,4 @@
import { import type {
ColumnInfo, ColumnInfo,
ConstraintInfo, ConstraintInfo,
DatabaseInfo, DatabaseInfo,

View File

@ -1,6 +1,6 @@
import _cloneDeep from 'lodash/cloneDeep'; import _cloneDeep from 'lodash/cloneDeep';
import _isString from 'lodash/isString'; import _isString from 'lodash/isString';
import { import type {
ColumnInfo, ColumnInfo,
ColumnReference, ColumnReference,
DatabaseInfo, DatabaseInfo,

View File

@ -1,4 +1,4 @@
import { EngineDriver, ExtensionsDirectory } from 'dbgate-types'; import type { EngineDriver, ExtensionsDirectory } from 'dbgate-types';
import _camelCase from 'lodash/camelCase'; import _camelCase from 'lodash/camelCase';
import _isString from 'lodash/isString'; import _isString from 'lodash/isString';
import _isPlainObject from 'lodash/isPlainObject'; import _isPlainObject from 'lodash/isPlainObject';

View File

@ -1,5 +1,5 @@
import _ from 'lodash'; import _ from 'lodash';
import { DatabaseInfo, EngineDriver } from 'dbgate-types'; import type { DatabaseInfo, EngineDriver } from 'dbgate-types';
export async function enrichWithPreloadedRows( export async function enrichWithPreloadedRows(
dbModel: DatabaseInfo, dbModel: DatabaseInfo,

View File

@ -1,6 +1,6 @@
import uuidv1 from 'uuid/v1'; import uuidv1 from 'uuid/v1';
import _omit from 'lodash/omit'; import _omit from 'lodash/omit';
import { import type {
ColumnInfo, ColumnInfo,
ConstraintInfo, ConstraintInfo,
ForeignKeyInfo, ForeignKeyInfo,

View File

@ -1,4 +1,4 @@
import { DatabaseInfo, TableInfo, ApplicationDefinition, ViewInfo, CollectionInfo } from 'dbgate-types'; import type { DatabaseInfo, TableInfo, ApplicationDefinition, ViewInfo, CollectionInfo } from 'dbgate-types';
import _flatten from 'lodash/flatten'; import _flatten from 'lodash/flatten';
export function addTableDependencies(db: DatabaseInfo): DatabaseInfo { export function addTableDependencies(db: DatabaseInfo): DatabaseInfo {

View File

@ -1,4 +1,4 @@
import { TableInfo } from 'dbgate-types'; import type { TableInfo } from 'dbgate-types';
import _cloneDeep from 'lodash/cloneDeep'; import _cloneDeep from 'lodash/cloneDeep';
import _fromPairs from 'lodash/fromPairs'; import _fromPairs from 'lodash/fromPairs';
import _get from 'lodash/get'; import _get from 'lodash/get';

View File

@ -29,7 +29,7 @@
$: currentThemeType = $currentThemeDefinition?.themeType == 'dark' ? 'theme-type-dark' : 'theme-type-light'; $: currentThemeType = $currentThemeDefinition?.themeType == 'dark' ? 'theme-type-dark' : 'theme-type-light';
$: themeStyle = `<style id="themePlugin">${$currentThemeDefinition?.themeCss}</style>`; $: themeStyle = `<st` + `yle id="themePlugin">${$currentThemeDefinition?.themeCss}</st` + `yle>`;
const isElectron = !!getElectron(); const isElectron = !!getElectron();
</script> </script>

View File

@ -16,7 +16,7 @@
tabComponent, tabComponent,
tooltip, tooltip,
props: { props: {
savedFile:fileName + '.' + fileType, savedFile: fileName + '.' + fileType,
savedFolder: 'app:' + folderName, savedFolder: 'app:' + folderName,
savedFormat: 'text', savedFormat: 'text',
appFolder: folderName, appFolder: folderName,
@ -28,7 +28,10 @@
} }
export const extractKey = data => data.fileName; export const extractKey = data => data.fileName;
export const createMatcher = ({ fileName }) => filter => filterName(filter, fileName); export const createMatcher =
({ fileName }) =>
filter =>
filterName(filter, fileName);
const APP_ICONS = { const APP_ICONS = {
'config.json': 'img json', 'config.json': 'img json',
'command.sql': 'img app-command', 'command.sql': 'img app-command',
@ -50,7 +53,6 @@
import InputTextModal from '../modals/InputTextModal.svelte'; import InputTextModal from '../modals/InputTextModal.svelte';
import ConfirmModal from '../modals/ConfirmModal.svelte'; import ConfirmModal from '../modals/ConfirmModal.svelte';
import { apiCall } from '../utility/api'; import { apiCall } from '../utility/api';
import { currentDatabase, currentDatabase } from '../stores';
export let data; export let data;

View File

@ -1,5 +1,5 @@
import { dumpSqlSelect, Select } from 'dbgate-sqltree'; import type { Select } from 'dbgate-sqltree';
import { EngineDriver } from 'dbgate-types'; import type { EngineDriver } from 'dbgate-types';
import _ from 'lodash'; import _ from 'lodash';
import { apiCall } from '../utility/api'; import { apiCall } from '../utility/api';

View File

@ -1,6 +1,6 @@
import { tick } from 'svelte'; import { tick } from 'svelte';
import { commands } from '../stores'; import { commands } from '../stores';
import { GlobalCommand } from './registerCommand'; import type { GlobalCommand } from './registerCommand';
let isInvalidated = false; let isInvalidated = false;

View File

@ -1,7 +1,5 @@
import _ from 'lodash'; import _ from 'lodash';
import { dumpSqlSelect, Select, JoinType, Condition, Relation, mergeConditions, Source } from 'dbgate-sqltree'; import type { DesignerInfo, DesignerTableInfo, DesignerReferenceInfo, DesignerJoinType } from './types';
import { EngineDriver } from 'dbgate-types';
import { DesignerInfo, DesignerTableInfo, DesignerReferenceInfo, DesignerJoinType } from './types';
import { findPrimaryTable, findConnectingReference, referenceIsJoin, referenceIsExists } from './designerTools'; import { findPrimaryTable, findConnectingReference, referenceIsJoin, referenceIsExists } from './designerTools';
export class DesignerComponent { export class DesignerComponent {

View File

@ -10,7 +10,6 @@ import {
ResultField, ResultField,
Expression, Expression,
} from 'dbgate-sqltree'; } from 'dbgate-sqltree';
import { EngineDriver } from 'dbgate-types';
import { DesignerInfo, DesignerTableInfo, DesignerReferenceInfo, DesignerJoinType } from './types'; import { DesignerInfo, DesignerTableInfo, DesignerReferenceInfo, DesignerJoinType } from './types';
import { DesignerComponent } from './DesignerComponentCreator'; import { DesignerComponent } from './DesignerComponentCreator';
import { import {

View File

@ -1,7 +1,8 @@
import _ from 'lodash'; import _ from 'lodash';
import { dumpSqlSelect, Select, JoinType, Condition, Relation, mergeConditions, Source } from 'dbgate-sqltree'; import type { Select, Condition, Source } from 'dbgate-sqltree';
import { EngineDriver } from 'dbgate-types'; import { dumpSqlSelect, mergeConditions } from 'dbgate-sqltree';
import { DesignerInfo, DesignerTableInfo, DesignerReferenceInfo, DesignerJoinType } from './types'; import type { EngineDriver } from 'dbgate-types';
import type { DesignerInfo, DesignerTableInfo, DesignerReferenceInfo, DesignerJoinType } from './types';
import { DesignerComponentCreator } from './DesignerComponentCreator'; import { DesignerComponentCreator } from './DesignerComponentCreator';
import { DesignerQueryDumper } from './DesignerQueryDumper'; import { DesignerQueryDumper } from './DesignerQueryDumper';
import { getFilterType } from 'dbgate-filterparser'; import { getFilterType } from 'dbgate-filterparser';

View File

@ -1,5 +1,5 @@
import { JoinType } from 'dbgate-sqltree'; import type { JoinType } from 'dbgate-sqltree';
import { TableInfo } from 'dbgate-types'; import type { TableInfo } from 'dbgate-types';
export type DesignerTableInfo = TableInfo & { export type DesignerTableInfo = TableInfo & {
designerId: string; designerId: string;

View File

@ -23,7 +23,7 @@
{:else} {:else}
<span class="null"> (no image)</span> <span class="null"> (no image)</span>
{/if} {/if}
{:else if !value.$oid && (_.isArray(value) || _.isPlainObject(value))} {:else if !value?.$oid && (_.isArray(value) || _.isPlainObject(value))}
<JSONTree {value} slicedKeyCount={1} disableContextMenu /> <JSONTree {value} slicedKeyCount={1} disableContextMenu />
{:else} {:else}
<CellValue {rowData} {value} /> <CellValue {rowData} {value} />

View File

@ -8,7 +8,7 @@
PerspectiveTreeNode, PerspectiveTreeNode,
switchPerspectiveReferenceDirection, switchPerspectiveReferenceDirection,
} from 'dbgate-datalib'; } from 'dbgate-datalib';
import { CollectionInfo } from 'dbgate-types'; import type { CollectionInfo } from 'dbgate-types';
import _ from 'lodash'; import _ from 'lodash';
import { tick } from 'svelte'; import { tick } from 'svelte';
import runCommand from '../commands/runCommand'; import runCommand from '../commands/runCommand';

View File

@ -1,4 +1,4 @@
import { FileFormatDefinition, QuickExportDefinition } from 'dbgate-types'; import type { FileFormatDefinition, QuickExportDefinition } from 'dbgate-types';
const jsonlFormat = { const jsonlFormat = {
storageType: 'jsonl', storageType: 'jsonl',

View File

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import { ThemeDefinition } from 'dbgate-types'; import type { ThemeDefinition } from 'dbgate-types';
import FontIcon from '../icons/FontIcon.svelte'; import FontIcon from '../icons/FontIcon.svelte';
import { currentTheme } from '../stores'; import { currentTheme } from '../stores';
import _ from 'lodash'; import _ from 'lodash';

View File

@ -1,5 +1,5 @@
import { writable, derived, readable } from 'svelte/store'; import { writable, derived, readable } from 'svelte/store';
import { ExtensionsDirectory } from 'dbgate-types'; import type { ExtensionsDirectory } from 'dbgate-types';
import invalidateCommands from './commands/invalidateCommands'; import invalidateCommands from './commands/invalidateCommands';
import getElectron from './utility/getElectron'; import getElectron from './utility/getElectron';
import { getSettings, useConfig, useSettings } from './utility/metadataLoaders'; import { getSettings, useConfig, useSettings } from './utility/metadataLoaders';

View File

@ -1,4 +1,4 @@
import { ApplicationDefinition, StoredConnection } from 'dbgate-types'; import type { ApplicationDefinition, StoredConnection } from 'dbgate-types';
import { apiCall } from '../utility/api'; import { apiCall } from '../utility/api';
export async function saveDbToApp(conid: string, database: string, app: string) { export async function saveDbToApp(conid: string, database: string, app: string) {

View File

@ -1,4 +1,4 @@
import { QuickExportDefinition } from 'dbgate-types'; import type { QuickExportDefinition } from 'dbgate-types';
import { getExtensions } from '../stores'; import { getExtensions } from '../stores';
export function createQuickExportMenuItems(handler: (fmt: QuickExportDefinition) => Function, advancedExportMenuItem) { export function createQuickExportMenuItems(handler: (fmt: QuickExportDefinition) => Function, advancedExportMenuItem) {

View File

@ -1,5 +1,5 @@
import { DictionaryDescription } from 'dbgate-datalib'; import { DictionaryDescription } from 'dbgate-datalib';
import { ApplicationDefinition, TableInfo } from 'dbgate-types'; import type { ApplicationDefinition, TableInfo } from 'dbgate-types';
import _ from 'lodash'; import _ from 'lodash';
import { apiCall } from './api'; import { apiCall } from './api';
import { filterAppsForDatabase, saveDbToApp } from './appTools'; import { filterAppsForDatabase, saveDbToApp } from './appTools';

View File

@ -1,8 +1,6 @@
import _ from 'lodash'; import _ from 'lodash';
import { loadCachedValue, subscribeCacheChange, unsubscribeCacheChange } from './cache'; import { loadCachedValue, subscribeCacheChange, unsubscribeCacheChange } from './cache';
import stableStringify from 'json-stable-stringify'; import stableStringify from 'json-stable-stringify';
import getAsArray from './getAsArray';
import { DatabaseInfo } from 'dbgate-types';
import { derived } from 'svelte/store'; import { derived } from 'svelte/store';
import { extendDatabaseInfo } from 'dbgate-tools'; import { extendDatabaseInfo } from 'dbgate-tools';
import { setLocalStorage } from '../utility/storageCache'; import { setLocalStorage } from '../utility/storageCache';

View File

@ -48,16 +48,17 @@ const driver = {
...driverBase, ...driverBase,
analyserClass: Analyser, analyserClass: Analyser,
async connect({ server, port, user, password, database, useDatabaseUrl, databaseUrl, ssl }) { async connect({ server, port, user, password, database, useDatabaseUrl, databaseUrl, ssl }) {
// let mongoUrl = databaseUrl; let mongoUrl;
// if (!useDatabaseUrl) { if (useDatabaseUrl) {
// mongoUrl = user ? `mongodb://${user}:${password}@${server}:${port}` : `mongodb://${server}:${port}`; // change port to ssh tunnel port
// if (database) mongoUrl += '/' + database; const url = new URL(databaseUrl);
// } url.port = port;
const mongoUrl = useDatabaseUrl mongoUrl = url.href;
? databaseUrl } else {
: user mongoUrl = user
? `mongodb://${user}:${password}@${server}:${port}` ? `mongodb://${user}:${password}@${server}:${port}`
: `mongodb://${server}:${port}`; : `mongodb://${server}:${port}`;
}
const options = { const options = {
useUnifiedTopology: true, useUnifiedTopology: true,