|
@@ -598,7 +598,11 @@ class AutocompleteResults {
|
|
|
databaseSuggestions.push({
|
|
databaseSuggestions.push({
|
|
|
value:
|
|
value:
|
|
|
prefix +
|
|
prefix +
|
|
|
- (await sqlUtils.backTickIfNeeded(this.executor.connector(), name)) +
|
|
|
|
|
|
|
+ (await sqlUtils.backTickIfNeeded(
|
|
|
|
|
+ this.executor.connector(),
|
|
|
|
|
+ name,
|
|
|
|
|
+ this.sqlReferenceProvider
|
|
|
|
|
+ )) +
|
|
|
(suggestDatabases.appendDot ? '.' : ''),
|
|
(suggestDatabases.appendDot ? '.' : ''),
|
|
|
filterValue: name,
|
|
filterValue: name,
|
|
|
meta: MetaLabels.Database,
|
|
meta: MetaLabels.Database,
|
|
@@ -664,7 +668,13 @@ class AutocompleteResults {
|
|
|
}
|
|
}
|
|
|
const name = tableEntry.name;
|
|
const name = tableEntry.name;
|
|
|
tableSuggestions.push({
|
|
tableSuggestions.push({
|
|
|
- value: prefix + (await sqlUtils.backTickIfNeeded(this.executor.connector(), name)),
|
|
|
|
|
|
|
+ value:
|
|
|
|
|
+ prefix +
|
|
|
|
|
+ (await sqlUtils.backTickIfNeeded(
|
|
|
|
|
+ this.executor.connector(),
|
|
|
|
|
+ name,
|
|
|
|
|
+ this.sqlReferenceProvider
|
|
|
|
|
+ )),
|
|
|
filterValue: name,
|
|
filterValue: name,
|
|
|
tableName: name,
|
|
tableName: name,
|
|
|
meta: tableEntry.isView() ? MetaLabels.View : MetaLabels.Table,
|
|
meta: tableEntry.isView() ? MetaLabels.View : MetaLabels.Table,
|
|
@@ -793,7 +803,11 @@ class AutocompleteResults {
|
|
|
const type = column.type && column.type !== 'COLREF' ? column.type : 'T';
|
|
const type = column.type && column.type !== 'COLREF' ? column.type : 'T';
|
|
|
if (column.alias) {
|
|
if (column.alias) {
|
|
|
columnSuggestions.push({
|
|
columnSuggestions.push({
|
|
|
- value: await sqlUtils.backTickIfNeeded(this.executor.connector(), column.alias),
|
|
|
|
|
|
|
+ value: await sqlUtils.backTickIfNeeded(
|
|
|
|
|
+ this.executor.connector(),
|
|
|
|
|
+ column.alias,
|
|
|
|
|
+ this.sqlReferenceProvider
|
|
|
|
|
+ ),
|
|
|
filterValue: column.alias,
|
|
filterValue: column.alias,
|
|
|
meta: type,
|
|
meta: type,
|
|
|
category: Category.Column,
|
|
category: Category.Column,
|
|
@@ -809,7 +823,8 @@ class AutocompleteResults {
|
|
|
columnSuggestions.push({
|
|
columnSuggestions.push({
|
|
|
value: await sqlUtils.backTickIfNeeded(
|
|
value: await sqlUtils.backTickIfNeeded(
|
|
|
this.executor.connector(),
|
|
this.executor.connector(),
|
|
|
- column.identifierChain[column.identifierChain.length - 1].name
|
|
|
|
|
|
|
+ column.identifierChain[column.identifierChain.length - 1].name,
|
|
|
|
|
+ this.sqlReferenceProvider
|
|
|
),
|
|
),
|
|
|
filterValue: column.identifierChain[column.identifierChain.length - 1].name,
|
|
filterValue: column.identifierChain[column.identifierChain.length - 1].name,
|
|
|
meta: type,
|
|
meta: type,
|
|
@@ -840,7 +855,11 @@ class AutocompleteResults {
|
|
|
typeof column.type !== 'undefined' && column.type !== 'COLREF' ? column.type : 'T';
|
|
typeof column.type !== 'undefined' && column.type !== 'COLREF' ? column.type : 'T';
|
|
|
if (column.alias) {
|
|
if (column.alias) {
|
|
|
columnSuggestions.push({
|
|
columnSuggestions.push({
|
|
|
- value: await sqlUtils.backTickIfNeeded(connector, column.alias),
|
|
|
|
|
|
|
+ value: await sqlUtils.backTickIfNeeded(
|
|
|
|
|
+ connector,
|
|
|
|
|
+ column.alias,
|
|
|
|
|
+ this.sqlReferenceProvider
|
|
|
|
|
+ ),
|
|
|
filterValue: column.alias,
|
|
filterValue: column.alias,
|
|
|
meta: type,
|
|
meta: type,
|
|
|
category: Category.Column,
|
|
category: Category.Column,
|
|
@@ -852,7 +871,8 @@ class AutocompleteResults {
|
|
|
columnSuggestions.push({
|
|
columnSuggestions.push({
|
|
|
value: await sqlUtils.backTickIfNeeded(
|
|
value: await sqlUtils.backTickIfNeeded(
|
|
|
connector,
|
|
connector,
|
|
|
- column.identifierChain[column.identifierChain.length - 1].name
|
|
|
|
|
|
|
+ column.identifierChain[column.identifierChain.length - 1].name,
|
|
|
|
|
+ this.sqlReferenceProvider
|
|
|
),
|
|
),
|
|
|
filterValue: column.identifierChain[column.identifierChain.length - 1].name,
|
|
filterValue: column.identifierChain[column.identifierChain.length - 1].name,
|
|
|
meta: type,
|
|
meta: type,
|
|
@@ -920,7 +940,11 @@ class AutocompleteResults {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
for (const childEntry of childEntries) {
|
|
for (const childEntry of childEntries) {
|
|
|
- let name = await sqlUtils.backTickIfNeeded(this.executor.connector(), childEntry.name);
|
|
|
|
|
|
|
+ let name = await sqlUtils.backTickIfNeeded(
|
|
|
|
|
+ this.executor.connector(),
|
|
|
|
|
+ childEntry.name,
|
|
|
|
|
+ this.sqlReferenceProvider
|
|
|
|
|
+ );
|
|
|
if (this.dialect() === HIVE_DIALECT && (childEntry.isArray() || childEntry.isMap())) {
|
|
if (this.dialect() === HIVE_DIALECT && (childEntry.isArray() || childEntry.isMap())) {
|
|
|
name += '[]';
|
|
name += '[]';
|
|
|
}
|
|
}
|