1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

Compare commits

..

4 Commits

9 changed files with 30 additions and 14 deletions

View File

@@ -2,6 +2,13 @@
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.19-beta.1](https://github.com/antares-sql/antares/compare/v0.7.19-beta.0...v0.7.19-beta.1) (2023-10-25)
### Features
* **MySQL:** RLIKE and NOT RLIKE regular expression filters, closes [#688](https://github.com/antares-sql/antares/issues/688) ([e4eb27d](https://github.com/antares-sql/antares/commit/e4eb27d503e8f912178359c01c62a9b523d17848))
### [0.7.19-beta.0](https://github.com/antares-sql/antares/compare/v0.7.18...v0.7.19-beta.0) (2023-10-14) ### [0.7.19-beta.0](https://github.com/antares-sql/antares/compare/v0.7.18...v0.7.19-beta.0) (2023-10-14)

12
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "antares", "name": "antares",
"version": "0.7.19-beta.0", "version": "0.7.19-beta.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "antares", "name": "antares",
"version": "0.7.19-beta.0", "version": "0.7.19-beta.1",
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -63,7 +63,7 @@
"chalk": "~4.1.2", "chalk": "~4.1.2",
"cross-env": "~7.0.2", "cross-env": "~7.0.2",
"css-loader": "~6.5.0", "css-loader": "~6.5.0",
"electron": "~22.3.23", "electron": "~22.3.27",
"electron-builder": "~22.10.3", "electron-builder": "~22.10.3",
"eslint": "~7.32.0", "eslint": "~7.32.0",
"eslint-config-standard": "~16.0.3", "eslint-config-standard": "~16.0.3",
@@ -5744,9 +5744,9 @@
} }
}, },
"node_modules/electron": { "node_modules/electron": {
"version": "22.3.23", "version": "22.3.27",
"resolved": "https://registry.npmjs.org/electron/-/electron-22.3.23.tgz", "resolved": "https://registry.npmjs.org/electron/-/electron-22.3.27.tgz",
"integrity": "sha512-2p6NsLFPfM2RmgATchjKZKBUP3O6NxQMWOrHt9W5U2GRtfI8qWlicUR1wnh5D1VLt4c1YsjvpF6dct+1JNRubA==", "integrity": "sha512-7Rht21vHqj4ZFRnKuZdFqZFsvMBCmDqmjetiMqPtF+TmTBiGne1mnstVXOA/SRGhN2Qy5gY5bznJKpiqogjM8A==",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@electron/get": "^2.0.0", "@electron/get": "^2.0.0",

View File

@@ -1,7 +1,7 @@
{ {
"name": "antares", "name": "antares",
"productName": "Antares", "productName": "Antares",
"version": "0.7.19-beta.0", "version": "0.7.19-beta.1",
"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",
@@ -171,7 +171,7 @@
"chalk": "~4.1.2", "chalk": "~4.1.2",
"cross-env": "~7.0.2", "cross-env": "~7.0.2",
"css-loader": "~6.5.0", "css-loader": "~6.5.0",
"electron": "~22.3.23", "electron": "~22.3.27",
"electron-builder": "~22.10.3", "electron-builder": "~22.10.3",
"eslint": "~7.32.0", "eslint": "~7.32.0",
"eslint-config-standard": "~16.0.3", "eslint-config-standard": "~16.0.3",

View File

@@ -9,6 +9,7 @@ export const defaults: Customizations = {
dataTypes: [], dataTypes: [],
indexTypes: [], indexTypes: [],
foreignActions: [], foreignActions: [],
operators: ['=', '!=', '>', '<', '>=', '<=', 'IN', 'NOT IN', 'LIKE', 'NOT LIKE', 'BETWEEN', 'IS NULL', 'IS NOT NULL'],
// Core // Core
database: false, database: false,
collations: false, collations: false,

View File

@@ -9,6 +9,7 @@ export const customizations: Customizations = {
defaultUser: 'root', defaultUser: 'root',
defaultDatabase: null, defaultDatabase: null,
dataTypes: mysqlTypes, dataTypes: mysqlTypes,
operators: ['=', '!=', '>', '<', '>=', '<=', 'IN', 'NOT IN', 'LIKE', 'NOT LIKE', 'RLIKE', 'NOT RLIKE', 'BETWEEN', 'IS NULL', 'IS NOT NULL'],
indexTypes: [ indexTypes: [
'PRIMARY', 'PRIMARY',
'INDEX', 'INDEX',

View File

@@ -1,4 +1,5 @@
import { TypesGroup } from './antares'; import { TypesGroup } from './antares';
import { TableFilterOperator } from './tableApis';
export interface Customizations { export interface Customizations {
// Defaults // Defaults
@@ -8,6 +9,7 @@ export interface Customizations {
dataTypes?: TypesGroup[]; dataTypes?: TypesGroup[];
indexTypes?: string[]; indexTypes?: string[];
foreignActions?: string[]; foreignActions?: string[];
operators?: TableFilterOperator[];
// Core // Core
database?: boolean; database?: boolean;
collations?: boolean; collations?: boolean;

View File

@@ -21,7 +21,7 @@ export interface TableDeleteParams {
rows: {[key: string]: any}; rows: {[key: string]: any};
} }
export type TableFilterOperator = '=' | '!=' | '>' | '<' | '>=' | '<=' | 'IN' | 'NOT IN' | 'LIKE' | 'NOT LIKE' | 'BETWEEN' | 'IS NULL' | 'IS NOT NULL' export type TableFilterOperator = '=' | '!=' | '>' | '<' | '>=' | '<=' | 'IN' | 'NOT IN' | 'LIKE' | 'NOT LIKE' | 'RLIKE' | 'NOT RLIKE' | 'BETWEEN' | 'IS NULL' | 'IS NOT NULL'
export interface TableFilterClausole { export interface TableFilterClausole {
active: boolean; active: boolean;

View File

@@ -183,6 +183,7 @@
<WorkspaceTabTableFilters <WorkspaceTabTableFilters
v-if="isSearch" v-if="isSearch"
:fields="fields" :fields="fields"
:is-quering="isQuering"
:conn-client="connection.client" :conn-client="connection.client"
@filter="updateFilters" @filter="updateFilters"
@filter-change="onFilterChange" @filter-change="onFilterChange"

View File

@@ -9,6 +9,7 @@
<input <input
v-model="row.active" v-model="row.active"
type="checkbox" type="checkbox"
:disabled="isQuering"
@change="doFilter" @change="doFilter"
><i class="form-icon" /> ><i class="form-icon" />
</label> </label>
@@ -18,11 +19,13 @@
:options="fields" :options="fields"
option-track-by="name" option-track-by="name"
option-label="name" option-label="name"
:disabled="isQuering"
/> />
<BaseSelect <BaseSelect
v-model="row.op" v-model="row.op"
class="form-select ml-2 col-auto select-sm" class="form-select ml-2 col-auto select-sm"
:options="operators" :options="operators"
:disabled="isQuering"
/> />
<div class="workspace-table-filters-row-value ml-2"> <div class="workspace-table-filters-row-value ml-2">
<input <input
@@ -30,12 +33,14 @@
v-model="row.value" v-model="row.value"
type="text" type="text"
class="form-input input-sm" class="form-input input-sm"
:disabled="isQuering"
> >
<input <input
v-if="row.op === 'BETWEEN'" v-if="row.op === 'BETWEEN'"
v-model="row.value2" v-model="row.value2"
type="text" type="text"
class="form-input ml-2 input-sm" class="form-input ml-2 input-sm"
:disabled="isQuering"
> >
</div> </div>
<button <button
@@ -87,15 +92,14 @@ const { t } = useI18n();
const props = defineProps({ const props = defineProps({
fields: Array as Prop<TableField[]>, fields: Array as Prop<TableField[]>,
connClient: String as Prop<ClientCode> connClient: String as Prop<ClientCode>,
isQuering: Boolean
}); });
const emit = defineEmits(['filter-change', 'filter']); const emit = defineEmits(['filter-change', 'filter']);
const rows = ref([]); const rows = ref([]);
const operators = ref<TableFilterOperator[]>([ const operators: TableFilterOperator[] = customizations[props.connClient].operators;
'=', '!=', '>', '<', '>=', '<=', 'IN', 'NOT IN', 'LIKE', 'NOT LIKE', 'BETWEEN', 'IS NULL', 'IS NOT NULL'
]);
const clientCustomizations = computed(() => customizations[props.connClient]); const clientCustomizations = computed(() => customizations[props.connClient]);
@@ -122,7 +126,7 @@ const createClausole = (filter: TableFilterClausole) => {
const { elementsWrapper: ew, stringsWrapper: sw } = clientCustomizations.value; const { elementsWrapper: ew, stringsWrapper: sw } = clientCustomizations.value;
let value; let value;
if (isNumeric && !['IN', 'NOT IN'].includes(filter.op)) { if (isNumeric && !['IN', 'NOT IN', 'RLIKE', 'NOT RLIKE'].includes(filter.op)) {
if (isNaN(Number(filter.value))) if (isNaN(Number(filter.value)))
filter.value = ''; filter.value = '';
if (isNaN(Number(filter.value2))) if (isNaN(Number(filter.value2)))