mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 16:36:00 +00:00
feat: add new duck db command
This commit is contained in:
@@ -46,6 +46,7 @@ import { openImportExportTab } from '../utility/importExportTools';
|
||||
import newTable from '../tableeditor/newTable';
|
||||
import { isProApp } from '../utility/proTools';
|
||||
import { openWebLink } from '../utility/simpleTools';
|
||||
import { _t } from '../translations';
|
||||
|
||||
// function themeCommand(theme: ThemeDefinition) {
|
||||
// return {
|
||||
@@ -389,12 +390,12 @@ registerCommand({
|
||||
category: 'New',
|
||||
icon: 'img sqlite-database',
|
||||
name: 'SQLite database',
|
||||
menuName: 'New SQLite database',
|
||||
menuName: _t('command.new.sqliteDatabase', { defaultMessage: 'New SQLite database' }),
|
||||
onClick: () => {
|
||||
showModal(InputTextModal, {
|
||||
value: 'newdb',
|
||||
label: 'New database name',
|
||||
header: 'Create SQLite database',
|
||||
label: _t('command.new.sqliteDatabase', { defaultMessage: 'New SQLite database' }),
|
||||
header: _t('command.new.sqliteDatabase.header', { defaultMessage: 'Create SQLite database' }),
|
||||
onConfirm: async file => {
|
||||
const resp = await apiCall('connections/new-sqlite-database', { file });
|
||||
const connection = resp;
|
||||
@@ -404,6 +405,26 @@ registerCommand({
|
||||
},
|
||||
});
|
||||
|
||||
registerCommand({
|
||||
id: 'new.duckdbDatabase',
|
||||
category: 'New',
|
||||
icon: 'img sqlite-database',
|
||||
name: 'DuckDB database',
|
||||
menuName: _t('command.new.duckdbDatabase', { defaultMessage: 'New DuckDB database' }),
|
||||
onClick: () => {
|
||||
showModal(InputTextModal, {
|
||||
value: 'newdb',
|
||||
label: _t('command.new.duckdbDatabase', { defaultMessage: 'New DuckDB database' }),
|
||||
header: _t('command.new.duckdbDatabase.header', { defaultMessage: 'Create DuckDB database' }),
|
||||
onConfirm: async file => {
|
||||
const resp = await apiCall('connections/new-duckdb-database', { file });
|
||||
const connection = resp;
|
||||
switchCurrentDatabase({ connection, name: `${file}.duckdb` });
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
registerCommand({
|
||||
id: 'tabs.changelog',
|
||||
category: 'Tabs',
|
||||
|
||||
Reference in New Issue
Block a user