|
@@ -5619,28 +5619,28 @@
|
|
|
var menu = ko.bindingHandlers.contextMenu.initContextMenu($tableDropMenu, $('.content-panel'));
|
|
var menu = ko.bindingHandlers.contextMenu.initContextMenu($tableDropMenu, $('.content-panel'));
|
|
|
|
|
|
|
|
$tableDropMenu.find('.editor-drop-value').click(function () {
|
|
$tableDropMenu.find('.editor-drop-value').click(function () {
|
|
|
- insertSqlAtCursor(lastMeta.database + '.' + lastMeta.table + ' ', 0, menu);
|
|
|
|
|
|
|
+ insertSqlAtCursor(SqlUtils.backTickIfNeeded(lastMeta.type, lastMeta.database) + '.' + SqlUtils.backTickIfNeeded(lastMeta.type, lastMeta.table) + ' ', 0, menu);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
$tableDropMenu.find('.editor-drop-select').click(function () {
|
|
$tableDropMenu.find('.editor-drop-select').click(function () {
|
|
|
- insertSqlAtCursor('SELECT * FROM ' + lastMeta.database + '.' + lastMeta.table + ' LIMIT 100;', -1, menu);
|
|
|
|
|
|
|
+ insertSqlAtCursor('SELECT * FROM ' + SqlUtils.backTickIfNeeded(lastMeta.type, lastMeta.database) + '.' + SqlUtils.backTickIfNeeded(lastMeta.type, lastMeta.table) + ' LIMIT 100;', -1, menu);
|
|
|
$tableDropMenu.hide();
|
|
$tableDropMenu.hide();
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
$tableDropMenu.find('.editor-drop-insert').click(function () {
|
|
$tableDropMenu.find('.editor-drop-insert').click(function () {
|
|
|
- insertSqlAtCursor('INSERT INTO ' + lastMeta.database + '.' + lastMeta.table + ' VALUES ();', -2, menu);
|
|
|
|
|
|
|
+ insertSqlAtCursor('INSERT INTO ' + SqlUtils.backTickIfNeeded(lastMeta.type, lastMeta.database) + '.' + SqlUtils.backTickIfNeeded(lastMeta.type, lastMeta.table) + ' VALUES ();', -2, menu);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
$tableDropMenu.find('.editor-drop-update').click(function () {
|
|
$tableDropMenu.find('.editor-drop-update').click(function () {
|
|
|
- insertSqlAtCursor('UPDATE ' + lastMeta.database + '.' + lastMeta.table + ' SET ', 0, menu);
|
|
|
|
|
|
|
+ insertSqlAtCursor('UPDATE ' + SqlUtils.backTickIfNeeded(lastMeta.type, lastMeta.database) + '.' + SqlUtils.backTickIfNeeded(lastMeta.type, lastMeta.table) + ' SET ', 0, menu);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
$tableDropMenu.find('.editor-drop-view').click(function () {
|
|
$tableDropMenu.find('.editor-drop-view').click(function () {
|
|
|
- insertSqlAtCursor('DROP VIEW ' + lastMeta.database + '.' + lastMeta.table + ';', -1, menu);
|
|
|
|
|
|
|
+ insertSqlAtCursor('DROP VIEW ' + SqlUtils.backTickIfNeeded(lastMeta.type, lastMeta.database) + '.' + SqlUtils.backTickIfNeeded(lastMeta.type, lastMeta.table) + ';', -1, menu);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
$tableDropMenu.find('.editor-drop-drop').click(function () {
|
|
$tableDropMenu.find('.editor-drop-drop').click(function () {
|
|
|
- insertSqlAtCursor('DROP TABLE ' + lastMeta.database + '.' + lastMeta.table + ';', -1, menu);
|
|
|
|
|
|
|
+ insertSqlAtCursor('DROP TABLE ' + SqlUtils.backTickIfNeeded(lastMeta.type, lastMeta.database) + '.' + SqlUtils.backTickIfNeeded(lastMeta.type, lastMeta.table) + ';', -1, menu);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
$el.droppable({
|
|
$el.droppable({
|