diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b714e8e..859e91af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,30 @@ 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.3.2](https://github.com/Fabio286/antares/compare/v0.3.1...v0.3.2) (2021-08-06) + + +### Features + +* contextual menu option to duplicate table fields ([3abff36](https://github.com/Fabio286/antares/commit/3abff3613618ddc86e1d6c898f83bcb360e8e5d9)) +* **UI:** automatic scroll on selected tab ([e834fe3](https://github.com/Fabio286/antares/commit/e834fe31ac8b73f249e3ad8654e97da834b28cfe)) +* **UI:** automatic scroll to selected tab element in left bar ([04fc1bb](https://github.com/Fabio286/antares/commit/04fc1bbee0cdc3b02288ff5d3b2c402633cae1f1)) +* **UI:** button to clear sidebar search input ([1573de5](https://github.com/Fabio286/antares/commit/1573de5b1f545328523aaaaac541f5a8046617be)) +* **UI:** query tab name based on content ([065de3a](https://github.com/Fabio286/antares/commit/065de3a0a28a9e6667df4e41ac1c5fa5561d2171)) +* **UI:** shortcuts info on empty query tab ([70354aa](https://github.com/Fabio286/antares/commit/70354aa828121004f70e91d65cb9f0a4811dce57)) + + +### Bug Fixes + +* tab selected when clicking closing cross ([07ee1ae](https://github.com/Fabio286/antares/commit/07ee1ae828bb5f9971a263f2e39e73c760fed50a)) + + +### Improvements + +* approximate table total updated on table refresh ([dea3780](https://github.com/Fabio286/antares/commit/dea378014dd45bf90f51a599b4a801e0bc22059f)) +* **UI:** loading animation on tables and table context menu improvements ([372049a](https://github.com/Fabio286/antares/commit/372049ae64232e8e61a974edc8be5b319c5c0811)) +* update italian translation ([cbe0e29](https://github.com/Fabio286/antares/commit/cbe0e2980a9d4562941aec37a57cc936a46f41d8)) + ### [0.3.1](https://github.com/Fabio286/antares/compare/v0.3.0...v0.3.1) (2021-07-27) diff --git a/README.md b/README.md index d02f1990..2b1fd0cb 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ![GitHub package.json version](https://img.shields.io/github/package-json/v/fabio286/antares) [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Ffabio286%2Fantares%2Fbadge&style=flat)](https://actions-badge.atrox.dev/fabio286/antares/goto) ![GitHub All Releases](https://img.shields.io/github/downloads/fabio286/antares/total) ![GitHub](https://img.shields.io/github/license/fabio286/antares) [![antares](https://snapcraft.io/antares/badge.svg)](https://snapcraft.io/antares) [![antares](https://snapcraft.io/antares/trending.svg?name=0)](https://snapcraft.io/antares) [![Twitter Follow](https://img.shields.io/twitter/follow/AntaresSQL?style=social)](https://twitter.com/AntaresSQL) [![Plant a Tree](https://raw.githubusercontent.com/Fabio286/treedom-badge/master/svg/plant-a-tree.svg)](https://www.treedom.net/en/user/fabio-di-stasio/event/antares-for-the-planet) Antares is an SQL client based on [Electron.js](https://github.com/electron/electron) and [Vue.js](https://github.com/vuejs/vue) that aims to become a useful tool, especially for developers. -My target is to support as many databases as possible, and all major operating systems, including the ARM versions. +Our target is to support as many databases as possible, and all major operating systems, including the ARM versions. **At the moment this application is in development state, many features will come in future updates**, and supports only MySQL/MariaDB and PostgreSQL. At the moment, however, there are all the features necessary to have a pleasant database management experience, so give it a chance and send us your feedback, we would really appreciate it. @@ -17,37 +17,48 @@ We are actively working on it, hoping to provide new cool features, improvements 👁 To stay tuned for new releases [follow Antares SQL](https://twitter.com/AntaresSQL) on Twitter. 🌟 Don't forget to **leave a star** if you appreciate this project. +## Current key features + +- Multiple database connections at same time. +- Database management (add/edit/delete). +- Full tables management, including indexes and foreign keys. +- Views, triggers, stored routines, functions and schedulers management (add/edit/delete). +- A modern and friendly tab system; keep open every kind of tab you need in your workspace. +- Fake table data filler to generate tons of data for test purpose. +- Query suggestions and auto complete. +- SSH tunnel support. +- Dark and light theme. +- Editor themes. +- Scratchpad. +- Secure password storage. + ## Philosophy Why are we developing an SQL client when there are a lot of them on the market? The main goal is to develop a totally free, full featured, cross platform and open source alternative, empowered by JavaScript's ecosystem. A modern application created with minimalism and semplicity in mind, with features in the right places, not hundreds of tiny buttons, nested tabs or submenu; productivity comes first. -## Download +## Installation -[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/antares) [![Get it from AUR](https://raw.githubusercontent.com/Fabio286/antares/3e00c4bae6e036300c752c1a40c5a038fea9c169/docs/aur-badge.svg)](https://aur.archlinux.org/packages/antares-sql/) [![Get it from Microsoft Store](https://raw.githubusercontent.com/Fabio286/antares/gh-pages/src/assets/ms-store.png)](https://www.microsoft.com/p/antares-sql-client/9nhtb9sq51r1?cid=storebadge&ocid=badge&rtc=1&activetab=pivot:overviewtab) -🚀 **[Other Downloads](https://github.com/Fabio286/antares/releases/latest)** +Based on your operating system you can have one or more distribution formats to choose based on your preferences. +Since Antares SQL is a free software we haven't a budget to spend in annual licenses or certificates. This can result that on some platforms you need some additional passages to install this app. -## How to contribute +### Linux -- 🌍 [Translate Antares](https://github.com/Fabio286/antares/wiki/Translate-Antares) -- 📖 [Contributors Guide](https://github.com/Fabio286/antares/wiki/Contributors-Guide) -- 🚧 [Project Board](https://github.com/users/Fabio286/projects/1) +On Linux you can simply download and run `.AppImage` distributions, install from Snap Store or from AUR. -## Current main features +### Windows -- Multiple database connections at same time. -- Database management (add/edit/delete). -- Full tables management, including indexes and foreign keys. -- Views, triggers, stored routines, functions and schedulers management (add/edit/delete). -- Fake table data filler. -- Run queries on multiple tabs. -- Query suggestions and auto complete. -- SSH tunnel support. -- Dark and light theme. -- Scratchpad. -- Multi language. -- Secure password storage. +On Windows you can choose between Microsoft Store and download `.exe` distribution. The latter lacks of a certificate, so to install you need to click on "More info" and then "Run anyway" on SmartScreen prompt. + +### MacOS + +On macOS you can run `.dmg` distribution following [this guide](https://support.apple.com/guide/mac-help/mh40616/mac) to install apps from unknown developers. + +## Download + +[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/antares) [![Get it from AUR](https://raw.githubusercontent.com/Fabio286/antares/3e00c4bae6e036300c752c1a40c5a038fea9c169/docs/aur-badge.svg)](https://aur.archlinux.org/packages/antares-sql/) [![Get it from Microsoft Store](https://raw.githubusercontent.com/Fabio286/antares/gh-pages/src/assets/ms-store.png)](https://www.microsoft.com/p/antares-sql-client/9nhtb9sq51r1?cid=storebadge&ocid=badge&rtc=1&activetab=pivot:overviewtab) +🚀 **[Other Downloads](https://github.com/Fabio286/antares/releases/latest)** ## Coming soon @@ -60,6 +71,7 @@ This is a roadmap with major features will come in near future. - More context menu shortcuts. - More keyboard shortcuts. - Import/export and migration. +- Apple Silicon distribution ## Currently supported @@ -78,7 +90,7 @@ This is a roadmap with major features will come in near future. - [x] Windows - [x] Linux -- [x] MacOS (not tested due lack of hardware) +- [x] MacOS #### • ARM @@ -86,15 +98,17 @@ This is a roadmap with major features will come in near future. - [x] Linux - [ ] MacOS +## How to contribute + +- 🌍 [Translate Antares](https://github.com/Fabio286/antares/wiki/Translate-Antares) +- 📖 [Contributors Guide](https://github.com/Fabio286/antares/wiki/Contributors-Guide) +- 🚧 [Project Board](https://github.com/users/Fabio286/projects/1) + ## Translations **Italian Translation** / [Giuseppe Gigliotti](https://github.com/ReverbOD) [[#20](https://github.com/Fabio286/antares/pull/20)] -**Arabic Translation** / [Mohd-PH](https://github.com/Mohd-PH) [[#29](https://github.com/Fabio286/antares/pull/29)] -**Spanish Translation** / [hongkfui](https://github.com/hongkfui) [[#32](https://github.com/Fabio286/antares/pull/32)] -**French Translation** / [MrAnyx](https://github.com/MrAnyx) [[#44](https://github.com/Fabio286/antares/pull/44)] +**Arabic Translation** (needs updates) / [Mohd-PH](https://github.com/Mohd-PH) [[#29](https://github.com/Fabio286/antares/pull/29)] +**Spanish Translation** (needs updates) / [hongkfui](https://github.com/hongkfui) [[#32](https://github.com/Fabio286/antares/pull/32)] +**French Translation** (needs updates) / [MrAnyx](https://github.com/MrAnyx) [[#44](https://github.com/Fabio286/antares/pull/44)] **Portugues (Brasil)** / [Daniel Eduardo](https://github.com/daeleduardo) [[#54](https://github.com/Fabio286/antares/pull/54)] **Deutsch (Deutschland)** / [Christian Ratz](https://github.com/digitalgopnik) [[#74](https://github.com/Fabio286/antares/pull/74)] - -## Reviews - -Antares SQL Client review diff --git a/package.json b/package.json index fac39233..519f4a02 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "antares", "productName": "Antares", - "version": "0.3.1", + "version": "0.3.2", "description": "A cross-platform easy to use SQL client.", "license": "MIT", "repository": "https://github.com/Fabio286/antares.git", @@ -87,17 +87,17 @@ } }, "dependencies": { - "@electron/remote": "^1.2.0", + "@electron/remote": "^1.2.1", "@mdi/font": "^5.9.55", "ace-builds": "^1.4.12", - "electron-log": "^4.3.5", + "electron-log": "^4.4.1", "electron-store": "^8.0.0", "electron-updater": "^4.3.9", "faker": "^5.5.3", "marked": "^2.1.1", "moment": "^2.29.1", - "mysql2": "^2.2.5", - "pg": "^8.5.1", + "mysql2": "^2.3.0", + "pg": "^8.7.1", "pgsql-ast-parser": "^7.2.1", "source-map-support": "^0.5.16", "spectre.css": "^0.5.9", @@ -109,22 +109,22 @@ "vuex": "^3.6.2" }, "devDependencies": { - "@babel/eslint-parser": "^7.14.5", + "@babel/eslint-parser": "^7.15.0", "cross-env": "^7.0.2", - "electron": "^13.1.2", + "electron": "^13.1.8", "electron-builder": "^22.11.7", "electron-devtools-installer": "^3.2.0", "electron-webpack": "^2.8.2", "electron-webpack-vue": "^2.4.0", - "eslint": "^7.29.0", + "eslint": "^7.32.0", "eslint-config-standard": "^16.0.3", "eslint-plugin-import": "^2.23.4", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^5.1.0", - "eslint-plugin-vue": "^7.11.1", - "sass": "^1.35.1", + "eslint-plugin-vue": "^7.15.1", + "sass": "^1.37.5", "sass-loader": "^10.2.0", - "standard-version": "^9.3.0", + "standard-version": "^9.3.1", "stylelint": "^13.13.1", "stylelint-config-standard": "^22.0.0", "stylelint-scss": "^3.20.1", diff --git a/src/main/index.js b/src/main/index.js index be18a32b..f5f51005 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -1,6 +1,6 @@ 'use strict'; -import { app, BrowserWindow, /* session, */ nativeImage } from 'electron'; +import { app, BrowserWindow, /* session, */ nativeImage, Menu } from 'electron'; import * as path from 'path'; import Store from 'electron-store'; @@ -96,6 +96,7 @@ else { // create main BrowserWindow when electron is ready app.on('ready', async () => { mainWindow = await createMainWindow(); + Menu.setApplicationMenu(null); if (isDevelopment) mainWindow.webContents.openDevTools(); }); diff --git a/src/main/ipc-handlers/tables.js b/src/main/ipc-handlers/tables.js index 8c9799c2..7716d4ac 100644 --- a/src/main/ipc-handlers/tables.js +++ b/src/main/ipc-handlers/tables.js @@ -38,6 +38,16 @@ export default (connections) => { } }); + ipcMain.handle('get-table-count', async (event, params) => { + try { + const result = await connections[params.uid].getTableApproximateCount(params); + return { status: 'success', response: result }; + } + catch (err) { + return { status: 'error', response: err.toString() }; + } + }); + ipcMain.handle('get-table-indexes', async (event, params) => { try { const result = await connections[params.uid].getTableIndexes(params); diff --git a/src/main/libs/clients/MySQLClient.js b/src/main/libs/clients/MySQLClient.js index 4deb60d2..03fe2ebf 100644 --- a/src/main/libs/clients/MySQLClient.js +++ b/src/main/libs/clients/MySQLClient.js @@ -424,6 +424,19 @@ export class MySQLClient extends AntaresCore { }); } + /** + * @param {Object} params + * @param {String} params.schema + * @param {String} params.table + * @returns {Object} table row count + * @memberof MySQLClient + */ + async getTableApproximateCount ({ schema, table }) { + const { rows } = await this.raw(`SELECT table_rows "count" FROM information_schema.tables WHERE table_name = "${table}" AND table_schema = "${schema}"`); + + return rows.length ? rows[0].count : 0; + } + /** * @param {Object} params * @param {String} params.schema diff --git a/src/main/libs/clients/PostgreSQLClient.js b/src/main/libs/clients/PostgreSQLClient.js index 01cd42e8..5bc1f6e5 100644 --- a/src/main/libs/clients/PostgreSQLClient.js +++ b/src/main/libs/clients/PostgreSQLClient.js @@ -293,6 +293,19 @@ export class PostgreSQLClient extends AntaresCore { }); } + /** + * @param {Object} params + * @param {String} params.schema + * @param {String} params.table + * @returns {Object} table row count + * @memberof PostgreSQLClient + */ + async getTableApproximateCount ({ schema, table }) { + const { rows } = await this.raw(`SELECT reltuples AS count FROM pg_class WHERE relname = '${table}'`); + + return rows.length ? rows[0].count : 0; + } + /** * @param {Object} params * @param {String} params.schema diff --git a/src/renderer/components/BaseContextMenu.vue b/src/renderer/components/BaseContextMenu.vue index 87f02242..9be75aed 100644 --- a/src/renderer/components/BaseContextMenu.vue +++ b/src/renderer/components/BaseContextMenu.vue @@ -29,18 +29,23 @@ export default { }, computed: { position () { - const { clientY, clientX } = this.contextEvent; - let topCord = `${clientY + 2}px`; - let leftCord = `${clientX + 5}px`; + let topCord = 0; + let leftCord = 0; - if (this.contextSize) { - if (clientY + (this.contextSize.height < 200 ? 200 : this.contextSize.height) + 5 >= window.innerHeight) { - topCord = `${clientY + 3 - this.contextSize.height}px`; - this.isBottom = true; - } + if (this.contextEvent) { + const { clientY, clientX } = this.contextEvent; + topCord = `${clientY + 2}px`; + leftCord = `${clientX + 5}px`; + + if (this.contextSize) { + if (clientY + (this.contextSize.height < 200 ? 200 : this.contextSize.height) + 5 >= window.innerHeight) { + topCord = `${clientY + 3 - this.contextSize.height}px`; + this.isBottom = true; + } - if (clientX + this.contextSize.width + 5 >= window.innerWidth) - leftCord = `${clientX - this.contextSize.width}px`; + if (clientX + this.contextSize.width + 5 >= window.innerWidth) + leftCord = `${clientX - this.contextSize.width}px`; + } } return { @@ -53,7 +58,8 @@ export default { window.addEventListener('keydown', this.onKey); }, mounted () { - this.contextSize = this.$refs.contextContent.getBoundingClientRect(); + if (this.$refs.contextContent) + this.contextSize = this.$refs.contextContent.getBoundingClientRect(); }, beforeDestroy () { window.removeEventListener('keydown', this.onKey); diff --git a/src/renderer/components/ModalProcessesList.vue b/src/renderer/components/ModalProcessesList.vue index b5b02149..f5f46a7f 100644 --- a/src/renderer/components/ModalProcessesList.vue +++ b/src/renderer/components/ModalProcessesList.vue @@ -20,9 +20,9 @@ title="F5" @click="getProcessesList" > + + {{ $t('word.refresh') }} - -