Merge branch 'master' into tableeditor2

This commit is contained in:
Jan Prochazka
2021-06-24 09:44:05 +02:00
19 changed files with 55 additions and 16 deletions

View File

@@ -1,5 +1,10 @@
# ChangeLog
### 4.2.5
- FIXED: Fixed crash when using large model on some installations
- FIXED: Postgre SQL CREATE function
- FIXED: Analysing of MySQL when modifyDate is not known
### 4.2.4
- ADDED: Query history
- ADDED: One-click exports in desktop app

BIN
app/icons/128x128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
app/icons/16x16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
app/icons/256x256.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
app/icons/32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
app/icons/48x48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
app/icons/512x512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

BIN
app/icons/64x64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@@ -45,7 +45,7 @@
]
}
],
"icon": "icon.png",
"icon": "icons/",
"category": "Development",
"synopsis": "Database manager for SQL Server, MySQL, PostgreSQL, MongoDB and SQLite",
"publish": [
@@ -103,4 +103,4 @@
"optionalDependencies": {
"msnodesqlv8": "^2.0.10"
}
}
}

View File

@@ -54,6 +54,13 @@ const engines = [
drop1: 'DROP PROCEDURE obj1',
drop2: 'DROP PROCEDURE obj2',
},
{
type: 'functions',
create1: 'CREATE FUNCTION obj1() returns int LANGUAGE plpgsql AS $$ declare res integer; begin select count(*) into res from t1; return res; end; $$',
create2: 'CREATE FUNCTION obj2() returns int LANGUAGE plpgsql AS $$ declare res integer; begin select count(*) into res from t2; return res; end; $$',
drop1: 'DROP FUNCTION obj1',
drop2: 'DROP FUNCTION obj2',
},
],
},
{

View File

@@ -1,6 +1,6 @@
{
"private": true,
"version": "4.2.5-beta.2",
"version": "4.2.6-beta.1",
"name": "dbgate-all",
"workspaces": [
"packages/*",

View File

@@ -52,7 +52,7 @@
</div>
{/if}
{#each filtered as item (module.extractKey(item.data))}
{#each filtered as item}
<AppObjectListItem
{...$$restProps}
{module}

View File

@@ -66,8 +66,6 @@
import _ from 'lodash';
import registerCommand from '../commands/registerCommand';
import { registerMenu } from '../utility/contextMenu';
import { useSettings } from '../utility/metadataLoaders';
import { getCurrentSettings } from '../stores';
import { getBoolSettingsValue } from '../settings/settingsTools';
export let config;

View File

@@ -13,6 +13,18 @@
}
const dateTimeRegex = /^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d(\.\d\d\d)?Z?$/;
function formatNumber(value) {
if (value >= 10000 || value <= -10000) {
if (getBoolSettingsValue('dataGrid.thousandsSeparator', false)) {
return value.toLocaleString();
} else {
return value.toString();
}
}
return value.toString();
}
</script>
<script lang="ts">
@@ -20,6 +32,7 @@
import _ from 'lodash';
import { isTypeLogical } from 'dbgate-tools';
import ShowFormButton from '../formview/ShowFormButton.svelte';
import { getBoolSettingsValue } from '../settings/settingsTools';
export let rowIndex;
export let col;
@@ -80,16 +93,10 @@
0
{/if}
{:else if _.isNumber(value)}
{#if value >= 10000 || value <= -10000}
{#if isDynamicStructure}
<span class="value">{value.toLocaleString()}</span>
{:else}
{value.toLocaleString()}
{/if}
{:else if isDynamicStructure}
<span class="value">{value.toString()}</span>
{#if isDynamicStructure}
<span class="value">{formatNumber(value)}</span>
{:else}
{value.toString()}
{formatNumber(value)}
{/if}
{:else if _.isString(value)}
{#if dateTimeRegex.test(value)}

View File

@@ -46,6 +46,8 @@
/>
<FormCheckboxField name="dataGrid.showHintColumns" label="Show foreign key hints" defaultValue={true} />
<FormCheckboxField name="dataGrid.thousandsSeparator" label="Use thounds separator for numbers" />
<div class="heading">Connection</div>
<FormCheckboxField
name="connection.autoRefresh"

View File

@@ -1,3 +1,17 @@
<script lang="ts" context="module">
function generateObjectList(seed = 0) {
const counts = [1000, 1200, 1100, 2100, 720];
const schemas = ['A', 'dev', 'public', 'dbo'];
const types = ['tables', 'views', 'functions', 'procedures', 'matviews', 'triggers'];
const res = _.range(1, counts[seed % counts.length]).map(i => ({
pureName: `name ${i}`,
schemaName: schemas[i % schemas.length],
objectTypeField: types[i % types.length],
}));
return res;
}
</script>
<script lang="ts">
import InlineButton from '../elements/InlineButton.svelte';
import SearchInput from '../elements/SearchInput.svelte';
@@ -33,6 +47,10 @@
)
);
// let generateIndex = 0;
// setInterval(() => (generateIndex += 1), 2000);
// $: objectList = generateObjectList(generateIndex);
const handleRefreshDatabase = () => {
axiosInstance.post('database-connections/refresh', { conid, database });
};

View File

@@ -6,7 +6,7 @@ const Analyser = require('./Analyser');
const MongoClient = require('mongodb').MongoClient;
const ObjectId = require('mongodb').ObjectId;
const Cursor = require('mongodb').Cursor;
const { createBulkInsertStream } = require('./createBulkInsertStream');
const createBulkInsertStream = require('./createBulkInsertStream');
function readCursor(cursor, options) {
return new Promise((resolve) => {

View File

@@ -139,6 +139,7 @@ class Analyser extends DatabaseAnalyser {
.filter(x => x.object_type == 'FUNCTION')
.map(func => ({
objectId: `functions:${func.schema_name}.${func.pure_name}`,
createSql: `CREATE FUNCTION "${func.schema_name}"."${func.pure_name}"() RETURNS ${func.data_type} LANGUAGE ${func.language}\nAS\n$$\n${func.definition}\n$$`,
pureName: func.pure_name,
schemaName: func.schema_name,
contentHash: func.hash_code,

View File

@@ -5,6 +5,7 @@ select
routine_definition as "definition",
md5(routine_definition) as "hash_code",
routine_type as "object_type",
data_type as "data_type",
external_language as "language"
from
information_schema.routines where routine_schema != 'information_schema' and routine_schema != 'pg_catalog'