Compare commits

...

61 Commits

Author SHA1 Message Date
Jan Prochazka ba65704d55 v5.2.8 2024-05-17 06:40:13 +02:00
Jan Prochazka 68f77d4ed7 v5.2.8-beta.24 2024-05-15 18:57:10 +02:00
Jan Prochazka 008f6be6ac Merge branch 'master' of github.com:dbgate/dbgate 2024-05-15 18:56:57 +02:00
Jan Prochazka 7324cef87a write uncaught exception to console 2024-05-15 18:56:52 +02:00
Jan Prochazka 471fcdc131 added flatpak metainfo 2024-05-13 16:28:21 +02:00
Jan Prochazka c2abc83f99 reverted ubuntu upgrade 2024-05-13 14:47:32 +02:00
Jan Prochazka a23bda7294 v5.2.8-beta.23 2024-05-13 14:26:55 +02:00
Jan Prochazka a2d643305b Merge commit '9b4683ef53e815a4190ae90b8a83365235208d0e' 2024-05-13 14:26:38 +02:00
Jan Prochazka dd36427a80 upgraded docker ubuntu base 2024-05-13 14:25:26 +02:00
Jan Prochazka 9b4683ef53 v5.2.8-beta.22 2024-05-13 09:27:57 +02:00
Jan Prochazka a24271f045 build tar.gz for linux 2024-05-13 09:27:19 +02:00
Jan Prochazka f74e57bec2 handle not found connection in ConnectionTab 2024-05-13 09:26:54 +02:00
Jan Prochazka 4fb6b49b86 small fix 2024-05-13 08:40:43 +02:00
Jan Prochazka 72c380cef5 v5.2.8-beta.17 2024-05-09 14:23:42 +02:00
Jan Prochazka 39cdaf88f4 Merge pull request #770 from michael-pattern/feat/763/per-user_permissions_when_using_oauth
feat: per-user permissions when using oauth
2024-05-09 14:20:12 +02:00
Jan Prochazka 52c77031c5 Merge pull request #742 from frenchtoasters/trustCertEnv
Adding env for parsing for trustServerCertificate connection value
2024-05-09 14:02:45 +02:00
Jan Prochazka fdabe1eeaa Merge pull request #744 from Bare7a/postgresql-user-type-enhancements
Postgresql - Show proper types for Composite Types, Enums and Arrays
2024-05-09 13:21:04 +02:00
Jan Prochazka 4429b1d618 revert changes button #759 2024-05-09 13:07:31 +02:00
Jan Prochazka 5c24774170 fixed copy & paste commands 2024-05-09 13:03:05 +02:00
Jan Prochazka 792be82acd changelog 2024-05-09 12:20:34 +02:00
Jan Prochazka 6e3cd08d8a redis driver upgraded 2024-05-09 12:16:14 +02:00
michael-pattern 696d870c2f Allow password-based user login only when password is truthy 2024-05-08 17:52:50 -04:00
michael-pattern 26471517a9 Only add users to basicAuth when password is truthy 2024-05-08 17:52:05 -04:00
michael-pattern 58233a2fd5 Create login entries when the OAUTH_PERMISSIONS flag is truthy 2024-05-08 17:51:27 -04:00
Jan Prochazka 230948c4b4 changelog 2024-05-08 19:27:31 +02:00
Jan Prochazka df593074c2 test container node version => 18 2024-05-08 19:00:28 +02:00
Jan Prochazka 474ecb1b71 Merge branch 'update-packages-2' 2024-05-08 18:55:52 +02:00
Jan Prochazka e8e5781b59 removed better-sqlite prebuilds 2024-05-08 17:26:34 +02:00
Jan Prochazka a042ff363e v5.2.8-beta.16 2024-05-08 10:35:59 +02:00
Jan Prochazka 63bdf817c6 upgraded webpack 2024-05-08 10:35:14 +02:00
Jan Prochazka 82eed3b86e v5.2.8-beta.15 2024-05-08 10:27:52 +02:00
Jan Prochazka 21a24f9ba2 node version => 18 2024-05-08 10:27:35 +02:00
Jan Prochazka 550354fe09 v5.2.8-beta.14 2024-05-08 10:22:45 +02:00
Jan Prochazka e14e7efa1a fixed build error - upgraded chart.js 2024-05-08 10:22:25 +02:00
Jan Prochazka b1cf418058 upgrade electron && db drivers 2024-05-08 10:17:45 +02:00
Jan Prochazka bde4127b33 v5.2.8-beta.13 2024-05-08 08:33:34 +02:00
Jan Prochazka e981cb2734 upgrade webpack 2024-05-08 08:31:10 +02:00
Jan Prochazka 6f4c0edb46 upgraded mongodb driver 2024-05-08 08:21:51 +02:00
Jan Prochazka 6591e45a6e v5.2.8-beta.12 2024-05-08 07:47:02 +02:00
Jan Prochazka 397a6b54ff Merge branch 'master' of github.com:dbgate/dbgate 2024-05-08 07:46:31 +02:00
Jan Prochazka 51555da376 fixed missing env 2024-05-08 07:46:28 +02:00
ProjectInfinity 8e6b1973c7 Merge branch 'copy-paste-improvements' 2024-04-17 17:56:51 +02:00
ProjectInfinity 5a8627c39f Add copy to column list 2024-04-17 17:44:10 +02:00
Bare7a 26a46d9037 updated tableModifications.js 2024-04-06 17:39:58 +03:00
Bare7a b9a974ca27 updated tableModifications.js 2024-04-06 17:37:14 +03:00
Bare7a e4ed163723 updated tableModifications.js 2024-04-06 17:33:47 +03:00
Bare7a 4d8c62f3f5 updated tableModifications.js 2024-04-06 17:31:25 +03:00
Bare7a 4b2e28483b Updated columns.js 2024-04-06 17:30:09 +03:00
Bare7a 3cd070e211 Update columns.js 2024-04-06 17:21:06 +03:00
Bare7a 1e818e7756 Postgresql - Show proper types for Composite Types, Enums and Arrays 2024-04-06 17:13:36 +03:00
Jan Prochazka 91efb7abda v5.2.8-beta.11 2024-04-05 10:23:57 +02:00
Jan Prochazka 5659311ba2 v5.2.8-beta.10 2024-04-05 10:22:54 +02:00
Jan Prochazka 232031ff5b Merge branch 'master' of github.com:dbgate/dbgate 2024-04-05 10:20:35 +02:00
Jan Prochazka 0e242321ed upgraded electron-builder-notarize 2024-04-05 10:20:31 +02:00
Tyler French 83f3391b24 Adding env for parsing for trustServerCertificate connection value 2024-04-03 15:29:19 -04:00
ProjectInfinity 715c6f7f29 Make TabControl scrollable
Fixes #730
2024-03-28 03:40:01 +01:00
ProjectInfinity 0fc20f7238 Fix filter being unclickable
A commit caused the filter input to be unclickable, this fixes that.
2024-03-26 00:09:12 +01:00
ProjectInfinity c824e32f0a Add copy name to table list 2024-03-14 00:24:53 +01:00
ProjectInfinity 10a916bce6 Add copy/paste to query tab and database list 2024-03-13 23:59:02 +01:00
Jan Prochazka 1080147085 v5.2.8-beta.9 2024-02-16 08:43:22 +01:00
Jan Prochazka f0ebe260e2 v5.2.6-beta.8 2024-02-16 08:42:53 +01:00
50 changed files with 2428 additions and 3115 deletions
+4 -2
View File
@@ -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
+4 -2
View File
@@ -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
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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:
+1 -1
View File
@@ -8,7 +8,7 @@ on:
jobs:
test-runner:
runs-on: ubuntu-latest
container: node:16.20
container: node:18
steps:
- name: Context
+18
View File
@@ -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
+39
View File
@@ -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
View File
@@ -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"
}
}
+4
View File
@@ -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
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -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 -1
View File
@@ -1,4 +1,4 @@
FROM node:14-alpine
FROM node:18-alpine
WORKDIR /home/dbgate-docker
+1 -1
View File
@@ -1,6 +1,6 @@
{
"private": true,
"version": "5.2.8-beta.7",
"version": "5.2.8",
"name": "dbgate-all",
"workspaces": [
"packages/*",
+4 -4
View File
@@ -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"
}
}
+1 -1
View File
@@ -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');
+1 -1
View File
@@ -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',
})
+8 -1
View File
@@ -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,
})
}
}
}
+4
View File
@@ -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,
+1 -1
View File
@@ -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',
+20
View File
@@ -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 />
+10 -2
View File
@@ -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}`);
}
}
});
+18 -2
View File
@@ -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 />
+5
View File
@@ -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);
+1 -1
View File
@@ -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);
-26
View File
@@ -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) {
+2 -2
View File
@@ -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"
}
}
+2 -2
View File
@@ -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"
}
}
+4 -4
View File
@@ -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: [
+3 -3
View File
@@ -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"
}
}
+2 -2
View File
@@ -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"
}
}
+2 -2
View File
@@ -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"
}
}
+3 -3
View File
@@ -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"
+3 -3
View File
@@ -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"
}
}
+3 -3
View File
@@ -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"
}
}
+2 -2
View File
@@ -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"
}
}
+1733 -2685
View File
File diff suppressed because it is too large Load Diff