-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
900 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
layout: post | ||
title: "1.6.0" | ||
date: 2021-09-23 | ||
author: qianmoQ | ||
--- | ||
|
||
DBM Version for 1.6.0 is released! | ||
|
||
#### Bugs | ||
--- | ||
|
||
- Fix information word | ||
- Fix the migration data password null problem | ||
|
||
#### UI | ||
--- | ||
|
||
- Increase query history limit reminder | ||
- Disallow clicking on the mask layer to close the dialog popover | ||
|
||
#### Enhancement | ||
--- | ||
|
||
- Support add column to table | ||
- Support delete column | ||
- Support modify column | ||
- Support rename column | ||
- Support preview data for column |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { post, get } from '@/utils/Query' | ||
const HttpUtils = require('../utils/HttpUtils') | ||
|
||
export function runExecute(host, sql) { | ||
return post(host, sql + '\n FORMAT JSON') | ||
return HttpUtils.post(host, sql + '\n FORMAT JSON') | ||
} | ||
|
||
export function checkHealth(host) { | ||
return get(host) | ||
return HttpUtils.get(host) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { getQuery } from './Metadata' | ||
|
||
const StringUtils = require('../utils/StringUtils') | ||
const ColumnUtils = require('../utils/ColumnUtils') | ||
|
||
export async function addColumns(configure, columns) { | ||
const sql = StringUtils.format('ALTER TABLE {0}.{1} {2}', | ||
[configure.database, configure.table, ColumnUtils.builderAddColumnDDL(columns)]) | ||
return getQuery(configure.server, sql) | ||
} | ||
|
||
export function deleteColumn(configure) { | ||
const sql = StringUtils.format('ALTER TABLE {0}.{1} DROP COLUMN {2}', | ||
[configure.database, configure.table, configure.column]) | ||
return getQuery(configure.server, sql) | ||
} | ||
|
||
export function modifyColumn(configure, column) { | ||
const sql = StringUtils.format('ALTER TABLE {0}.{1} MODIFY COLUMN {2}', | ||
[configure.database, configure.table, ColumnUtils.builderColumnToString(column)]) | ||
return getQuery(configure.server, sql) | ||
} | ||
|
||
export function renameColumn(configure, value) { | ||
const sql = StringUtils.format('ALTER TABLE {0}.{1} RENAME COLUMN {2} TO {3}', | ||
[configure.database, configure.table, configure.column, value]) | ||
return getQuery(configure.server, sql) | ||
} | ||
|
||
export function previewColumn(configure) { | ||
const sql = StringUtils.format('SELECT {0} FROM {1}.{2} LIMIT 100', | ||
[configure.column, configure.database, configure.table]) | ||
return getQuery(configure.server, sql) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const StringUtils = require('./StringUtils') | ||
|
||
export function builderAddColumnsDDL(columns) { | ||
const columnsDDL = [] | ||
if (StringUtils.getLengthGtZone(columns)) { | ||
columns.forEach(column => { | ||
columnsDDL.push(builderAddColumnDDL(column)) | ||
}) | ||
} | ||
return columnsDDL | ||
} | ||
|
||
export function builderAddColumnDDL(column) { | ||
return StringUtils.format('ADD COLUMN {0}', [builderColumnToString(column)]) | ||
} | ||
|
||
export function builderColumnToString(column) { | ||
let columnString | ||
if (StringUtils.isNotEmpty(column)) { | ||
columnString = column.name | ||
const columnType = column.empty ? StringUtils.format('Nullable({0})', [column.type]) : column.type | ||
columnString = StringUtils.format('{0} {1}', [columnString, columnType]) | ||
if (StringUtils.isNotEmpty(column.comment)) { | ||
columnString = StringUtils.format(`{0} COMMENT '{1}'`, [columnString, column.comment]) | ||
} | ||
} | ||
return columnString | ||
} |
File renamed without changes.
Oops, something went wrong.