mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
Compare commits
9 Commits
v0.7.29-be
...
v0.7.29-be
Author | SHA1 | Date | |
---|---|---|---|
2120a59d41 | |||
2cda4a1fa1 | |||
76c8cd1beb | |||
14aeebed9c | |||
|
1a1118452a | ||
|
4b0f596405 | ||
|
eb749f0f66 | ||
|
d78e59dd09 | ||
7969294a93 |
15
CHANGELOG.md
15
CHANGELOG.md
@@ -2,6 +2,21 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
|
### [0.7.29-beta.2](https://github.com/antares-sql/antares/compare/v0.7.29-beta.1...v0.7.29-beta.2) (2024-10-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **UI:** new context menu and some minor improvements to query tabs, closes [#867](https://github.com/antares-sql/antares/issues/867) ([14aeebe](https://github.com/antares-sql/antares/commit/14aeebed9cd8e475548f5e0ade105f4b11954cb2))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **MySQL:** incorrect representation of the DATE if the year is prior to 1900, fixes [#860](https://github.com/antares-sql/antares/issues/860) ([7969294](https://github.com/antares-sql/antares/commit/7969294a93a51861c57d4396c7a0d89ecc7e8a84))
|
||||||
|
* **MySQL:** missing exported values for DEFAULT_GENERATED table fields, fixes [#854](https://github.com/antares-sql/antares/issues/854) ([2cda4a1](https://github.com/antares-sql/antares/commit/2cda4a1fa1c80f3567e160caf0b93bc19d76fbaa))
|
||||||
|
* **PostgreSQL:** error changing the comment for a specific table name ([eb749f0](https://github.com/antares-sql/antares/commit/eb749f0f66bf6547053e30b1503c8b2990ae5950))
|
||||||
|
* **PostgreSQL:** unable to change table comment to empty ([d78e59d](https://github.com/antares-sql/antares/commit/d78e59dd0910d3ea6ec5183a8748420b2db57050))
|
||||||
|
|
||||||
### [0.7.29-beta.1](https://github.com/antares-sql/antares/compare/v0.7.29-beta.0...v0.7.29-beta.1) (2024-09-28)
|
### [0.7.29-beta.1](https://github.com/antares-sql/antares/compare/v0.7.29-beta.0...v0.7.29-beta.1) (2024-09-28)
|
||||||
|
|
||||||
|
|
||||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "antares",
|
"name": "antares",
|
||||||
"version": "0.7.29-beta.1",
|
"version": "0.7.29-beta.2",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "antares",
|
"name": "antares",
|
||||||
"version": "0.7.29-beta.1",
|
"version": "0.7.29-beta.2",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "antares",
|
"name": "antares",
|
||||||
"productName": "Antares",
|
"productName": "Antares",
|
||||||
"version": "0.7.29-beta.1",
|
"version": "0.7.29-beta.2",
|
||||||
"description": "A modern, fast and productivity driven SQL client with a focus in UX.",
|
"description": "A modern, fast and productivity driven SQL client with a focus in UX.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": "https://github.com/antares-sql/antares.git",
|
"repository": "https://github.com/antares-sql/antares.git",
|
||||||
|
@@ -232,12 +232,13 @@ export class MySQLClient extends BaseClient {
|
|||||||
const dbConfig = await this.getDbConfig();
|
const dbConfig = await this.getDbConfig();
|
||||||
const connection = await mysql.createConnection({
|
const connection = await mysql.createConnection({
|
||||||
...dbConfig,
|
...dbConfig,
|
||||||
typeCast: (field, next) => {
|
dateStrings: true
|
||||||
if (field.type === 'DATETIME')
|
// typeCast: (field, next) => {
|
||||||
return field.string();
|
// if (field.type === 'DATETIME')
|
||||||
else
|
// return field.string();
|
||||||
return next();
|
// else
|
||||||
}
|
// return next();
|
||||||
|
// }
|
||||||
});
|
});
|
||||||
|
|
||||||
return connection;
|
return connection;
|
||||||
@@ -249,12 +250,13 @@ export class MySQLClient extends BaseClient {
|
|||||||
...dbConfig,
|
...dbConfig,
|
||||||
connectionLimit: this._poolSize,
|
connectionLimit: this._poolSize,
|
||||||
enableKeepAlive: true,
|
enableKeepAlive: true,
|
||||||
typeCast: (field, next) => {
|
dateStrings: true
|
||||||
if (field.type === 'DATETIME')
|
// typeCast: (field, next) => {
|
||||||
return field.string();
|
// if (field.type === 'DATETIME')
|
||||||
else
|
// return field.string();
|
||||||
return next();
|
// else
|
||||||
}
|
// return next();
|
||||||
|
// }
|
||||||
});
|
});
|
||||||
|
|
||||||
this._keepaliveTimer = setInterval(async () => {
|
this._keepaliveTimer = setInterval(async () => {
|
||||||
@@ -661,7 +663,7 @@ export class MySQLClient extends BaseClient {
|
|||||||
charset: field.CHARACTER_SET_NAME,
|
charset: field.CHARACTER_SET_NAME,
|
||||||
collation: field.COLLATION_NAME,
|
collation: field.COLLATION_NAME,
|
||||||
autoIncrement: field.EXTRA.includes('auto_increment'),
|
autoIncrement: field.EXTRA.includes('auto_increment'),
|
||||||
generated: field.EXTRA.toLowerCase().includes('generated'),
|
generated: ['VIRTUAL GENERATED', 'VIRTUAL STORED'].includes(field.EXTRA),
|
||||||
onUpdate: field.EXTRA.toLowerCase().includes('on update')
|
onUpdate: field.EXTRA.toLowerCase().includes('on update')
|
||||||
? field.EXTRA.substr(field.EXTRA.indexOf('on update') + 9, field.EXTRA.length).trim()
|
? field.EXTRA.substr(field.EXTRA.indexOf('on update') + 9, field.EXTRA.length).trim()
|
||||||
: '',
|
: '',
|
||||||
|
@@ -925,7 +925,7 @@ export class PostgreSQLClient extends BaseClient {
|
|||||||
sql = `${sql} (${[...newColumns, ...newIndexes, ...newForeigns].join(', ')}); `;
|
sql = `${sql} (${[...newColumns, ...newIndexes, ...newForeigns].join(', ')}); `;
|
||||||
if (manageIndexes.length) sql = `${sql} ${manageIndexes.join(';')}; `;
|
if (manageIndexes.length) sql = `${sql} ${manageIndexes.join(';')}; `;
|
||||||
// TABLE COMMENT
|
// TABLE COMMENT
|
||||||
if (options.comment) sql = `${sql} COMMENT ON TABLE "${schema}"."${options.name}" IS '${options.comment}'; `;
|
if (options.comment != null) sql = `${sql} COMMENT ON TABLE "${schema}"."${options.name}" IS '${options.comment}'; `;
|
||||||
// FIELDS COMMENT
|
// FIELDS COMMENT
|
||||||
if (modifyComment.length) sql = `${sql} ${modifyComment.join(';')}; `;
|
if (modifyComment.length) sql = `${sql} ${modifyComment.join(';')}; `;
|
||||||
|
|
||||||
@@ -1070,7 +1070,7 @@ export class PostgreSQLClient extends BaseClient {
|
|||||||
if (createSequences.length) sql = `${createSequences.join(';')}; ${sql}`;
|
if (createSequences.length) sql = `${createSequences.join(';')}; ${sql}`;
|
||||||
if (manageIndexes.length) sql = `${manageIndexes.join(';')}; ${sql}`;
|
if (manageIndexes.length) sql = `${manageIndexes.join(';')}; ${sql}`;
|
||||||
// TABLE COMMENT
|
// TABLE COMMENT
|
||||||
if (options.comment) sql = `${sql} COMMENT ON TABLE ${schema}.${table} IS '${options.comment}'; `;
|
if (options.comment != null) sql = `${sql} COMMENT ON TABLE "${schema}"."${table}" IS '${options.comment}'; `;
|
||||||
// FIELDS COMMENT
|
// FIELDS COMMENT
|
||||||
if (modifyComment.length) sql = `${sql} ${modifyComment.join(';')}; `;
|
if (modifyComment.length) sql = `${sql} ${modifyComment.join(';')}; `;
|
||||||
if (options.name) sql += `ALTER TABLE "${schema}"."${table}" RENAME TO "${options.name}"; `;
|
if (options.name) sql += `ALTER TABLE "${schema}"."${table}" RENAME TO "${options.name}"; `;
|
||||||
|
@@ -141,8 +141,11 @@ onMounted(() => {
|
|||||||
|
|
||||||
while (node) {
|
while (node) {
|
||||||
if (node.nodeName.match(/^(input|textarea)$/i) || node.isContentEditable) {
|
if (node.nodeName.match(/^(input|textarea)$/i) || node.isContentEditable) {
|
||||||
InputMenu.popup({ window: getCurrentWindow() });
|
if (!node.parentNode.className.split(' ').includes('editor-query')) {
|
||||||
break;
|
InputMenu.popup({ window: getCurrentWindow() });
|
||||||
|
console.log(node.parentNode.className);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
node = node.parentNode;
|
node = node.parentNode;
|
||||||
}
|
}
|
||||||
|
@@ -612,7 +612,7 @@ const otherContributors = computed(() => {
|
|||||||
return contributors
|
return contributors
|
||||||
.split(',')
|
.split(',')
|
||||||
.filter(c => !c.includes(appAuthor))
|
.filter(c => !c.includes(appAuthor))
|
||||||
.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()));
|
.sort((a, b) => a.toLowerCase().trim().localeCompare(b.toLowerCase()));
|
||||||
});
|
});
|
||||||
|
|
||||||
const selectTab = (tab: string) => {
|
const selectTab = (tab: string) => {
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
<div
|
<div
|
||||||
:id="`editor-${id}`"
|
:id="`editor-${id}`"
|
||||||
class="editor"
|
class="editor"
|
||||||
|
:class="editorClasses"
|
||||||
:style="{height: `${height}px`}"
|
:style="{height: `${height}px`}"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -54,7 +55,8 @@ const props = defineProps({
|
|||||||
schema: { type: String, default: '' },
|
schema: { type: String, default: '' },
|
||||||
autoFocus: { type: Boolean, default: false },
|
autoFocus: { type: Boolean, default: false },
|
||||||
readOnly: { type: Boolean, default: false },
|
readOnly: { type: Boolean, default: false },
|
||||||
height: { type: Number, default: 200 }
|
height: { type: Number, default: 200 },
|
||||||
|
editorClasses: { type: String, default: '' }
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue']);
|
const emit = defineEmits(['update:modelValue']);
|
||||||
@@ -405,18 +407,17 @@ defineExpose({ editor });
|
|||||||
|
|
||||||
.ace_gutter-cell.ace_breakpoint {
|
.ace_gutter-cell.ace_breakpoint {
|
||||||
&::before {
|
&::before {
|
||||||
content: '\F0403';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 3px;
|
left: 0px;
|
||||||
top: 2px;
|
top: 8px;
|
||||||
color: var(--primary-color);
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font: normal normal normal 24px/1 "Material Design Icons", sans-serif;
|
width: 0;
|
||||||
font-size: inherit;
|
height: 0;
|
||||||
text-rendering: auto;
|
border-left: 8px solid transparent;
|
||||||
line-height: inherit;
|
border-top: 8px solid transparent;
|
||||||
-webkit-font-smoothing: antialiased;
|
border-right: 8px solid var(--primary-color);
|
||||||
-moz-osx-font-smoothing: grayscale;
|
transform: rotate(-45deg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
:schema="breadcrumbsSchema"
|
:schema="breadcrumbsSchema"
|
||||||
:is-selected="isSelected"
|
:is-selected="isSelected"
|
||||||
:height="editorHeight"
|
:height="editorHeight"
|
||||||
|
editor-classes="editor-query"
|
||||||
/>
|
/>
|
||||||
<div ref="resizer" class="query-area-resizer" />
|
<div ref="resizer" class="query-area-resizer" />
|
||||||
<div ref="queryAreaFooter" class="workspace-query-runner-footer">
|
<div ref="queryAreaFooter" class="workspace-query-runner-footer">
|
||||||
@@ -273,6 +274,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { getCurrentWindow, Menu } from '@electron/remote';
|
||||||
import { Ace } from 'ace-builds';
|
import { Ace } from 'ace-builds';
|
||||||
import { ConnectionParams } from 'common/interfaces/antares';
|
import { ConnectionParams } from 'common/interfaces/antares';
|
||||||
import { uidGen } from 'common/libs/uidGen';
|
import { uidGen } from 'common/libs/uidGen';
|
||||||
@@ -475,6 +477,8 @@ const runQuery = async (query: string) => {
|
|||||||
saveHistory(params);
|
saveHistory(params);
|
||||||
if (!autocommit.value)
|
if (!autocommit.value)
|
||||||
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: true });
|
setUnsavedChanges({ uid: props.connection.uid, tUid: props.tabUid, isChanged: true });
|
||||||
|
|
||||||
|
queryEditor.value.editor.focus();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
addNotification({ status: 'error', message: response });
|
addNotification({ status: 'error', message: response });
|
||||||
@@ -739,7 +743,11 @@ const openFile = async () => {
|
|||||||
|
|
||||||
const saveFileAs = async () => {
|
const saveFileAs = async () => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
const result: any = await Application.showSaveDialog({ filters: [{ name: 'SQL', extensions: ['sql'] }], defaultPath: `${queryName.value || 'query'}.sql` });
|
const result: any = await Application.showSaveDialog({
|
||||||
|
filters: [{ name: 'SQL', extensions: ['sql'] }],
|
||||||
|
defaultPath: (!queryName.value.includes('.sql') ? `${queryName.value}.sql` :queryName.value) || 'query.sql'
|
||||||
|
});
|
||||||
|
|
||||||
if (result && !result.canceled) {
|
if (result && !result.canceled) {
|
||||||
await Application.writeFile(result.filePath, query.value);
|
await Application.writeFile(result.filePath, query.value);
|
||||||
addNotification({ status: 'success', message: t('general.actionSuccessful', { action: t('application.saveFile') }) });
|
addNotification({ status: 'success', message: t('general.actionSuccessful', { action: t('application.saveFile') }) });
|
||||||
@@ -750,9 +758,13 @@ const saveFileAs = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const saveFile = async () => {
|
const saveFile = async () => {
|
||||||
await Application.writeFile(filePath.value, query.value);
|
if (filePath.value) {
|
||||||
addNotification({ status: 'success', message: t('general.actionSuccessful', { action: t('application.saveFile') }) });
|
await Application.writeFile(filePath.value, query.value);
|
||||||
lastSavedQuery.value = toRaw(query.value);
|
addNotification({ status: 'success', message: t('general.actionSuccessful', { action: t('application.saveFile') }) });
|
||||||
|
lastSavedQuery.value = toRaw(query.value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
saveFileAs();
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadFileContent = async (file: string) => {
|
const loadFileContent = async (file: string) => {
|
||||||
@@ -785,6 +797,67 @@ onMounted(() => {
|
|||||||
|
|
||||||
if (props.tab.filePath)
|
if (props.tab.filePath)
|
||||||
loadFileContent(props.tab.filePath);
|
loadFileContent(props.tab.filePath);
|
||||||
|
|
||||||
|
queryEditor.value.editor.container.addEventListener('contextmenu', (e) => {
|
||||||
|
const InputMenu = Menu.buildFromTemplate([
|
||||||
|
{
|
||||||
|
label: t('general.run'),
|
||||||
|
click: () => runQuery(query.value)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('general.clear'),
|
||||||
|
click: () => clear()
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separator'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('application.saveFile'),
|
||||||
|
click: () => saveFile()
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('application.saveFileAs'),
|
||||||
|
click: () => saveFileAs()
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('application.openFile'),
|
||||||
|
click: () => openFile()
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separator'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('general.cut'),
|
||||||
|
role: 'cut'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('general.copy'),
|
||||||
|
role: 'copy'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('general.paste'),
|
||||||
|
role: 'paste'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separator'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t('general.selectAll'),
|
||||||
|
role: 'selectAll'
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
let node: any = e.target;
|
||||||
|
while (node) {
|
||||||
|
if (node.nodeName.match(/^(input|textarea)$/i) || node.isContentEditable) {
|
||||||
|
InputMenu.popup({ window: getCurrentWindow() });
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
node = node.parentNode;
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
|
@@ -9,7 +9,7 @@ export const localesNames: Record<string, string> = {
|
|||||||
'vi-VN': 'Tiếng Việt',
|
'vi-VN': 'Tiếng Việt',
|
||||||
'ja-JP': '日本語',
|
'ja-JP': '日本語',
|
||||||
'zh-CN': '简体中文',
|
'zh-CN': '简体中文',
|
||||||
'zh-TW': '繁體中文',
|
'zh-TW': '正體中文',
|
||||||
'ru-RU': 'Русский',
|
'ru-RU': 'Русский',
|
||||||
'id-ID': 'Bahasa Indonesia',
|
'id-ID': 'Bahasa Indonesia',
|
||||||
'ko-KR': '한국어',
|
'ko-KR': '한국어',
|
||||||
|
@@ -256,6 +256,10 @@ option:checked {
|
|||||||
}
|
}
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
|
a {
|
||||||
|
border-bottom-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
.tab-link {
|
.tab-link {
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
}
|
}
|
||||||
|
@@ -255,6 +255,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
&.result-tabs .tab-item {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
.workspace-query-runner .workspace-query-runner-footer .workspace-query-buttons .btn {
|
.workspace-query-runner .workspace-query-runner-footer .workspace-query-buttons .btn {
|
||||||
color: $body-font-color-dark;
|
color: $body-font-color-dark;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user