Compare commits
61 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ba65704d55 | |||
| 68f77d4ed7 | |||
| 008f6be6ac | |||
| 7324cef87a | |||
| 471fcdc131 | |||
| c2abc83f99 | |||
| a23bda7294 | |||
| a2d643305b | |||
| dd36427a80 | |||
| 9b4683ef53 | |||
| a24271f045 | |||
| f74e57bec2 | |||
| 4fb6b49b86 | |||
| 72c380cef5 | |||
| 39cdaf88f4 | |||
| 52c77031c5 | |||
| fdabe1eeaa | |||
| 4429b1d618 | |||
| 5c24774170 | |||
| 792be82acd | |||
| 6e3cd08d8a | |||
| 696d870c2f | |||
| 26471517a9 | |||
| 58233a2fd5 | |||
| 230948c4b4 | |||
| df593074c2 | |||
| 474ecb1b71 | |||
| e8e5781b59 | |||
| a042ff363e | |||
| 63bdf817c6 | |||
| 82eed3b86e | |||
| 21a24f9ba2 | |||
| 550354fe09 | |||
| e14e7efa1a | |||
| b1cf418058 | |||
| bde4127b33 | |||
| e981cb2734 | |||
| 6f4c0edb46 | |||
| 6591e45a6e | |||
| 397a6b54ff | |||
| 51555da376 | |||
| 8e6b1973c7 | |||
| 5a8627c39f | |||
| 26a46d9037 | |||
| b9a974ca27 | |||
| e4ed163723 | |||
| 4d8c62f3f5 | |||
| 4b2e28483b | |||
| 3cd070e211 | |||
| 1e818e7756 | |||
| 91efb7abda | |||
| 5659311ba2 | |||
| 232031ff5b | |||
| 0e242321ed | |||
| 83f3391b24 | |||
| 715c6f7f29 | |||
| 0fc20f7238 | |||
| c824e32f0a | |||
| 10a916bce6 | |||
| 1080147085 | |||
| f0ebe260e2 |
@@ -23,10 +23,10 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Use Node.js 16.x
|
||||
- name: Use Node.js 18.x
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16.x
|
||||
node-version: 18.x
|
||||
- name: yarn adjustPackageJson
|
||||
run: |
|
||||
yarn adjustPackageJson
|
||||
@@ -63,6 +63,7 @@ jobs:
|
||||
CSC_KEY_PASSWORD: ${{ secrets.APPLECERT_PASSWORD }}
|
||||
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
||||
|
||||
- name: publishSnap
|
||||
@@ -88,6 +89,7 @@ jobs:
|
||||
|
||||
mv app/dist/*.exe artifacts/ || true
|
||||
mv app/dist/*.zip artifacts/ || true
|
||||
mv app/dist/*.tar.gz artifacts/ || true
|
||||
mv app/dist/*.AppImage artifacts/ || true
|
||||
mv app/dist/*.deb artifacts/ || true
|
||||
mv app/dist/*.snap artifacts/ || true
|
||||
|
||||
@@ -27,10 +27,10 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Use Node.js 16.x
|
||||
- name: Use Node.js 18.x
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16.x
|
||||
node-version: 18.x
|
||||
- name: yarn adjustPackageJson
|
||||
run: |
|
||||
yarn adjustPackageJson
|
||||
@@ -69,6 +69,7 @@ jobs:
|
||||
CSC_KEY_PASSWORD: ${{ secrets.APPLECERT_PASSWORD }}
|
||||
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
||||
|
||||
- name: generatePadFile
|
||||
@@ -98,6 +99,7 @@ jobs:
|
||||
|
||||
mv app/dist/*.exe artifacts/ || true
|
||||
mv app/dist/*.zip artifacts/ || true
|
||||
mv app/dist/*.tar.gz artifacts/ || true
|
||||
mv app/dist/*.AppImage artifacts/ || true
|
||||
mv app/dist/*.deb artifacts/ || true
|
||||
mv app/dist/*.dmg artifacts/ || true
|
||||
|
||||
@@ -53,10 +53,10 @@ jobs:
|
||||
type=match,pattern=\d+.\d+.\d+,suffix=-alpine,enable=${{ !contains(github.ref_name, '-docker.') && !contains(github.ref_name, '-beta.') }}
|
||||
type=raw,value=alpine,enable=${{ !contains(github.ref_name, '-docker.') && !contains(github.ref_name, '-beta.') }}
|
||||
|
||||
- name: Use Node.js 16.x
|
||||
- name: Use Node.js 18.x
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16.x
|
||||
node-version: 18.x
|
||||
- name: yarn install
|
||||
run: |
|
||||
# yarn --version
|
||||
|
||||
@@ -30,10 +30,10 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Use Node.js 16.x
|
||||
- name: Use Node.js 18.x
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16.x
|
||||
node-version: 18.x
|
||||
|
||||
- name: Configure NPM token
|
||||
env:
|
||||
|
||||
@@ -8,7 +8,7 @@ on:
|
||||
jobs:
|
||||
test-runner:
|
||||
runs-on: ubuntu-latest
|
||||
container: node:16.20
|
||||
container: node:18
|
||||
|
||||
steps:
|
||||
- name: Context
|
||||
|
||||
@@ -8,6 +8,24 @@ Builds:
|
||||
- linux - application for linux
|
||||
- win - application for Windows
|
||||
|
||||
### Not released (5.2.8)
|
||||
- FIXED: file menu save and save as not working
|
||||
- FIXED: query editor on import/export screen overlaps with selector
|
||||
- FIXED: Fixed inconsistencies in max/unmaximize window buttons
|
||||
- FIXED: shortcut for select all
|
||||
- FIXED: download with auth header
|
||||
- CHANGED: Upgraded database drivers for mysql, postgres, sqlite, mssql, mongo, redis
|
||||
- CHANGED: Upgraded electron version (now using v30)
|
||||
- ADDED: Vim keyboard bindings for editor
|
||||
- FIXED: Correctly select the save folder for dump
|
||||
- ADDED: enum + set for mysql (#693)
|
||||
- FIXED: localStorageGabageCollector not working
|
||||
- FIXED: Encoding error when opening Unicode query files
|
||||
- ADDED: Add copy/paste to query tab and database list
|
||||
- ADDED: Add copy name to table list
|
||||
- FIXED: Make TabControl scrollable (#730)
|
||||
- ADDED: Add copy to column list
|
||||
|
||||
### 5.2.7
|
||||
- FIXED: fix body overflow when context menu height great than viewport #592
|
||||
- FIXED: Pass signals in entrypoint.sh #596
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>org.dbgate.DbGate</id>
|
||||
|
||||
<name>DbGate</name>
|
||||
<summary>(no)SQL database client</summary>
|
||||
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>MIT</project_license>
|
||||
<developer_name>Jan Prochazka</developer_name>
|
||||
|
||||
<description>
|
||||
<p>DbGate is cross-platform database manager. It's designed to be simple to use and effective, when working with more databases simultaneously. But there are also many advanced features like schema compare, visual query designer, chart visualisation or batch export and import.</p>
|
||||
</description>
|
||||
|
||||
<url type="homepage">https://dbgate.org/</url>
|
||||
<url type="vcs-browser">https://github.com/dbgate/dbgate</url>
|
||||
<url type="contact">https://dbgate.org/about/</url>
|
||||
<url type="donation">https://github.com/sponsors/dbgate</url>
|
||||
<url type="bugtracker">https://github.com/dbgate/dbgate/issues</url>
|
||||
|
||||
<launchable type="desktop-id">org.dbgate.DbGate.desktop</launchable>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>
|
||||
https://github.com/dbgate/dbgate/raw/c2abc83f994a56945c27fccea3df84b48005961f/img/screenshot1.png</image>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>
|
||||
https://github.com/dbgate/dbgate/raw/c2abc83f994a56945c27fccea3df84b48005961f/img/screenshot2.png</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
|
||||
<content_rating type="oars-1.1"/>
|
||||
|
||||
<releases>
|
||||
<release version="5.2.7" date="2024-05-13"/>
|
||||
</releases>
|
||||
</component>
|
||||
+6
-5
@@ -48,7 +48,8 @@
|
||||
"armv7l",
|
||||
"arm64"
|
||||
]
|
||||
}
|
||||
},
|
||||
"tar.gz"
|
||||
],
|
||||
"icon": "icons/",
|
||||
"category": "Development",
|
||||
@@ -114,13 +115,13 @@
|
||||
"devDependencies": {
|
||||
"copyfiles": "^2.2.0",
|
||||
"cross-env": "^6.0.3",
|
||||
"electron": "17.4.10",
|
||||
"electron": "30.0.2",
|
||||
"electron-builder": "23.1.0",
|
||||
"electron-builder-notarize": "^1.5.1"
|
||||
"electron-builder-notarize": "^1.5.2"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"better-sqlite3": "7.6.2",
|
||||
"msnodesqlv8": "^2.6.0",
|
||||
"better-sqlite3": "9.6.0",
|
||||
"msnodesqlv8": "^4.2.1",
|
||||
"oracledb": "^5.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -27,6 +27,10 @@ let mainModule;
|
||||
// let getLogger;
|
||||
// let loadLogsContent;
|
||||
|
||||
process.on('uncaughtException', function (error) {
|
||||
console.error('uncaughtException', error);
|
||||
});
|
||||
|
||||
const isMac = () => os.platform() == 'darwin';
|
||||
|
||||
// unhandled({
|
||||
|
||||
+459
-340
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -11,8 +11,8 @@ RUN apt-get update && apt-get install -y \
|
||||
make
|
||||
|
||||
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource-archive-keyring.gpg \
|
||||
&& echo "deb [signed-by=/usr/share/keyrings/nodesource-archive-keyring.gpg] https://deb.nodesource.com/node_16.x jammy main" | tee /etc/apt/sources.list.d/nodesource.list \
|
||||
&& echo "deb-src [signed-by=/usr/share/keyrings/nodesource-archive-keyring.gpg] https://deb.nodesource.com/node_16.x jammy main" | tee -a /etc/apt/sources.list.d/nodesource.list \
|
||||
&& echo "deb [signed-by=/usr/share/keyrings/nodesource-archive-keyring.gpg] https://deb.nodesource.com/node_18.x jammy main" | tee /etc/apt/sources.list.d/nodesource.list \
|
||||
&& echo "deb-src [signed-by=/usr/share/keyrings/nodesource-archive-keyring.gpg] https://deb.nodesource.com/node_18.x jammy main" | tee -a /etc/apt/sources.list.d/nodesource.list \
|
||||
&& apt-get update && apt-get install -y nodejs \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& npm install -g yarn
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM node:14-alpine
|
||||
FROM node:18-alpine
|
||||
|
||||
WORKDIR /home/dbgate-docker
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"version": "5.2.8-beta.7",
|
||||
"version": "5.2.8",
|
||||
"name": "dbgate-all",
|
||||
"workspaces": [
|
||||
"packages/*",
|
||||
|
||||
@@ -79,12 +79,12 @@
|
||||
"node-loader": "^1.0.2",
|
||||
"nodemon": "^2.0.2",
|
||||
"typescript": "^4.4.3",
|
||||
"webpack": "^4.42.0",
|
||||
"webpack-cli": "^3.3.11"
|
||||
"webpack": "^5.91.0",
|
||||
"webpack-cli": "^5.1.4"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"better-sqlite3": "7.6.2",
|
||||
"msnodesqlv8": "^2.6.0",
|
||||
"better-sqlite3": "9.6.0",
|
||||
"msnodesqlv8": "^4.2.1",
|
||||
"oracledb": "^5.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ module.exports = {
|
||||
return { error: 'Logins not configured' };
|
||||
}
|
||||
const foundLogin = logins.find(x => x.login == login);
|
||||
if (foundLogin && foundLogin.password == password) {
|
||||
if (foundLogin && foundLogin.password && foundLogin.password == password) {
|
||||
return {
|
||||
accessToken: jwt.sign({ login }, tokenSecret, { expiresIn: getTokenLifetime() }),
|
||||
};
|
||||
|
||||
@@ -88,6 +88,7 @@ function getPortalCollections() {
|
||||
sslCertFilePassword: process.env[`SSL_CERT_FILE_PASSWORD_${id}`],
|
||||
sslKeyFile: process.env[`SSL_KEY_FILE_${id}`],
|
||||
sslRejectUnauthorized: process.env[`SSL_REJECT_UNAUTHORIZED_${id}`],
|
||||
trustServerCertificate: process.env[`SSL_TRUST_CERTIFICATE_${id}`],
|
||||
}));
|
||||
|
||||
logger.info({ connections: connections.map(pickSafeConnectionInfo) }, 'Using connections from ENV variables');
|
||||
|
||||
@@ -48,7 +48,7 @@ function start() {
|
||||
if (logins && process.env.BASIC_AUTH) {
|
||||
app.use(
|
||||
basicAuth({
|
||||
users: _.fromPairs(logins.map(x => [x.login, x.password])),
|
||||
users: _.fromPairs(logins.filter(x => x.password).map(x => [x.login, x.password])),
|
||||
challenge: true,
|
||||
realm: 'DbGate Web App',
|
||||
})
|
||||
|
||||
@@ -39,7 +39,7 @@ function getLogins() {
|
||||
permissions: process.env.PERMISSIONS,
|
||||
});
|
||||
}
|
||||
if (process.env.LOGINS) {
|
||||
if (process.env.LOGINS || process.env.OAUTH_PERMISSIONS) {
|
||||
const logins = _.compact(process.env.LOGINS.split(',').map(x => x.trim()));
|
||||
for (const login of logins) {
|
||||
const password = process.env[`LOGIN_PASSWORD_${login}`];
|
||||
@@ -51,6 +51,13 @@ function getLogins() {
|
||||
permissions,
|
||||
});
|
||||
}
|
||||
if (process.env.OAUTH_PERMISSIONS) {
|
||||
res.push({
|
||||
login,
|
||||
password: null,
|
||||
permissions,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,10 @@ import type { DatabaseInfo, TableInfo, ApplicationDefinition, ViewInfo, Collecti
|
||||
import _flatten from 'lodash/flatten';
|
||||
|
||||
export function addTableDependencies(db: DatabaseInfo): DatabaseInfo {
|
||||
if (!db.tables) {
|
||||
return db;
|
||||
}
|
||||
|
||||
const allForeignKeys = _flatten(db.tables.map(x => x.foreignKeys || []));
|
||||
return {
|
||||
...db,
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"@rollup/plugin-typescript": "^8.2.5",
|
||||
"@tsconfig/svelte": "^1.0.0",
|
||||
"ace-builds": "^1.4.8",
|
||||
"chart.js": "^3.6.0",
|
||||
"chart.js": "^4.4.2",
|
||||
"chartjs-adapter-moment": "^1.0.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"dbgate-datalib": "^5.0.0-alpha.1",
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
return [
|
||||
{ text: 'Rename column', onClick: handleRenameColumn },
|
||||
{ text: 'Drop column', onClick: handleDropColumn },
|
||||
{ text: 'Copy name', onClick: () => navigator.clipboard.writeText(data.columnName)},
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<script lang="ts" context="module">
|
||||
import {copyTextToClipboard} from "../utility/clipboard";
|
||||
|
||||
export const extractKey = props => props.name;
|
||||
|
||||
export function disconnectDatabaseConnection(conid, database, showConfirmation = true) {
|
||||
@@ -169,6 +171,10 @@
|
||||
);
|
||||
};
|
||||
|
||||
const handleCopyName = async () => {
|
||||
copyTextToClipboard(name);
|
||||
}
|
||||
|
||||
const handleDisconnect = () => {
|
||||
disconnectDatabaseConnection(connection._id, name);
|
||||
};
|
||||
@@ -295,6 +301,7 @@
|
||||
!connection.isReadOnly &&
|
||||
!connection.singleDatabase && { onClick: handleDropDatabase, text: 'Drop database' },
|
||||
{ divider: true },
|
||||
driver?.databaseEngineTypes?.includes('sql') && { onClick: handleCopyName, text: 'Copy database name' },
|
||||
driver?.databaseEngineTypes?.includes('sql') && { onClick: handleShowDiagram, text: 'Show diagram' },
|
||||
driver?.databaseEngineTypes?.includes('sql') && { onClick: handleSqlGenerator, text: 'SQL Generator' },
|
||||
driver?.supportsDatabaseProfiler && { onClick: handleDatabaseProfiler, text: 'Database profiler' },
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<script lang="ts" context="module">
|
||||
import {copyTextToClipboard} from "../utility/clipboard";
|
||||
|
||||
export const extractKey = ({ schemaName, pureName }) => (schemaName ? `${schemaName}.${pureName}` : pureName);
|
||||
export const createMatcher =
|
||||
({ schemaName, pureName, columns }) =>
|
||||
@@ -80,6 +82,11 @@
|
||||
isTruncate: true,
|
||||
requiresWriteAccess: true,
|
||||
},
|
||||
{
|
||||
label: 'Copy table name',
|
||||
isCopyTableName: true,
|
||||
requiresWriteAccess: false
|
||||
},
|
||||
{
|
||||
label: 'Create table backup',
|
||||
isDuplicateTable: true,
|
||||
@@ -511,6 +518,8 @@
|
||||
saveScriptToDatabase(dbid, `db.dropCollection('${data.pureName}')`);
|
||||
},
|
||||
});
|
||||
} else if (menu.isCopyTableName) {
|
||||
copyTextToClipboard(data.pureName);
|
||||
} else if (menu.isRenameCollection) {
|
||||
showModal(InputTextModal, {
|
||||
label: 'New collection name',
|
||||
|
||||
@@ -575,6 +575,7 @@ export function registerFileCommands({
|
||||
findReplace = false,
|
||||
undoRedo = false,
|
||||
executeAdditionalCondition = null,
|
||||
copyPaste = false,
|
||||
}) {
|
||||
if (save) {
|
||||
registerCommand({
|
||||
@@ -645,6 +646,25 @@ export function registerFileCommands({
|
||||
});
|
||||
}
|
||||
|
||||
if (copyPaste) {
|
||||
registerCommand({
|
||||
id: idPrefix + '.copy',
|
||||
category,
|
||||
name: 'Copy',
|
||||
disableHandleKeyText: 'CtrlOrCommand+C',
|
||||
testEnabled: () => getCurrentEditor() != null,
|
||||
onClick: () => getCurrentEditor().copy(),
|
||||
});
|
||||
registerCommand({
|
||||
id: idPrefix + '.paste',
|
||||
category,
|
||||
name: 'Paste',
|
||||
disableHandleKeyText: 'CtrlOrCommand+V',
|
||||
testEnabled: () => getCurrentEditor() != null,
|
||||
onClick: () => getCurrentEditor().paste(),
|
||||
});
|
||||
}
|
||||
|
||||
if (findReplace) {
|
||||
registerCommand({
|
||||
id: idPrefix + '.find',
|
||||
|
||||
@@ -38,6 +38,8 @@
|
||||
id: 'dataGrid.revertAllChanges',
|
||||
category: 'Data grid',
|
||||
name: 'Revert all changes',
|
||||
toolbarName: 'Revert all',
|
||||
icon: 'icon undo',
|
||||
testEnabled: () => getCurrentDataGrid()?.getGrider()?.containsChanges,
|
||||
onClick: () => getCurrentDataGrid().revertAllChanges(),
|
||||
});
|
||||
@@ -1163,6 +1165,8 @@
|
||||
if (event.target.closest('.collapseButtonMarker')) return;
|
||||
if (event.target.closest('.showFormButtonMarker')) return;
|
||||
if (event.target.closest('.inplaceeditor-container')) return;
|
||||
if (event.target.closest('input')) return;
|
||||
|
||||
|
||||
shiftDragStartCell = null;
|
||||
// event.target.closest('table').focus();
|
||||
|
||||
@@ -49,7 +49,9 @@
|
||||
if (index >= 0 && index + d >= 0 && index + d < current.columns?.length) {
|
||||
let columns = [...current.columns];
|
||||
|
||||
[columns[index], columns[index + d]] = [columns[index + d], columns[index]];
|
||||
const tmp = columns[index + d];
|
||||
columns[index + d] = columns[index];
|
||||
columns[index] = tmp;
|
||||
|
||||
return {
|
||||
...current,
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
.main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.main.flex1 {
|
||||
|
||||
@@ -193,6 +193,7 @@
|
||||
<ToolStripCommandButton command="dataGrid.refresh" hideDisabled />
|
||||
<ToolStripCommandButton command="dataForm.refresh" hideDisabled />
|
||||
<ToolStripCommandButton command="collectionTable.save" />
|
||||
<ToolStripCommandButton command="dataGrid.revertAllChanges" hideDisabled />
|
||||
<ToolStripCommandButton command="dataGrid.insertNewRow" hideDisabled />
|
||||
<ToolStripCommandButton command="dataGrid.deleteSelectedRows" hideDisabled />
|
||||
<ToolStripCommandButton command="dataGrid.switchToJson" hideDisabled />
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
} from '../stores';
|
||||
import _, { Dictionary } from 'lodash';
|
||||
import { apiCall } from '../utility/api';
|
||||
import { showSnackbarSuccess } from '../utility/snackbar';
|
||||
import { showSnackbarError, showSnackbarSuccess } from '../utility/snackbar';
|
||||
import { changeTab } from '../utility/common';
|
||||
import getConnectionLabel from '../utility/getConnectionLabel';
|
||||
import { onMount } from 'svelte';
|
||||
@@ -47,6 +47,9 @@
|
||||
}
|
||||
);
|
||||
|
||||
// $: console.log('ConnectionTab.$values', $values);
|
||||
// $: console.log('ConnectionTab.driver', driver);
|
||||
|
||||
$: engine = $values.engine;
|
||||
$: driver = $extensions.drivers.find(x => x.engine == engine);
|
||||
|
||||
@@ -161,7 +164,12 @@
|
||||
|
||||
onMount(async () => {
|
||||
if (conid) {
|
||||
$values = await apiCall('connections/get', { conid });
|
||||
const con = await apiCall('connections/get', { conid });
|
||||
if (con) {
|
||||
$values = con;
|
||||
} else {
|
||||
showSnackbarError(`Connection not found: ${conid}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<script lang="ts" context="module">
|
||||
import registerCommand from '../commands/registerCommand';
|
||||
import { copyTextToClipboard } from '../utility/clipboard';
|
||||
|
||||
const getCurrentEditor = () => getActiveComponent('QueryTab');
|
||||
|
||||
registerCommand({
|
||||
@@ -37,6 +40,7 @@
|
||||
toggleComment: true,
|
||||
findReplace: true,
|
||||
executeAdditionalCondition: () => getCurrentEditor()?.hasConnection(),
|
||||
copyPaste: true,
|
||||
});
|
||||
registerCommand({
|
||||
id: 'query.executeCurrent',
|
||||
@@ -53,8 +57,6 @@
|
||||
import { getContext, onDestroy, onMount } from 'svelte';
|
||||
import sqlFormatter from 'sql-formatter';
|
||||
|
||||
import registerCommand from '../commands/registerCommand';
|
||||
|
||||
import VerticalSplitter from '../elements/VerticalSplitter.svelte';
|
||||
import SqlEditor from '../query/SqlEditor.svelte';
|
||||
import useEditorData from '../query/useEditorData';
|
||||
@@ -81,6 +83,7 @@
|
||||
import ToolStripExportButton, { createQuickExportHandlerRef } from '../buttons/ToolStripExportButton.svelte';
|
||||
import ToolStripSaveButton from '../buttons/ToolStripSaveButton.svelte';
|
||||
import ToolStripCommandSplitButton from '../buttons/ToolStripCommandSplitButton.svelte';
|
||||
import { getClipboardText } from '../utility/clipboard';
|
||||
|
||||
export let tabid;
|
||||
export let conid;
|
||||
@@ -241,6 +244,17 @@
|
||||
domEditor.getEditor().execCommand('togglecomment');
|
||||
}
|
||||
|
||||
export function copy() {
|
||||
const selectedText = domEditor.getEditor().getSelectedText();
|
||||
copyTextToClipboard(selectedText);
|
||||
}
|
||||
|
||||
export function paste() {
|
||||
getClipboardText().then(text => {
|
||||
domEditor.getEditor().execCommand('paste', text);
|
||||
});
|
||||
}
|
||||
|
||||
export function find() {
|
||||
domEditor.getEditor().execCommand('find');
|
||||
}
|
||||
@@ -311,6 +325,8 @@
|
||||
{ command: 'query.save' },
|
||||
{ command: 'query.saveAs' },
|
||||
{ divider: true },
|
||||
{ command: 'query.copy' },
|
||||
{ command: 'query.paste' },
|
||||
{ command: 'query.find' },
|
||||
{ command: 'query.replace' },
|
||||
{ divider: true },
|
||||
|
||||
@@ -277,6 +277,7 @@
|
||||
<ToolStripCommandButton command="dataForm.goToLast" hideDisabled />
|
||||
|
||||
<ToolStripCommandButton command="tableData.save" />
|
||||
<ToolStripCommandButton command="dataGrid.revertAllChanges" hideDisabled />
|
||||
<ToolStripCommandButton command="dataGrid.insertNewRow" hideDisabled />
|
||||
<ToolStripCommandButton command="dataGrid.deleteSelectedRows" hideDisabled />
|
||||
<ToolStripCommandButton command="dataGrid.switchToForm" hideDisabled />
|
||||
|
||||
@@ -66,6 +66,11 @@ export function copyTextToClipboard(text) {
|
||||
}
|
||||
}
|
||||
|
||||
/* Currently this doesn't work in firefox stable, but works in nightly */
|
||||
export async function getClipboardText() {
|
||||
return await navigator.clipboard.readText();
|
||||
}
|
||||
|
||||
export function extractRowCopiedValue(row, col) {
|
||||
let value = row[col];
|
||||
if (value === undefined) value = _.get(row, col);
|
||||
|
||||
@@ -97,7 +97,7 @@ function mapItem(item, commands) {
|
||||
if (command) {
|
||||
return {
|
||||
text: item.text || command.menuName || command.toolbarName || command.name,
|
||||
keyText: command.keyText || command.keyTextFromGroup,
|
||||
keyText: command.keyText || command.keyTextFromGroup || command.disableHandleKeyText,
|
||||
onClick: () => {
|
||||
if (command.isGroupCommand) {
|
||||
runGroupCommand(command.group);
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
diff --git a/node_modules/svelte/internal/index.js b/node_modules/svelte/internal/index.js
|
||||
index 1cce90d..6220522 100644
|
||||
--- a/node_modules/svelte/internal/index.js
|
||||
+++ b/node_modules/svelte/internal/index.js
|
||||
@@ -374,7 +374,7 @@ function insert_hydration(target, node, anchor) {
|
||||
}
|
||||
}
|
||||
function detach(node) {
|
||||
- node.parentNode.removeChild(node);
|
||||
+ if (node.parentNode) node.parentNode.removeChild(node);
|
||||
}
|
||||
function destroy_each(iterations, detaching) {
|
||||
for (let i = 0; i < iterations.length; i += 1) {
|
||||
diff --git a/node_modules/svelte/internal/index.mjs b/node_modules/svelte/internal/index.mjs
|
||||
index 6650e85..b746187 100644
|
||||
--- a/node_modules/svelte/internal/index.mjs
|
||||
+++ b/node_modules/svelte/internal/index.mjs
|
||||
@@ -370,7 +370,7 @@ function insert_hydration(target, node, anchor) {
|
||||
}
|
||||
}
|
||||
function detach(node) {
|
||||
- node.parentNode.removeChild(node);
|
||||
+ if (node.parentNode) node.parentNode.removeChild(node);
|
||||
}
|
||||
function destroy_each(iterations, detaching) {
|
||||
for (let i = 0; i < iterations.length; i += 1) {
|
||||
@@ -35,7 +35,7 @@
|
||||
"csv": "^5.3.2",
|
||||
"dbgate-plugin-tools": "^1.0.7",
|
||||
"lodash": "^4.17.21",
|
||||
"webpack": "^4.42.0",
|
||||
"webpack-cli": "^3.3.11"
|
||||
"webpack": "^5.91.0",
|
||||
"webpack-cli": "^5.1.4"
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@
|
||||
"lodash": "^4.17.21",
|
||||
"xlsx": "0.16.9",
|
||||
"dbgate-plugin-tools": "^1.0.7",
|
||||
"webpack": "^4.42.0",
|
||||
"webpack-cli": "^3.3.11"
|
||||
"webpack": "^5.91.0",
|
||||
"webpack-cli": "^5.1.4"
|
||||
}
|
||||
}
|
||||
@@ -33,11 +33,11 @@
|
||||
"devDependencies": {
|
||||
"dbgate-plugin-tools": "^1.0.7",
|
||||
"dbgate-query-splitter": "^4.9.3",
|
||||
"webpack": "^4.42.0",
|
||||
"webpack-cli": "^3.3.11",
|
||||
"webpack": "^5.91.0",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"dbgate-tools": "^5.0.0-alpha.1",
|
||||
"is-promise": "^4.0.0",
|
||||
"mongodb": "^4.7.0",
|
||||
"mongodb-client-encryption": "^2.1.0"
|
||||
"mongodb": "^6.3.0",
|
||||
"mongodb-client-encryption": "^6.0.0"
|
||||
}
|
||||
}
|
||||
@@ -10,9 +10,24 @@ class Analyser extends DatabaseAnalyser {
|
||||
const collections = collectionsAndViews.filter((x) => x.type == 'collection');
|
||||
const views = collectionsAndViews.filter((x) => x.type == 'view');
|
||||
|
||||
const stats = await Promise.all(
|
||||
collections.filter((x) => x.type == 'collection').map((x) => this.pool.__getDatabase().collection(x.name).stats())
|
||||
);
|
||||
let stats;
|
||||
try {
|
||||
stats = await Promise.all(
|
||||
collections
|
||||
.filter((x) => x.type == 'collection')
|
||||
.map((x) =>
|
||||
this.pool
|
||||
.__getDatabase()
|
||||
.collection(x.name)
|
||||
.aggregate([{ $collStats: { count: {} } }])
|
||||
.toArray()
|
||||
.then((resp) => ({ name: x.name, count: resp[0].count }))
|
||||
)
|
||||
);
|
||||
} catch (e) {
|
||||
// $collStats not supported
|
||||
stats = {};
|
||||
}
|
||||
|
||||
const res = this.mergeAnalyseResult({
|
||||
collections: [
|
||||
|
||||
@@ -33,10 +33,10 @@
|
||||
"devDependencies": {
|
||||
"dbgate-plugin-tools": "^1.0.7",
|
||||
"dbgate-query-splitter": "^4.9.3",
|
||||
"webpack": "^4.42.0",
|
||||
"webpack-cli": "^3.3.11",
|
||||
"webpack": "^5.91.0",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"dbgate-tools": "^5.0.0-alpha.1",
|
||||
"tedious": "^14.5.0",
|
||||
"tedious": "^18.2.0",
|
||||
"async-lock": "^1.2.6"
|
||||
}
|
||||
}
|
||||
@@ -35,8 +35,8 @@
|
||||
"dbgate-plugin-tools": "^1.0.7",
|
||||
"dbgate-query-splitter": "^4.9.3",
|
||||
"dbgate-tools": "^5.0.0-alpha.1",
|
||||
"mysql2": "^3.6.5",
|
||||
"webpack": "^5.89.0",
|
||||
"mysql2": "^3.9.7",
|
||||
"webpack": "^5.91.0",
|
||||
"webpack-cli": "^5.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
"dbgate-query-splitter": "^4.9.0",
|
||||
"dbgate-tools": "^5.0.0-alpha.1",
|
||||
"lodash": "^4.17.21",
|
||||
"webpack": "^4.42.0",
|
||||
"webpack-cli": "^3.3.11"
|
||||
"webpack": "^5.91.0",
|
||||
"webpack-cli": "^5.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
"dbgate-query-splitter": "^4.9.3",
|
||||
"dbgate-tools": "^5.0.0-alpha.1",
|
||||
"lodash": "^4.17.21",
|
||||
"pg": "^8.7.1",
|
||||
"webpack": "^4.42.0",
|
||||
"webpack-cli": "^3.3.11"
|
||||
"pg": "^8.11.5",
|
||||
"webpack": "^5.91.0",
|
||||
"webpack-cli": "^5.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,11 @@ select
|
||||
table_name as "pure_name",
|
||||
column_name as "column_name",
|
||||
is_nullable as "is_nullable",
|
||||
data_type as "data_type",
|
||||
case
|
||||
when (data_type = 'USER-DEFINED' OR data_type = 'ARRAY') then udt_name::regtype::text
|
||||
else data_type
|
||||
end
|
||||
as "data_type",
|
||||
character_maximum_length as "char_max_length",
|
||||
numeric_precision as "numeric_precision",
|
||||
numeric_scale as "numeric_scale",
|
||||
@@ -20,4 +24,4 @@ where
|
||||
('views:' || table_schema || '.' || table_name) =OBJECT_ID_CONDITION
|
||||
)
|
||||
order by ordinal_position
|
||||
`;
|
||||
`;
|
||||
|
||||
@@ -2,7 +2,7 @@ module.exports = `
|
||||
select infoTables.table_schema as "schema_name", infoTables.table_name as "pure_name",
|
||||
(
|
||||
select md5(string_agg(
|
||||
infoColumns.column_name || '|' || infoColumns.data_type || '|' || infoColumns.is_nullable::varchar(255) || '|' || coalesce(infoColumns.character_maximum_length, -1)::varchar(255)
|
||||
infoColumns.column_name || '|' || case when (infoColumns.data_type = 'USER-DEFINED' OR infoColumns.data_type = 'ARRAY') then infoColumns.udt_name::regtype::text else infoColumns.data_type end || '|' || infoColumns.is_nullable::varchar(255) || '|' || coalesce(infoColumns.character_maximum_length, -1)::varchar(255)
|
||||
|| '|' || coalesce(infoColumns.numeric_precision, -1)::varchar(255) ,
|
||||
',' order by infoColumns.ordinal_position
|
||||
)) as "hash_code_columns"
|
||||
|
||||
@@ -33,10 +33,10 @@
|
||||
"dbgate-query-splitter": "^4.9.3",
|
||||
"dbgate-tools": "^5.0.0-alpha.1",
|
||||
"lodash": "^4.17.21",
|
||||
"webpack": "^4.42.0",
|
||||
"webpack-cli": "^3.3.11",
|
||||
"webpack": "^5.91.0",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"async": "^3.2.3",
|
||||
"ioredis": "^4.28.5",
|
||||
"ioredis": "^5.4.1",
|
||||
"node-redis-dump2": "^0.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
"dbgate-plugin-tools": "^1.0.4",
|
||||
"dbgate-query-splitter": "^4.9.3",
|
||||
"byline": "^5.0.0",
|
||||
"webpack": "^4.42.0",
|
||||
"webpack-cli": "^3.3.11"
|
||||
}
|
||||
"webpack": "^5.91.0",
|
||||
"webpack-cli": "^5.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
"devDependencies": {
|
||||
"node-xml-stream-parser": "^1.0.12",
|
||||
"dbgate-plugin-tools": "^1.0.7",
|
||||
"webpack": "^4.42.0",
|
||||
"webpack-cli": "^3.3.11"
|
||||
"webpack": "^5.91.0",
|
||||
"webpack-cli": "^5.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user