mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
Compare commits
27 Commits
Author | SHA1 | Date | |
---|---|---|---|
3ddfd6bb44 | |||
c48266c336 | |||
96e1ceb1d2 | |||
19859f45f4 | |||
74c136f833 | |||
af91d96db6 | |||
0cd55fbfe9 | |||
55aee163b6 | |||
|
eb172022fa | ||
|
0d5cac27ed | ||
baef4ea4d1 | |||
6b3b22a01a | |||
ebf7780c3c | |||
0f24c80e5a | |||
afa61a9bc2 | |||
8be9f932e7 | |||
d802b32597 | |||
28f0419af4 | |||
52108d7613 | |||
df6625af49 | |||
59846e6ff4 | |||
63fece2a1b | |||
9ef475ec3f | |||
3546c57e39 | |||
8730be02af | |||
b925ff9c01 | |||
2c46269cf2 |
@@ -202,6 +202,15 @@
|
||||
"contributions": [
|
||||
"translation"
|
||||
]
|
||||
},
|
||||
{
|
||||
"login": "555cider",
|
||||
"name": "555cider",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/73565447?v=4",
|
||||
"profile": "https://github.com/555cider",
|
||||
"contributions": [
|
||||
"translation"
|
||||
]
|
||||
}
|
||||
],
|
||||
"contributorsPerLine": 7,
|
||||
|
11
.github/workflows/create-artifact-linux.yml
vendored
11
.github/workflows/create-artifact-linux.yml
vendored
@@ -14,11 +14,12 @@ jobs:
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: npm install & build
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm i
|
||||
|
||||
- name: "Build"
|
||||
run: npm run build
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
|
47
CHANGELOG.md
47
CHANGELOG.md
@@ -2,6 +2,53 @@
|
||||
|
||||
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.9](https://github.com/antares-sql/antares/compare/v0.7.8...v0.7.9) (2023-05-01)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* no table results message ([19859f4](https://github.com/antares-sql/antares/commit/19859f45f4457292b6ecfe79bdcfbdcc7722be06))
|
||||
* option to choose the target table of an SQL INSERT exportation, closes [#556](https://github.com/antares-sql/antares/issues/556) ([c48266c](https://github.com/antares-sql/antares/commit/c48266c336d7c61abe2b56b5702e5bca83bb57b3))
|
||||
* **translation:** ko-KR translation, closes [#561](https://github.com/antares-sql/antares/issues/561) ([baef4ea](https://github.com/antares-sql/antares/commit/baef4ea4d1747233a86b90fe5b60a0d6cfba1f1c))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* sidebar height out of visible area ([af91d96](https://github.com/antares-sql/antares/commit/af91d96db6e79222e5dbc9b880a904a40332c09b))
|
||||
* unable to delete rows with null values and no primary key ([74c136f](https://github.com/antares-sql/antares/commit/74c136f8334b6972ae55dd8ee0ade09ef8ae3282))
|
||||
* vertical scrollbar does not reset after performing a search, fixes [#567](https://github.com/antares-sql/antares/issues/567) ([0cd55fb](https://github.com/antares-sql/antares/commit/0cd55fbfe9ff09589ae5993f16b0dd56a2ea1a5a))
|
||||
|
||||
|
||||
### Improvements
|
||||
|
||||
* **translation:** update italian translation ([96e1ceb](https://github.com/antares-sql/antares/commit/96e1ceb1d2488390216553cd3fce2eec261f04eb))
|
||||
|
||||
### [0.7.8](https://github.com/antares-sql/antares/compare/v0.7.7...v0.7.8) (2023-04-12)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* filter schemas in sidebar, closes [#555](https://github.com/antares-sql/antares/issues/555) ([8be9f93](https://github.com/antares-sql/antares/commit/8be9f932e7a44b2067d8b57950d8faafc577123f))
|
||||
* **MySQL:** option to export from results SQL INSERTS in chunks, closes [#501](https://github.com/antares-sql/antares/issues/501) ([0f24c80](https://github.com/antares-sql/antares/commit/0f24c80e5a2dc45875df6b67d3c097cf1cca458e))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **MySQL:** missing scale for FLOAT type ([52108d7](https://github.com/antares-sql/antares/commit/52108d76133d5fdffb56faa995d7ab7ee3e7c4bc))
|
||||
* triggers not exported if related table not included ([d802b32](https://github.com/antares-sql/antares/commit/d802b32597e42ee90a2d691fe74245b3bc2517ee))
|
||||
* unable to export BLOB values from table content o query result ([afa61a9](https://github.com/antares-sql/antares/commit/afa61a9bc2d698894096a6b5413c49f05b2fd5aa))
|
||||
|
||||
### [0.7.7](https://github.com/antares-sql/antares/compare/v0.7.6...v0.7.7) (2023-03-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* hide table size tooltip if disabled ([2c46269](https://github.com/antares-sql/antares/commit/2c46269cf262248d3f5644b7c5b89d5d317a89a4))
|
||||
* **Linux:** remove app menu shown pressing ALT key ([63fece2](https://github.com/antares-sql/antares/commit/63fece2a1b6b09f61ae416f7c3a7b51ee0a53d0e))
|
||||
* **Linux:** remove app menu shown pressing ALT key ([b925ff9](https://github.com/antares-sql/antares/commit/b925ff9c01afcc727e5d70bafb079d468ed1eede))
|
||||
* **MySQL:** missing table information in table setting tab ([59846e6](https://github.com/antares-sql/antares/commit/59846e6ff47591ec8dc22403c3be0e70e0f3ccfd))
|
||||
* unable to set string fields default values starting with 0 ([3546c57](https://github.com/antares-sql/antares/commit/3546c57e398be7b2e226bb8e93e8fc0fb8bab40a))
|
||||
|
||||
### [0.7.6](https://github.com/antares-sql/antares/compare/v0.7.5...v0.7.6) (2023-02-27)
|
||||
|
||||
|
||||
|
@@ -144,6 +144,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
||||
<td align="center" valign="top" width="14.28%"><a href="http://yaskur.net"><img src="https://avatars.githubusercontent.com/u/9539970?v=4?s=100" width="100px;" alt="Muhammad Dyas Yaskur"/><br /><sub><b>Muhammad Dyas Yaskur</b></sub></a><br /><a href="#translation-dyaskur" title="Translation">🌍</a> <a href="https://github.com/antares-sql/antares/commits?author=dyaskur" title="Code">💻</a></td>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jimcat8"><img src="https://avatars.githubusercontent.com/u/86754294?v=4?s=100" width="100px;" alt="tianci li"/><br /><sub><b>tianci li</b></sub></a><br /><a href="#translation-jimcat8" title="Translation">🌍</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/555cider"><img src="https://avatars.githubusercontent.com/u/73565447?v=4?s=100" width="100px;" alt="555cider"/><br /><sub><b>555cider</b></sub></a><br /><a href="#translation-555cider" title="Translation">🌍</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "antares",
|
||||
"version": "0.7.6",
|
||||
"version": "0.7.9",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "antares",
|
||||
"version": "0.7.6",
|
||||
"version": "0.7.9",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "antares",
|
||||
"productName": "Antares",
|
||||
"version": "0.7.6",
|
||||
"version": "0.7.9",
|
||||
"description": "A modern, fast and productivity driven SQL client with a focus in UX.",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/antares-sql/antares.git",
|
||||
|
@@ -54,6 +54,7 @@ export default [
|
||||
{
|
||||
name: 'FLOAT',
|
||||
length: true,
|
||||
scale: true,
|
||||
collation: false,
|
||||
unsigned: false,
|
||||
zerofill: false
|
||||
|
@@ -72,7 +72,7 @@ export const escapeAndQuote = (val: string, client: ClientCode) => {
|
||||
export const valueToSqlString = (args: {
|
||||
val: any;
|
||||
client: ClientCode;
|
||||
field: {type: string; datePrecision: number};
|
||||
field: {type: string; datePrecision: number; isArray?: boolean};
|
||||
}): string => {
|
||||
let parsedValue;
|
||||
const { val, client, field } = args;
|
||||
@@ -94,7 +94,7 @@ export const valueToSqlString = (args: {
|
||||
? escapeAndQuote(moment(val).format(`YYYY-MM-DD HH:mm:ss${datePrecision}`), client)
|
||||
: escapeAndQuote(val, client);
|
||||
}
|
||||
else if ('isArray' in field) {
|
||||
else if ('isArray' in field && field.isArray) {
|
||||
let localVal;
|
||||
if (Array.isArray(val))
|
||||
localVal = JSON.stringify(val).replaceAll('[', '{').replaceAll(']', '}');
|
||||
@@ -107,10 +107,16 @@ export const valueToSqlString = (args: {
|
||||
else if (BIT.includes(field.type))
|
||||
parsedValue = `b'${hexToBinary(Buffer.from(val).toString('hex') as undefined as HexChar[])}'`;
|
||||
else if (BLOB.includes(field.type)) {
|
||||
let buffer: Buffer;
|
||||
if (val instanceof Uint8Array)
|
||||
buffer = Buffer.from(val);
|
||||
else
|
||||
buffer = val;
|
||||
|
||||
if (['mysql', 'maria'].includes(client))
|
||||
parsedValue = `X'${val.toString('hex').toUpperCase()}'`;
|
||||
parsedValue = `X'${buffer.toString('hex').toUpperCase()}'`;
|
||||
else if (client === 'pg')
|
||||
parsedValue = `decode('${val.toString('hex').toUpperCase()}', 'hex')`;
|
||||
parsedValue = `decode('${buffer.toString('hex').toUpperCase()}', 'hex')`;
|
||||
}
|
||||
else if (NUMBER.includes(field.type))
|
||||
parsedValue = val;
|
||||
@@ -146,17 +152,47 @@ export const valueToSqlString = (args: {
|
||||
};
|
||||
|
||||
export const jsonToSqlInsert = (args: {
|
||||
json: { [key: string]: any};
|
||||
json: { [key: string]: any}[];
|
||||
client: ClientCode;
|
||||
fields: { [key: string]: {type: string; datePrecision: number}};
|
||||
table: string;
|
||||
options?: {sqlInsertAfter: number; sqlInsertDivider: 'bytes' | 'rows'};
|
||||
}) => {
|
||||
const { client, json, fields, table } = args;
|
||||
const { client, json, fields, table, options } = args;
|
||||
const sqlInsertAfter = options && options.sqlInsertAfter ? options.sqlInsertAfter : 1;
|
||||
const sqlInsertDivider = options && options.sqlInsertDivider ? options.sqlInsertDivider : 'rows';
|
||||
const { elementsWrapper: ew } = customizations[client];
|
||||
const fieldNames = Object.keys(json).map(key => `${ew}${key}${ew}`);
|
||||
const values = Object.keys(json).map(key => (
|
||||
valueToSqlString({ val: json[key], client, field: fields[key] })
|
||||
));
|
||||
const fieldNames = Object.keys(json[0]).map(key => `${ew}${key}${ew}`);
|
||||
let insertStmt = `INSERT INTO ${ew}${table}${ew} (${fieldNames.join(', ')}) VALUES `;
|
||||
let insertsString = '';
|
||||
let queryLength = 0;
|
||||
let rowsWritten = 0;
|
||||
|
||||
return `INSERT INTO ${ew}${table}${ew} (${fieldNames.join(', ')}) VALUES (${values.join(', ')});`;
|
||||
for (const row of json) {
|
||||
const values = [];
|
||||
|
||||
values.push(Object.keys(row).map(key => (
|
||||
valueToSqlString({ val: row[key], client, field: fields[key] })
|
||||
)));
|
||||
|
||||
if (
|
||||
(sqlInsertDivider === 'bytes' && queryLength >= sqlInsertAfter * 1024) ||
|
||||
(sqlInsertDivider === 'rows' && rowsWritten === sqlInsertAfter)
|
||||
) {
|
||||
insertsString += insertStmt+';';
|
||||
insertStmt = `\nINSERT INTO ${ew}${table}${ew} (${fieldNames.join(', ')}) VALUES `;
|
||||
rowsWritten = 0;
|
||||
}
|
||||
rowsWritten++;
|
||||
|
||||
if (rowsWritten > 1) insertStmt += ',\n';
|
||||
|
||||
insertStmt += `(${values.join(',')})`;
|
||||
queryLength = insertStmt.length;
|
||||
}
|
||||
|
||||
if (rowsWritten > 0)
|
||||
insertsString += insertStmt+';';
|
||||
|
||||
return insertsString;
|
||||
};
|
||||
|
@@ -247,7 +247,10 @@ export default (connections: {[key: string]: antares.Client}) => {
|
||||
if (typeof row[key] === 'string')
|
||||
row[key] = `'${row[key]}'`;
|
||||
|
||||
row[key] = `= ${row[key]}`;
|
||||
if (row[key] === null)
|
||||
row[key] = 'IS NULL';
|
||||
else
|
||||
row[key] = `= ${row[key]}`;
|
||||
}
|
||||
|
||||
await connections[params.uid]
|
||||
|
@@ -75,7 +75,7 @@ export class ShortcutRegister {
|
||||
for (const key of shortcut.keys) {
|
||||
try {
|
||||
this._menu.append(new MenuItem({
|
||||
label: 'Shortcuts',
|
||||
label: '.',
|
||||
visible: false,
|
||||
submenu: [{
|
||||
label: String(key),
|
||||
|
@@ -184,9 +184,9 @@ CREATE TABLE \`${view.Name}\`(
|
||||
const { rows: triggers } = await this._client.raw(
|
||||
`SHOW TRIGGERS FROM \`${this.schemaName}\``
|
||||
);
|
||||
const generatedTables = this._tables
|
||||
.filter(t => t.includeStructure)
|
||||
.map(t => t.table);
|
||||
// const generatedTables = this._tables
|
||||
// .filter(t => t.includeStructure)
|
||||
// .map(t => t.table);
|
||||
|
||||
let sqlString = '';
|
||||
|
||||
@@ -200,7 +200,7 @@ CREATE TABLE \`${view.Name}\`(
|
||||
sql_mode: sqlMode
|
||||
} = trigger;
|
||||
|
||||
if (!generatedTables.includes(table)) continue;
|
||||
// if (!generatedTables.includes(table)) continue;// Commented to avoid issues if export contains triggers without tables
|
||||
|
||||
const definer = this.getEscapedDefiner(trigger.Definer);
|
||||
sqlString += '/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;;\n';
|
||||
|
@@ -172,9 +172,6 @@ function createAppMenu () {
|
||||
{
|
||||
role: 'editMenu'
|
||||
},
|
||||
{
|
||||
role: 'viewMenu'
|
||||
},
|
||||
{
|
||||
role: 'windowMenu'
|
||||
}
|
||||
|
@@ -130,6 +130,12 @@ onMounted(() => {
|
||||
node = node.parentNode;
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('keydown', e => {
|
||||
if (e.altKey && e.key === 'Alt') { // Prevent Alt key to trigger hidden shortcut menu
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<div class="modal-header pl-2">
|
||||
<div class="modal-title h6">
|
||||
<div class="d-flex">
|
||||
<i class="mdi mdi-24px mdi-database-arrow-down mr-1" />
|
||||
<i class="mdi mdi-24px mdi-database-export mr-1" />
|
||||
<span class="cut-text">{{ t('message.exportSchema') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -78,7 +78,7 @@
|
||||
<div ref="table" class="table table-hover">
|
||||
<div class="thead">
|
||||
<div class="tr text-center">
|
||||
<div class="th no-border" style="width: 50%;" />
|
||||
<div class="th no-border" :style="'width: 50%;'" />
|
||||
<div class="th no-border">
|
||||
<label
|
||||
class="form-checkbox m-0 px-2 form-inline"
|
||||
@@ -120,7 +120,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="tr">
|
||||
<div class="th" style="width: 50%;">
|
||||
<div class="th" :style="'width: 50%;'">
|
||||
<div class="table-column-title">
|
||||
<span>{{ t('word.table') }}</span>
|
||||
</div>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<div class="modal-header pl-2">
|
||||
<div class="modal-title h6">
|
||||
<div class="d-flex">
|
||||
<i class="mdi mdi-24px mdi-database-arrow-up mr-1" />
|
||||
<i class="mdi mdi-24px mdi-database-import mr-1" />
|
||||
<span class="cut-text">{{ t('message.importSchema') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -32,13 +32,20 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="workspace-explorebar-search">
|
||||
<div v-if="workspace.connectionStatus === 'connected'" class="has-icon-right">
|
||||
<div v-if="workspace.connectionStatus === 'connected'" class="input-group has-icon-right">
|
||||
<div
|
||||
class="input-group-addon px-1 py-0 p-vcentered c-hand"
|
||||
:title="t('message.switchSearchMethod')"
|
||||
@click="toggleSearchMethod"
|
||||
>
|
||||
<i class="mdi mdi-18px" :class="[searchMethod === 'elements' ? 'mdi-shape' : 'mdi-database']" />
|
||||
</div>
|
||||
<input
|
||||
ref="searchInput"
|
||||
v-model="searchTerm"
|
||||
class="form-input input-sm"
|
||||
type="text"
|
||||
:placeholder="t('message.searchForElements')"
|
||||
:placeholder="searchMethod === 'elements' ? t('message.searchForElements') : t('message.searchForSchemas')"
|
||||
>
|
||||
<i v-if="!searchTerm" class="form-icon mdi mdi-magnify mdi-18px" />
|
||||
<i
|
||||
@@ -50,11 +57,12 @@
|
||||
</div>
|
||||
<div class="workspace-explorebar-body" @click="explorebar.focus()">
|
||||
<WorkspaceExploreBarSchema
|
||||
v-for="db of workspace.structure"
|
||||
v-for="db of filteredSchemas"
|
||||
:key="db.name"
|
||||
ref="schema"
|
||||
:database="db"
|
||||
:connection="connection"
|
||||
:search-method="searchMethod"
|
||||
@show-schema-context="openSchemaContext"
|
||||
@show-table-context="openTableContext"
|
||||
@show-misc-context="openMiscContext"
|
||||
@@ -181,6 +189,7 @@ const selectedSchema = ref('');
|
||||
const selectedTable = ref(null);
|
||||
const selectedMisc = ref(null);
|
||||
const searchTerm = ref('');
|
||||
const searchMethod: Ref<'elements' | 'schemas'> = ref('elements');
|
||||
|
||||
const workspace = computed(() => {
|
||||
return getWorkspace(props.connection.uid);
|
||||
@@ -194,6 +203,13 @@ const customizations = computed(() => {
|
||||
return workspace.value.customizations;
|
||||
});
|
||||
|
||||
const filteredSchemas = computed(() => {
|
||||
if (searchMethod.value === 'schemas')
|
||||
return workspace.value.structure.filter(schema => schema.name.search(searchTerm.value) >= 0);
|
||||
else
|
||||
return workspace.value.structure;
|
||||
});
|
||||
|
||||
watch(localWidth, (val: number) => {
|
||||
clearTimeout(explorebarWidthInterval.value);
|
||||
|
||||
@@ -403,6 +419,15 @@ const duplicateTable = async (payload: { schema: string; table: { name: string }
|
||||
});
|
||||
};
|
||||
|
||||
const toggleSearchMethod = () => {
|
||||
searchTerm.value = '';
|
||||
setSearchTerm(searchTerm.value);
|
||||
|
||||
if (searchMethod.value === 'elements')
|
||||
searchMethod.value = 'schemas';
|
||||
else
|
||||
searchMethod.value = 'elements';
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@@ -478,6 +503,8 @@ const duplicateTable = async (payload: { schema: string; table: { name: string }
|
||||
justify-content: space-between;
|
||||
font-size: 0.6rem;
|
||||
height: 28px;
|
||||
margin: 5px 0;
|
||||
z-index: 10;
|
||||
|
||||
.has-icon-right {
|
||||
width: 100%;
|
||||
@@ -491,6 +518,7 @@ const duplicateTable = async (payload: { schema: string; table: { name: string }
|
||||
.form-input {
|
||||
height: 1.2rem;
|
||||
padding-left: 0.2rem;
|
||||
border-radius:0 $border-radius $border-radius 0;
|
||||
|
||||
&:focus + .form-icon {
|
||||
opacity: 0.9;
|
||||
@@ -505,7 +533,7 @@ const duplicateTable = async (payload: { schema: string; table: { name: string }
|
||||
|
||||
.workspace-explorebar-body {
|
||||
width: 100%;
|
||||
height: calc((100vh - 58px) - #{$excluding-size});
|
||||
height: calc((100vh - 68px) - #{$excluding-size});
|
||||
overflow: overlay;
|
||||
padding: 0 0.1rem;
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<i v-else class="icon mdi mdi-18px mdi-chevron-right" />
|
||||
<i class="database-icon mdi mdi-18px mdi-database mr-1" />
|
||||
<div class="">
|
||||
<span>{{ database.name }}</span>
|
||||
<span v-html="highlightWord(database.name, 'schemas')" />
|
||||
<div
|
||||
v-if="database.size"
|
||||
class="schema-size tooltip tooltip-left mr-1"
|
||||
@@ -42,7 +42,7 @@
|
||||
<span v-html="highlightWord(table.name)" />
|
||||
</a>
|
||||
<div
|
||||
v-if="table.type === 'table' && table.size !== false"
|
||||
v-if="table.type === 'table' && table.size !== false && !isNaN(table.size)"
|
||||
class="table-size tooltip tooltip-left mr-1"
|
||||
:data-tooltip="formatBytes(table.size)"
|
||||
>
|
||||
@@ -249,7 +249,8 @@ const { t } = useI18n();
|
||||
|
||||
const props = defineProps({
|
||||
database: Object as Prop<WorkspaceStructure>,
|
||||
connection: Object
|
||||
connection: Object,
|
||||
searchMethod: String as Prop<'elements' | 'schemas'>
|
||||
});
|
||||
|
||||
const emit = defineEmits([
|
||||
@@ -282,29 +283,51 @@ const searchTerm = computed(() => {
|
||||
});
|
||||
|
||||
const filteredTables = computed(() => {
|
||||
return props.database.tables.filter(table => table.name.search(searchTerm.value) >= 0);
|
||||
if (props.searchMethod === 'elements')
|
||||
return props.database.tables.filter(table => table.name.search(searchTerm.value) >= 0);
|
||||
else
|
||||
return props.database.tables;
|
||||
});
|
||||
|
||||
const filteredTriggers = computed(() => {
|
||||
return props.database.triggers.filter(trigger => trigger.name.search(searchTerm.value) >= 0);
|
||||
if (props.searchMethod === 'elements')
|
||||
return props.database.triggers.filter(trigger => trigger.name.search(searchTerm.value) >= 0);
|
||||
else
|
||||
return props.database.triggers;
|
||||
});
|
||||
|
||||
const filteredProcedures = computed(() => {
|
||||
return props.database.procedures.filter(procedure => procedure.name.search(searchTerm.value) >= 0);
|
||||
if (props.searchMethod === 'elements')
|
||||
return props.database.procedures.filter(procedure => procedure.name.search(searchTerm.value) >= 0);
|
||||
else
|
||||
return props.database.procedures;
|
||||
});
|
||||
|
||||
const filteredFunctions = computed(() => {
|
||||
return props.database.functions.filter(func => func.name.search(searchTerm.value) >= 0);
|
||||
if (props.searchMethod === 'elements')
|
||||
return props.database.functions.filter(func => func.name.search(searchTerm.value) >= 0);
|
||||
else
|
||||
return props.database.functions;
|
||||
});
|
||||
|
||||
const filteredTriggerFunctions = computed(() => {
|
||||
return props.database.triggerFunctions
|
||||
? props.database.triggerFunctions.filter(func => func.name.search(searchTerm.value) >= 0)
|
||||
: [];
|
||||
if (props.searchMethod === 'elements') {
|
||||
return props.database.triggerFunctions
|
||||
? props.database.triggerFunctions.filter(func => func.name.search(searchTerm.value) >= 0)
|
||||
: [];
|
||||
}
|
||||
else {
|
||||
return props.database.triggerFunctions
|
||||
? props.database.triggerFunctions
|
||||
: [];
|
||||
}
|
||||
});
|
||||
|
||||
const filteredSchedulers = computed(() => {
|
||||
return props.database.schedulers.filter(scheduler => scheduler.name.search(searchTerm.value) >= 0);
|
||||
if (props.searchMethod === 'elements')
|
||||
return props.database.schedulers.filter(scheduler => scheduler.name.search(searchTerm.value) >= 0);
|
||||
else
|
||||
return props.database.schedulers;
|
||||
});
|
||||
|
||||
const workspace = computed(() => {
|
||||
@@ -446,10 +469,10 @@ const setBreadcrumbs = (payload: Breadcrumb) => {
|
||||
changeBreadcrumbs(payload);
|
||||
};
|
||||
|
||||
const highlightWord = (string: string) => {
|
||||
const highlightWord = (string: string, type = 'elements') => {
|
||||
string = string.replaceAll('<', '<').replaceAll('>', '>');
|
||||
|
||||
if (searchTerm.value) {
|
||||
if (searchTerm.value && props.searchMethod === type) {
|
||||
const regexp = new RegExp(`(${searchTerm.value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')})`, 'gi');
|
||||
return string.replace(regexp, '<span class="text-primary">$1</span>');
|
||||
}
|
||||
|
@@ -63,14 +63,14 @@
|
||||
class="context-element"
|
||||
@click="showExportSchemaModal"
|
||||
>
|
||||
<span class="d-flex"><i class="mdi mdi-18px mdi-database-arrow-down text-light pr-1" /> {{ t('word.export') }}</span>
|
||||
<span class="d-flex"><i class="mdi mdi-18px mdi-database-export text-light pr-1" /> {{ t('word.export') }}</span>
|
||||
</div>
|
||||
<div
|
||||
v-if="workspace.customizations.schemaImport"
|
||||
class="context-element"
|
||||
@click="initImport"
|
||||
>
|
||||
<span class="d-flex"><i class="mdi mdi-18px mdi-database-arrow-up text-light pr-1" /> {{ t('word.import') }}</span>
|
||||
<span class="d-flex"><i class="mdi mdi-18px mdi-database-import text-light pr-1" /> {{ t('word.import') }}</span>
|
||||
</div>
|
||||
<div
|
||||
v-if="workspace.customizations.schemaEdit"
|
||||
|
@@ -187,6 +187,7 @@ import WorkspaceTabPropsTableFields from '@/components/WorkspaceTabPropsTableFie
|
||||
import WorkspaceTabPropsTableIndexesModal from '@/components/WorkspaceTabPropsTableIndexesModal.vue';
|
||||
import WorkspaceTabPropsTableForeignModal from '@/components/WorkspaceTabPropsTableForeignModal.vue';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { useSettingsStore } from '@/stores/settings';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
@@ -200,8 +201,10 @@ const props = defineProps({
|
||||
|
||||
const { addNotification } = useNotificationsStore();
|
||||
const workspacesStore = useWorkspacesStore();
|
||||
const settingsStore = useSettingsStore();
|
||||
|
||||
const { getSelected: selectedWorkspace } = storeToRefs(workspacesStore);
|
||||
const { showTableSize } = settingsStore;
|
||||
|
||||
const {
|
||||
getWorkspace,
|
||||
@@ -257,7 +260,7 @@ const isChanged = computed(() => {
|
||||
const getTableOptions = async (params: {uid: string; schema: string; table: string}) => {
|
||||
const db = workspace.value.structure.find(db => db.name === props.schema);
|
||||
|
||||
if (db && db.tables.length && props.table)
|
||||
if (db && db.tables.length && props.table && showTableSize)
|
||||
tableOptions.value = db.tables.find(table => table.name === props.table);
|
||||
else {
|
||||
const { status, response } = await Tables.getTableOptions(params);
|
||||
|
@@ -532,7 +532,10 @@ const editOFF = () => {
|
||||
break;
|
||||
case 'custom':
|
||||
localRow.value.autoIncrement = false;
|
||||
localRow.value.default = Number.isNaN(+defaultValue.value.custom) ? `'${defaultValue.value.custom}'` : defaultValue.value.custom;
|
||||
if (fieldType.value.group === 'string')
|
||||
localRow.value.default = `'${defaultValue.value.custom}'`;
|
||||
else
|
||||
localRow.value.default = defaultValue.value.custom;
|
||||
break;
|
||||
case 'expression':
|
||||
localRow.value.autoIncrement = false;
|
||||
|
@@ -31,7 +31,7 @@
|
||||
:class="{'active': resultsetIndex === index}"
|
||||
@click="selectResultset(index)"
|
||||
>
|
||||
<a>{{ result.fields ? result.fields[0].table : '' }} ({{ result.rows.length }})</a>
|
||||
<a>{{ result.fields ? result.fields[0]?.table : '' }} ({{ result.rows.length }})</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div ref="table" class="table table-hover">
|
||||
@@ -111,6 +111,47 @@
|
||||
</div>
|
||||
</template>
|
||||
</ConfirmModal>
|
||||
|
||||
<ConfirmModal
|
||||
v-if="chunkModalRequest"
|
||||
@confirm="downloadTable('sql', chunkModalRequest as string, true)"
|
||||
@hide="chunkModalRequest = false"
|
||||
>
|
||||
<template #header>
|
||||
<div class="d-flex">
|
||||
<i class="mdi mdi-24px mdi-file-export mr-1" />
|
||||
<span class="cut-text">{{ t('message.sqlExportOptions') }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #body>
|
||||
<div class="columns">
|
||||
<label class="column col-12 h6 mb-2 cut-text">{{ t('message.targetTable') }}</label>
|
||||
<div class="column col-12">
|
||||
<input
|
||||
v-model.number="sqlExportOptions.targetTable"
|
||||
type="text"
|
||||
class="form-input"
|
||||
:placeholder="chunkModalRequest"
|
||||
>
|
||||
</div>
|
||||
<label class="column col-12 h6 mb-2 mt-4 cut-text">{{ t('message.newInserStmtEvery') }}:</label>
|
||||
<div class="column col-6">
|
||||
<input
|
||||
v-model.number="sqlExportOptions.sqlInsertAfter"
|
||||
type="number"
|
||||
class="form-input"
|
||||
>
|
||||
</div>
|
||||
<div class="column col-6">
|
||||
<BaseSelect
|
||||
v-model="sqlExportOptions.sqlInsertDivider"
|
||||
class="form-select"
|
||||
:options="[{value: 'bytes', label: 'KiB'}, {value: 'rows', label: t('word.row', 2)}]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</ConfirmModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -128,6 +169,7 @@ import BaseVirtualScroll from '@/components/BaseVirtualScroll.vue';
|
||||
import WorkspaceTabQueryTableRow from '@/components/WorkspaceTabQueryTableRow.vue';
|
||||
import TableContext from '@/components/WorkspaceTabQueryTableContext.vue';
|
||||
import ConfirmModal from '@/components/BaseConfirmModal.vue';
|
||||
import BaseSelect from '@/components/BaseSelect.vue';
|
||||
import * as moment from 'moment';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { TableField, QueryResult } from 'common/interfaces/antares';
|
||||
@@ -179,9 +221,16 @@ const scrollElement = ref(null);
|
||||
const rowHeight = ref(23);
|
||||
const selectedField = ref(null);
|
||||
const isEditingRow = ref(false);
|
||||
const chunkModalRequest: Ref<false | string> = ref(false);
|
||||
const sqlExportOptions = ref({
|
||||
sqlInsertAfter: 250,
|
||||
sqlInsertDivider: 'bytes' as 'bytes' | 'rows',
|
||||
targetTable: ''
|
||||
});
|
||||
|
||||
const workspaceSchema = computed(() => getWorkspace(props.connUid).breadcrumbs.schema);
|
||||
const workspaceClient = computed(() => getWorkspace(props.connUid).client);
|
||||
const customizations = computed(() => getWorkspace(props.connUid).customizations);
|
||||
|
||||
const primaryField = computed(() => {
|
||||
const primaryFields = fields.value.filter(field => field.key === 'pri');
|
||||
@@ -219,7 +268,7 @@ const sortedResults = computed(() => {
|
||||
return localResults.value;
|
||||
});
|
||||
|
||||
const resultsWithRows = computed(() => props.results.filter(result => result.rows));
|
||||
const resultsWithRows = computed(() => props.results.filter(result => result.rows.length));
|
||||
const fields = computed(() => resultsWithRows.value.length ? resultsWithRows.value[resultsetIndex.value].fields : []);
|
||||
const keyUsage = computed(() => resultsWithRows.value.length ? resultsWithRows.value[resultsetIndex.value].keys : []);
|
||||
|
||||
@@ -438,20 +487,17 @@ const copyRow = (format: string) => {
|
||||
if (format === 'json')
|
||||
navigator.clipboard.writeText(JSON.stringify(contentToCopy));
|
||||
else if (format === 'sql') {
|
||||
const sqlInserts = [];
|
||||
if (!Array.isArray(contentToCopy)) contentToCopy = [contentToCopy];
|
||||
|
||||
for (const row of contentToCopy) {
|
||||
sqlInserts.push(jsonToSqlInsert({
|
||||
json: row,
|
||||
client: workspaceClient.value,
|
||||
fields: fieldsObj.value as {
|
||||
[key: string]: {type: string; datePrecision: number};
|
||||
},
|
||||
table: getTable(resultsetIndex.value)
|
||||
}));
|
||||
}
|
||||
navigator.clipboard.writeText(sqlInserts.join('\n'));
|
||||
const sqlInserts = jsonToSqlInsert({
|
||||
json: contentToCopy,
|
||||
client: workspaceClient.value,
|
||||
fields: fieldsObj.value as {
|
||||
[key: string]: {type: string; datePrecision: number};
|
||||
},
|
||||
table: getTable(resultsetIndex.value)
|
||||
});
|
||||
navigator.clipboard.writeText(sqlInserts);
|
||||
}
|
||||
else if (format === 'csv') {
|
||||
const csv = [];
|
||||
@@ -665,22 +711,36 @@ const selectResultset = (index: number) => {
|
||||
resultsetIndex.value = index;
|
||||
};
|
||||
|
||||
const downloadTable = (format: 'csv' | 'json' | 'sql', table: string) => {
|
||||
const downloadTable = (format: 'csv' | 'json' | 'sql', table: string, chunks = false) => {
|
||||
if (!sortedResults.value) return;
|
||||
|
||||
const rows = JSON.parse(JSON.stringify(sortedResults.value)).map((row: any) => {
|
||||
delete row._antares_id;
|
||||
return row;
|
||||
if (format === 'sql' && !chunks && customizations.value.exportByChunks) {
|
||||
sqlExportOptions.value = {
|
||||
sqlInsertAfter: 250,
|
||||
sqlInsertDivider: 'bytes' as 'bytes' | 'rows',
|
||||
targetTable: ''
|
||||
};
|
||||
chunkModalRequest.value = table;
|
||||
return;
|
||||
}
|
||||
else
|
||||
chunkModalRequest.value = false;
|
||||
|
||||
const rows = sortedResults.value.map((row: any) => {
|
||||
const clonedRow = { ...row };
|
||||
delete clonedRow._antares_id;
|
||||
return clonedRow;
|
||||
});
|
||||
|
||||
exportRows({
|
||||
type: format,
|
||||
content: rows,
|
||||
fields: fieldsObj.value as {
|
||||
fields: JSON.parse(JSON.stringify(fieldsObj.value)) as {
|
||||
[key: string]: {type: string; datePrecision: number};
|
||||
},
|
||||
client: workspaceClient.value,
|
||||
table
|
||||
table,
|
||||
sqlOptions: chunks ? { ...sqlExportOptions.value }: null
|
||||
});
|
||||
};
|
||||
|
||||
|
@@ -145,6 +145,14 @@
|
||||
/>
|
||||
<div class="workspace-query-results p-relative column col-12">
|
||||
<BaseLoader v-if="isQuering" />
|
||||
<div v-if="!isQuering && !results[0]?.rows.length" class="empty">
|
||||
<div class="empty-icon">
|
||||
<i class="mdi mdi-48px mdi-island" />
|
||||
</div>
|
||||
<p class="h4 empty-subtitle">
|
||||
{{ t('message.noResultsPresent') }}
|
||||
</p>
|
||||
</div>
|
||||
<WorkspaceTabQueryTable
|
||||
v-if="results"
|
||||
ref="queryTable"
|
||||
@@ -381,6 +389,7 @@ const resizeScroller = () => {
|
||||
|
||||
const updateFilters = (clausoles: TableFilterClausole[]) => {
|
||||
filters.value = clausoles;
|
||||
results.value = [];
|
||||
getTableData();
|
||||
};
|
||||
|
||||
|
@@ -337,7 +337,12 @@ export const enUS = {
|
||||
executeSelectedQuery: 'Execute selected query',
|
||||
defaultCopyType: 'Default copy type',
|
||||
showTableSize: 'Show table size in sidebar',
|
||||
showTableSizeDescription: 'MySQL/MariaDB only. Enable this option may affects performance on schema with many tables.'
|
||||
showTableSizeDescription: 'MySQL/MariaDB only. Enable this option may affects performance on schema with many tables.',
|
||||
searchForSchemas: 'Search for schemas',
|
||||
switchSearchMethod: 'Switch search method',
|
||||
noResultsPresent: 'No results present',
|
||||
sqlExportOptions: 'SQL export options',
|
||||
targetTable: 'Target table'
|
||||
},
|
||||
faker: {
|
||||
address: 'Address',
|
||||
|
@@ -11,6 +11,7 @@ import { jaJP } from './ja-JP';
|
||||
import { zhCN } from './zh-CN';
|
||||
import { ruRU } from './ru-RU';
|
||||
import { idID } from './id-ID';
|
||||
import { koKR } from './ko-KR';
|
||||
|
||||
const messages = {
|
||||
'en-US': enUS,
|
||||
@@ -24,7 +25,8 @@ const messages = {
|
||||
'ja-JP': jaJP,
|
||||
'zh-CN': zhCN,
|
||||
'ru-RU': ruRU,
|
||||
'id-ID': idID
|
||||
'id-ID': idID,
|
||||
'ko-KR': koKR
|
||||
};
|
||||
|
||||
type NestedPartial<T> = {
|
||||
|
@@ -143,7 +143,13 @@ export const itIT = {
|
||||
pin: 'Fissa',
|
||||
unpin: 'Sgancia',
|
||||
console: 'Console',
|
||||
shortcuts: 'Scorciatoie'
|
||||
shortcuts: 'Scorciatoie',
|
||||
folder: 'Cartella | Cartelle',
|
||||
appearence: 'Aspetto',
|
||||
color: 'Colore',
|
||||
label: 'Etichetta',
|
||||
icon: 'Icona',
|
||||
resultsTable: 'Tabella risultati'
|
||||
},
|
||||
message: {
|
||||
appWelcome: 'Benvenuto in Antares SQL Client!',
|
||||
@@ -322,7 +328,19 @@ export const itIT = {
|
||||
clearQuery: 'Pulisci query',
|
||||
openFilter: 'Apri il filtro',
|
||||
nextResultsPage: 'Prossima pagina risultati',
|
||||
previousResultsPage: 'Pagina risultati precedente'
|
||||
previousResultsPage: 'Pagina risultati precedente',
|
||||
fillCell: 'Riempi cella',
|
||||
editFolder: 'Modifica cartella',
|
||||
folderName: 'Nome cartella',
|
||||
deleteFolder: 'Cancella cartella',
|
||||
editConnectionAppearence: 'Modifica aspetto connessione',
|
||||
executeSelectedQuery: 'Esegui la query selezionata',
|
||||
defaultCopyType: 'Tipo di copia default',
|
||||
showTableSize: 'Mostra dimensioni tabella nella sidebar',
|
||||
showTableSizeDescription: 'Solo MySQL/MariaDB. Abilitare questa opzione può compmpromettere le performance in schemi con molte tabelle.',
|
||||
searchForSchemas: 'Cerca schemi',
|
||||
switchSearchMethod: 'Cambia metodo di ricerca',
|
||||
noResultsPresent: 'Nessun risultato presente'
|
||||
},
|
||||
faker: {
|
||||
address: 'Indirizzo',
|
||||
@@ -388,6 +406,7 @@ export const itIT = {
|
||||
collation: 'Confronto',
|
||||
engine: 'Motore',
|
||||
past: 'Passato',
|
||||
now: 'Adesso',
|
||||
future: 'Futuro',
|
||||
between: 'Tra',
|
||||
recent: 'Recente',
|
||||
|
509
src/renderer/i18n/ko-KR.ts
Normal file
509
src/renderer/i18n/ko-KR.ts
Normal file
@@ -0,0 +1,509 @@
|
||||
export const koKR = {
|
||||
word: {
|
||||
edit: '편집',
|
||||
save: '저장',
|
||||
close: '닫기',
|
||||
delete: '삭제',
|
||||
confirm: '확인',
|
||||
cancel: '취소',
|
||||
send: '보내기',
|
||||
connectionName: '연결 이름',
|
||||
client: '클라이언트',
|
||||
hostName: '호스트 이름',
|
||||
port: '포트',
|
||||
user: '사용자',
|
||||
password: '비밀번호',
|
||||
credentials: '자격 증명',
|
||||
connect: '연결',
|
||||
connected: '연결됨',
|
||||
disconnect: '연결 해제',
|
||||
disconnected: '연결 해제됨',
|
||||
refresh: '새로고침',
|
||||
settings: '설정',
|
||||
general: '일반',
|
||||
themes: '테마',
|
||||
update: '업데이트',
|
||||
about: '정보',
|
||||
language: '언어',
|
||||
version: '버전',
|
||||
donate: '기부',
|
||||
run: '실행',
|
||||
schema: '스키마',
|
||||
results: '결과',
|
||||
size: '크기',
|
||||
seconds: '초',
|
||||
type: '유형',
|
||||
mimeType: 'Mime 타입',
|
||||
download: '다운로드',
|
||||
add: '추가',
|
||||
data: '데이터',
|
||||
properties: '속성',
|
||||
insert: '삽입',
|
||||
connecting: '연결 중',
|
||||
name: '이름',
|
||||
collation: 'Collation',
|
||||
clear: '초기화',
|
||||
options: '옵션',
|
||||
autoRefresh: '자동 새로고침',
|
||||
indexes: '인덱스',
|
||||
foreignKeys: '외래 키',
|
||||
length: '길이',
|
||||
unsigned: 'Unsigned',
|
||||
default: '기본값',
|
||||
comment: '설명',
|
||||
key: '키 | 키들',
|
||||
order: '순서',
|
||||
expression: '식',
|
||||
autoIncrement: '자동 증가',
|
||||
engine: '엔진',
|
||||
field: '필드 | 필드들',
|
||||
approximately: '대략',
|
||||
total: '전체',
|
||||
table: '테이블',
|
||||
discard: '취소',
|
||||
stay: '계속하기',
|
||||
author: '작성자',
|
||||
light: '라이트',
|
||||
dark: '다크',
|
||||
autoCompletion: '자동 완성',
|
||||
application: '애플리케이션',
|
||||
editor: '편집기',
|
||||
view: '보기',
|
||||
definer: '정의자',
|
||||
algorithm: '알고리즘',
|
||||
trigger: '트리거 | 트리거들',
|
||||
storedRoutine: '프로시저 | 프로시저들',
|
||||
scheduler: '스케줄러 | 스케줄러들',
|
||||
event: '이벤트',
|
||||
parameters: '매개변수',
|
||||
function: '함수 | 함수들',
|
||||
deterministic: '결정론적',
|
||||
context: '컨텍스트',
|
||||
export: '내보내기',
|
||||
import: '가져오기',
|
||||
returns: '반환',
|
||||
timing: '타이밍',
|
||||
state: '상태',
|
||||
execution: '실행',
|
||||
starts: '시작',
|
||||
ends: '종료',
|
||||
ssl: 'SSL',
|
||||
privateKey: '개인 키',
|
||||
certificate: '인증서',
|
||||
caCertificate: 'CA 인증서',
|
||||
ciphers: '암호화',
|
||||
upload: '업로드',
|
||||
browse: '찾아보기',
|
||||
faker: 'Faker',
|
||||
content: '컨텐츠',
|
||||
cut: '잘라내기',
|
||||
copy: '복사',
|
||||
paste: '붙여넣기',
|
||||
tools: '도구',
|
||||
variables: '변수',
|
||||
processes: '프로세스',
|
||||
database: '데이터베이스',
|
||||
scratchpad: '스크래치패드',
|
||||
array: '배열',
|
||||
changelog: '변경 로그',
|
||||
format: '형식',
|
||||
sshTunnel: 'SSH 터널',
|
||||
structure: '구조',
|
||||
small: '작음',
|
||||
medium: '중간',
|
||||
large: '큼',
|
||||
row: '행 | 행들',
|
||||
cell: '셀 | 셀들',
|
||||
triggerFunction: '트리거 함수 | 트리거 함수들',
|
||||
all: '모두',
|
||||
duplicate: '복제',
|
||||
routine: '루틴',
|
||||
new: '새로 만들기',
|
||||
history: '기록',
|
||||
select: '선택',
|
||||
passphrase: '암호',
|
||||
filter: '필터',
|
||||
change: '변경',
|
||||
views: '뷰',
|
||||
triggers: '트리거',
|
||||
routines: '루틴',
|
||||
functions: '함수',
|
||||
schedulers: '스케줄러',
|
||||
includes: '포함',
|
||||
drop: '삭제',
|
||||
completed: '완료됨',
|
||||
aborted: '중단됨',
|
||||
disabled: '비활성화됨',
|
||||
enable: '활성화',
|
||||
disable: '비활성화',
|
||||
commit: '커밋',
|
||||
rollback: '롤백',
|
||||
connectionString: '연결 문자열',
|
||||
contributors: '기여자',
|
||||
pin: '고정',
|
||||
unpin: '고정 해제',
|
||||
console: '콘솔',
|
||||
shortcuts: '바로가기',
|
||||
folder: '폴더 | 폴더들',
|
||||
appearence: '외형',
|
||||
color: '색상',
|
||||
label: '라벨',
|
||||
icon: '아이콘',
|
||||
resultsTable: '결과 테이블'
|
||||
},
|
||||
message: {
|
||||
appWelcome: 'Antares SQL 클라이언트에 오신 것을 환영합니다!',
|
||||
appFirstStep: '첫 번째 단계: 새 데이터베이스 연결',
|
||||
addConnection: '연결 추가',
|
||||
createConnection: '연결 생성',
|
||||
createNewConnection: '새로운 연결 생성',
|
||||
askCredentials: '자격 증명 요청',
|
||||
testConnection: '연결 테스트',
|
||||
editConnection: '연결 편집',
|
||||
deleteConnection: '연결 삭제',
|
||||
deleteCorfirm: '취소를 확인하시겠습니까',
|
||||
connectionSuccessfullyMade: '성공적으로 연결되었습니다!',
|
||||
madeWithJS: '💛과 JavaScript로 만들어졌습니다!',
|
||||
checkForUpdates: '업데이트 확인',
|
||||
noUpdatesAvailable: '업데이트가 없습니다',
|
||||
checkingForUpdate: '업데이트 확인 중',
|
||||
checkFailure: '확인 실패, 나중에 다시 시도해주세요',
|
||||
updateAvailable: '업데이트 가능',
|
||||
downloadingUpdate: '업데이트 다운로드 중',
|
||||
updateDownloaded: '업데이트 다운로드 완료',
|
||||
restartToInstall: 'Antares를 다시 실행해주세요',
|
||||
unableEditFieldWithoutPrimary: '기본 키 없이 필드를 편집할 수 없습니다.',
|
||||
editCell: '셀 편집',
|
||||
deleteRows: '행 삭제 | {count}개의 행 삭제',
|
||||
confirmToDeleteRows: '행을 삭제하시겠습니까? | {count}개의 행을 삭제하시겠습니까?',
|
||||
notificationsTimeout: '알림 시간 초과',
|
||||
uploadFile: '파일 업로드',
|
||||
addNewRow: '새 행 추가',
|
||||
numberOfInserts: '삽입 횟수',
|
||||
openNewTab: '새 탭 열기',
|
||||
affectedRows: '영향 받은 행',
|
||||
createNewDatabase: '새 데이터베이스 생성',
|
||||
databaseName: '데이터베이스 이름',
|
||||
serverDefault: '서버 기본값',
|
||||
deleteDatabase: '데이터베이스 삭제',
|
||||
editDatabase: '데이터베이스 편집',
|
||||
clearChanges: '변경사항 초기화',
|
||||
addNewField: '새 필드 추가',
|
||||
manageIndexes: '인덱스 관리',
|
||||
manageForeignKeys: '외래 키 관리',
|
||||
allowNull: 'NULL 허용',
|
||||
zeroFill: '0 채우기',
|
||||
customValue: '사용자 지정 값',
|
||||
onUpdate: '업데이트 시',
|
||||
deleteField: '필드 삭제',
|
||||
createNewIndex: '새 인덱스 생성',
|
||||
addToIndex: '인덱스에 추가',
|
||||
createNewTable: '새 테이블 생성',
|
||||
emptyTable: '테이블 비우기',
|
||||
deleteTable: '테이블 삭제',
|
||||
emptyCorfirm: '비우시겠습니까',
|
||||
unsavedChanges: '저장되지 않은 변경사항',
|
||||
discardUnsavedChanges: '저장되지 않은 변경사항이 있습니다. 탭을 닫으면 이러한 변경사항이 삭제됩니다.',
|
||||
thereAreNoIndexes: '인덱스가 없습니다.',
|
||||
thereAreNoForeign: '외래 키가 없습니다.',
|
||||
createNewForeign: '새로운 외래 키 생성',
|
||||
referenceTable: '참조 테이블',
|
||||
referenceField: '참조 필드',
|
||||
foreignFields: '외래 필드',
|
||||
invalidDefault: '잘못된 기본값',
|
||||
onDelete: '삭제 시',
|
||||
applicationTheme: '애플리케이션 테마',
|
||||
editorTheme: '편집기 테마',
|
||||
wrapLongLines: '긴 줄 바꿈',
|
||||
selectStatement: 'SELECT 문',
|
||||
triggerStatement: '트리거 문',
|
||||
sqlSecurity: 'SQL 보안',
|
||||
updateOption: '업데이트 옵션',
|
||||
deleteView: '뷰 삭제',
|
||||
createNewView: '새로운 뷰 생성',
|
||||
deleteTrigger: '트리거 삭제',
|
||||
createNewTrigger: '새로운 트리거 생성',
|
||||
currentUser: '현재 사용자',
|
||||
routineBody: '루틴 본문',
|
||||
dataAccess: '데이터 접근',
|
||||
thereAreNoParameters: '매개변수가 없습니다.',
|
||||
createNewParameter: '새 매개변수 생성',
|
||||
createNewRoutine: '새 루틴 생성',
|
||||
deleteRoutine: '루틴 삭제',
|
||||
functionBody: '함수 본문',
|
||||
createNewFunction: '새 함수 생성',
|
||||
deleteFunction: '함수 삭제',
|
||||
schedulerBody: '스케줄러 본문',
|
||||
createNewScheduler: '새 스케줄러 생성',
|
||||
deleteScheduler: '스케줄러 삭제',
|
||||
preserveOnCompletion: '완료 후 보존',
|
||||
enableSsl: 'SSL 활성화',
|
||||
manualValue: '수동 값',
|
||||
tableFiller: '테이블 채우기',
|
||||
fakeDataLanguage: '가짜 데이터 언어',
|
||||
searchForElements: '요소 검색',
|
||||
selectAll: '전체 조회',
|
||||
queryDuration: '쿼리 시간',
|
||||
includeBetaUpdates: '베타 업데이트 포함',
|
||||
setNull: 'NULL 설정',
|
||||
processesList: '프로세스 목록',
|
||||
processInfo: '프로세스 정보',
|
||||
manageUsers: '사용자 관리',
|
||||
createNewSchema: '새 스키마 생성',
|
||||
schemaName: '스키마 이름',
|
||||
editSchema: '스키마 편집',
|
||||
deleteSchema: '스키마 삭제',
|
||||
markdownSupported: '마크다운 지원',
|
||||
plantATree: '나무 심기',
|
||||
dataTabPageSize: '데이터 탭 페이지 크기',
|
||||
enableSsh: 'SSH 활성화',
|
||||
pageNumber: '페이지 번호',
|
||||
duplicateTable: '테이블 복제',
|
||||
noOpenTabs: '열린 탭이 없습니다.',
|
||||
noSchema: '스키마 없음',
|
||||
restorePreviourSession: '이전 세션 복원',
|
||||
runQuery: '쿼리 실행',
|
||||
thereAreNoTableFields: '테이블 필드가 없습니다',
|
||||
newTable: '새 테이블',
|
||||
newView: '새 뷰',
|
||||
newTrigger: '새 트리거',
|
||||
newRoutine: '새 루틴',
|
||||
newFunction: '새 함수',
|
||||
newScheduler: '새 스케줄러',
|
||||
newTriggerFunction: '새 트리거 함수',
|
||||
thereIsNoQueriesYet: '아직 쿼리가 없습니다',
|
||||
searchForQueries: '쿼리 검색',
|
||||
killProcess: '프로세스 종료',
|
||||
closeTab: '탭 닫기',
|
||||
exportSchema: '스키마 내보내기',
|
||||
importSchema: '스키마 가져오기',
|
||||
directoryPath: '디렉터리 경로',
|
||||
newInserStmtEvery: '마다 새 INSERT 문',
|
||||
processingTableExport: '{table} 처리 중',
|
||||
fechingTableExport: '{table} 데이터 가져오는 중',
|
||||
writingTableExport: '{table} 데이터 쓰는 중',
|
||||
checkAllTables: '모든 테이블 선택',
|
||||
uncheckAllTables: '모든 테이블 선택 취소',
|
||||
goToDownloadPage: '다운로드 페이지로 이동',
|
||||
readOnlyMode: '읽기 전용 모드',
|
||||
killQuery: '쿼리 종료',
|
||||
insertRow: '행 삽입 | 행 삽입',
|
||||
commitMode: '커밋 모드',
|
||||
autoCommit: '자동 커밋',
|
||||
manualCommit: '수동 커밋',
|
||||
actionSuccessful: '{action} 성공',
|
||||
importQueryErrors: '경고: {n}개의 오류 발생 | 경고: {n}개의 오류 발생',
|
||||
executedQueries: '{n}개의 쿼리 실행 | {n}개의 쿼리 실행',
|
||||
ourputFormat: '출력 형식',
|
||||
singleFile: '단일 {ext} 파일',
|
||||
zipCompressedFile: 'ZIP 압축 {ext} 파일',
|
||||
disableBlur: 'blur 비활성화',
|
||||
untrustedConnection: '신뢰할 수 없는 연결',
|
||||
missingOrIncompleteTranslation: '누락 혹은 불완전한 번역?',
|
||||
findOutHowToContribute: '기여 방법 알아보기',
|
||||
disableFKChecks: '외래 키 검사 비활성화',
|
||||
allConnections: '모든 연결',
|
||||
searchForConnections: '연결 검색',
|
||||
disableScratchpad: '스크래치패드 비활성화',
|
||||
reportABug: '버그 신고',
|
||||
nextTab: '다음 탭',
|
||||
previousTab: '이전 탭',
|
||||
selectTabNumber: '{param}번 탭 선택',
|
||||
toggleConsole: '콘솔 전환',
|
||||
addShortcut: '단축키 추가',
|
||||
editShortcut: '단축키 편집',
|
||||
deleteShortcut: '단축키 삭제',
|
||||
restoreDefaults: '기본값 복원',
|
||||
restoreDefaultsQuestion: '기본값으로 복원하시겠습니까?',
|
||||
registerAShortcut: '단축키 등록',
|
||||
invalidShortcutMessage: '유효하지 않은 조합입니다. 계속 입력하세요.',
|
||||
shortcutAlreadyExists: '이미 존재하는 단축키입니다.',
|
||||
saveContent: '내용 저장',
|
||||
openAllConnections: '모든 연결 열기',
|
||||
openSettings: '설정 열기',
|
||||
openScratchpad: '스크래치패드 열기',
|
||||
runOrReload: '실행 또는 다시 로드',
|
||||
formatQuery: '쿼리 형식',
|
||||
queryHistory: '쿼리 기록',
|
||||
clearQuery: '쿼리 지우기',
|
||||
openFilter: '필터 열기',
|
||||
nextResultsPage: '다음 결과 페이지',
|
||||
previousResultsPage: '이전 결과 페이지',
|
||||
fillCell: '셀 채우기',
|
||||
editFolder: '폴더 수정',
|
||||
folderName: '폴더 이름',
|
||||
deleteFolder: '폴더 삭제',
|
||||
editConnectionAppearence: '연결 형태 수정',
|
||||
executeSelectedQuery: '선택한 쿼리 실행',
|
||||
defaultCopyType: '기본 복사 유형',
|
||||
showTableSize: '사이드바에 테이블 크기 표시',
|
||||
showTableSizeDescription: 'MySQL/MariaDB 전용입니다. 이 옵션을 사용하면 많은 테이블이 있는 스키마의 성능에 영향을 줄 수 있습니다.',
|
||||
searchForSchemas: '스키마 검색',
|
||||
switchSearchMethod: '검색 방법 전환'
|
||||
},
|
||||
faker: {
|
||||
address: '주소',
|
||||
commerce: '상업',
|
||||
company: '회사',
|
||||
database: '데이터베이스',
|
||||
date: '날짜',
|
||||
finance: '금융',
|
||||
git: 'git',
|
||||
hacker: '해커',
|
||||
internet: '인터넷',
|
||||
lorem: 'lorem',
|
||||
name: '이름',
|
||||
music: '음악',
|
||||
phone: '전화',
|
||||
random: '랜덤',
|
||||
system: '시스템',
|
||||
time: '시간',
|
||||
vehicle: '차량',
|
||||
zipCode: '우편번호',
|
||||
zipCodeByState: '주별 우편번호',
|
||||
city: '도시',
|
||||
cityPrefix: '도시 접두사',
|
||||
citySuffix: '도시 접미사',
|
||||
streetName: '거리 이름',
|
||||
streetAddress: '주소',
|
||||
streetSuffix: '거리 접미사',
|
||||
streetPrefix: '거리 접두사',
|
||||
secondaryAddress: '보조 주소',
|
||||
county: '군/도',
|
||||
country: '국가',
|
||||
countryCode: '국가 코드',
|
||||
state: '주/도',
|
||||
stateAbbr: '주/도 약어',
|
||||
latitude: '위도',
|
||||
longitude: '경도',
|
||||
direction: '방향',
|
||||
cardinalDirection: '기본 방위',
|
||||
ordinalDirection: '서수 방위',
|
||||
nearbyGPSCoordinate: '인근 GPS 좌표',
|
||||
timeZone: '시간대',
|
||||
color: '색상',
|
||||
department: '부서',
|
||||
productName: '제품 이름',
|
||||
price: '가격',
|
||||
productAdjective: '제품 형용사',
|
||||
productMaterial: '제품 재질',
|
||||
product: '제품',
|
||||
productDescription: '제품 설명',
|
||||
suffixes: '접미사',
|
||||
companyName: '회사 이름',
|
||||
companySuffix: '회사 접미사',
|
||||
catchPhrase: '캐치프레이즈',
|
||||
bs: 'BS',
|
||||
catchPhraseAdjective: '캐치프레이즈 형용사',
|
||||
catchPhraseDescriptor: '캐치프레이즈 서술어',
|
||||
catchPhraseNoun: '캐치프레이즈 명사',
|
||||
bsAdjective: 'BS 형용사',
|
||||
bsBuzz: 'BS 버저',
|
||||
bsNoun: 'BS 명사',
|
||||
column: '열',
|
||||
type: '타입',
|
||||
collation: 'Collation',
|
||||
engine: '엔진',
|
||||
past: '과거',
|
||||
now: '현재',
|
||||
future: '미래',
|
||||
between: '사이',
|
||||
recent: '최근',
|
||||
soon: '곧',
|
||||
month: '월',
|
||||
weekday: '요일',
|
||||
account: '계정',
|
||||
accountName: '계정 이름',
|
||||
routingNumber: '라우팅 번호',
|
||||
mask: '마스크',
|
||||
amount: '금액',
|
||||
transactionType: '거래 유형',
|
||||
currencyCode: '통화 코드',
|
||||
currencyName: '통화 이름',
|
||||
currencySymbol: '통화 기호',
|
||||
bitcoinAddress: '비트코인 주소',
|
||||
litecoinAddress: '라이트코인 주소',
|
||||
creditCardNumber: '신용카드',
|
||||
creditCardCVV: '신용카드 CVV',
|
||||
ethereumAddress: '이더리움 주소',
|
||||
iban: '국제 은행 계좌 번호',
|
||||
bic: '은행 식별자 코드',
|
||||
transactionDescription: '거래 설명',
|
||||
branch: '지점',
|
||||
commitEntry: '커밋 항목',
|
||||
commitMessage: '커밋 메시지',
|
||||
commitSha: '커밋 SHA',
|
||||
shortSha: '짧은 SHA',
|
||||
abbreviation: '약어',
|
||||
adjective: '형용사',
|
||||
noun: '명사',
|
||||
verb: '동사',
|
||||
ingverb: '진행형 동사',
|
||||
phrase: '구문',
|
||||
avatar: '아바타',
|
||||
email: '이메일',
|
||||
exampleEmail: '예시 이메일',
|
||||
userName: '사용자 이름',
|
||||
protocol: '프로토콜',
|
||||
url: 'URL',
|
||||
domainName: '도메인 이름',
|
||||
domainSuffix: '도메인 접미사',
|
||||
domainWord: '도메인 단어',
|
||||
ip: 'IP',
|
||||
ipv6: 'IPv6',
|
||||
userAgent: '사용자 에이전트',
|
||||
mac: 'MAC',
|
||||
password: '비밀번호',
|
||||
word: '단어',
|
||||
words: '단어들',
|
||||
sentence: '문장',
|
||||
slug: '슬러그',
|
||||
sentences: '문장들',
|
||||
paragraph: '문단',
|
||||
paragraphs: '문단들',
|
||||
text: '텍스트',
|
||||
lines: '라인',
|
||||
genre: '장르',
|
||||
firstName: '이름',
|
||||
lastName: '성',
|
||||
middleName: '중간 이름',
|
||||
findName: '전체 이름',
|
||||
jobTitle: '직함',
|
||||
gender: '성별',
|
||||
prefix: '접두사',
|
||||
suffix: '접미사',
|
||||
title: '타이틀',
|
||||
jobDescriptor: '직무 설명',
|
||||
jobArea: '직무 영역',
|
||||
jobType: '직무 유형',
|
||||
phoneNumber: '전화번호',
|
||||
phoneNumberFormat: '전화번호 형식',
|
||||
phoneFormats: '전화번호 형식들',
|
||||
number: '숫자',
|
||||
float: 'float',
|
||||
arrayElement: '배열 요소',
|
||||
arrayElements: '배열 요소들',
|
||||
objectElement: '객체 요소',
|
||||
uuid: 'UUID',
|
||||
boolean: '부울',
|
||||
image: '이미지',
|
||||
locale: '로케일',
|
||||
alpha: '알파벳',
|
||||
alphaNumeric: '알파벳 및 숫자',
|
||||
hexaDecimal: '16진수',
|
||||
fileName: '파일 이름',
|
||||
commonFileName: '공통 파일 이름',
|
||||
mimeType: 'MIME 타입',
|
||||
commonFileType: '공통 파일 유형',
|
||||
commonFileExt: '공통 파일 확장자',
|
||||
fileType: '파일 유형',
|
||||
fileExt: '파일 확장자',
|
||||
directoryPath: '디렉토리 경로',
|
||||
filePath: '파일 경로',
|
||||
semver: '유의적 버전',
|
||||
manufacturer: '제조사',
|
||||
model: '모델',
|
||||
fuel: '연료',
|
||||
vin: '차량식별번호'
|
||||
}
|
||||
};
|
@@ -10,5 +10,6 @@ export const localesNames: {[key: string]: string} = {
|
||||
'ja-JP': '日本語',
|
||||
'zh-CN': '简体中文',
|
||||
'ru-RU': 'Русский',
|
||||
'id-ID': 'Bahasa Indonesia'
|
||||
'id-ID': 'Bahasa Indonesia',
|
||||
'ko-KR': '한국어'
|
||||
};
|
||||
|
@@ -9,6 +9,7 @@ export const exportRows = (args: {
|
||||
fields?: {
|
||||
[key: string]: {type: string; datePrecision: number};
|
||||
};
|
||||
sqlOptions?: {sqlInsertAfter: number; sqlInsertDivider: 'bytes' | 'rows'; targetTable: string};
|
||||
}) => {
|
||||
let mime;
|
||||
let content;
|
||||
@@ -21,27 +22,30 @@ export const exportRows = (args: {
|
||||
if (args.content.length)
|
||||
csv.push(Object.keys(args.content[0]).join(';'));
|
||||
|
||||
for (const row of args.content)
|
||||
csv.push(Object.values(row).map(col => typeof col === 'string' ? `"${col}"` : col).join(';'));
|
||||
for (const row of args.content) {
|
||||
csv.push(Object.values(row).map(col => {
|
||||
if (typeof col === 'string') return `"${col}"`;
|
||||
if (col instanceof Buffer) return col.toString('base64');
|
||||
if (col instanceof Uint8Array) return Buffer.from(col).toString('base64');
|
||||
return col;
|
||||
}).join(';'));
|
||||
}
|
||||
|
||||
content = csv.join('\n');
|
||||
break;
|
||||
}
|
||||
case 'sql': {
|
||||
mime = 'text/sql';
|
||||
const sql = [];
|
||||
const sql = jsonToSqlInsert({
|
||||
json: args.content,
|
||||
client:
|
||||
args.client,
|
||||
fields: args.fields,
|
||||
table: args.sqlOptions.targetTable || args.table,
|
||||
options: args.sqlOptions
|
||||
});
|
||||
|
||||
for (const row of args.content) {
|
||||
sql.push(jsonToSqlInsert({
|
||||
json: row,
|
||||
client:
|
||||
args.client,
|
||||
fields: args.fields,
|
||||
table: args.table
|
||||
}));
|
||||
}
|
||||
|
||||
content = sql.join('\n');
|
||||
content = sql;
|
||||
break;
|
||||
}
|
||||
case 'json':
|
||||
@@ -54,7 +58,7 @@ export const exportRows = (args: {
|
||||
|
||||
const file = new Blob([content], { type: mime });
|
||||
const downloadLink = document.createElement('a');
|
||||
downloadLink.download = `${args.table}.${args.type}`;
|
||||
downloadLink.download = `${args.sqlOptions?.targetTable || args.table}.${args.type}`;
|
||||
downloadLink.href = window.URL.createObjectURL(file);
|
||||
downloadLink.style.display = 'none';
|
||||
document.body.appendChild(downloadLink);
|
||||
|
Reference in New Issue
Block a user