fix(postgres): distinguish overloaded routines
This commit is contained in:
1 parent
823b4297d8
commit
a3f3cadb39
14 files changed
+146
-48
No files matched your search
@@ -22,6 +22,7 @@ const props = withDefaults(
|
||||
database: string;
|
||||
schema?: string;
|
||||
name: string;
|
||||
signature?: string;
|
||||
objectType: ObjectSourceKind;
|
||||
databaseType?: DatabaseType;
|
||||
dialect: "mysql" | "postgres" | "sqlserver";
|
||||
@@ -58,7 +59,7 @@ const canEdit = computed(() => sourceEditable.value && props.objectType !== "SEQ
|
||||
const title = computed(() => `${editing.value ? t("contextMenu.editView") : t("contextMenu.viewSource")} - ${props.name}`);
|
||||
|
||||
watch(
|
||||
() => [props.open, props.connectionId, props.database, props.schema, props.name, props.objectType, props.initialEditing] as const,
|
||||
() => [props.open, props.connectionId, props.database, props.schema, props.name, props.signature, props.objectType, props.initialEditing] as const,
|
||||
() => {
|
||||
if (props.open) void loadSource();
|
||||
},
|
||||
@@ -78,7 +79,7 @@ async function loadSource(nextEditing = props.initialEditing && canEdit.value) {
|
||||
try {
|
||||
if (!props.databaseType) throw new Error("Connection type is unavailable.");
|
||||
const schema = props.schema || props.database;
|
||||
const result = await api.getObjectSource(props.connectionId, props.database, schema, props.name, props.objectType);
|
||||
const result = await api.getObjectSource(props.connectionId, props.database, schema, props.name, props.objectType, props.signature);
|
||||
const editableAllowed = result.editable !== false;
|
||||
const editable = await buildEditableObjectSource({
|
||||
databaseType: props.databaseType,
|
||||
|
||||
@@ -1881,7 +1881,8 @@ function dropObjectSqlOptionsForNode(node: TreeNode): DropObjectSqlOptions | nul
|
||||
databaseType: tableStructureDatabaseTypeForNode(node),
|
||||
objectType: node.type === "view" ? "VIEW" : node.type === "materialized_view" ? "MATERIALIZED_VIEW" : node.type === "procedure" ? "PROCEDURE" : "FUNCTION",
|
||||
schema: node.schema,
|
||||
name: node.label,
|
||||
name: node.objectName || node.label,
|
||||
signature: node.signature,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2402,7 +2403,7 @@ async function confirmRenameObject() {
|
||||
await connectionStore.ensureConnected(node.connectionId);
|
||||
if (supportsSourceBackedRoutineRename(dbType, objectType as any)) {
|
||||
const schema = node.schema || node.database;
|
||||
const source = await api.getObjectSource(node.connectionId, node.database, schema, node.label, objectType as any);
|
||||
const source = await api.getObjectSource(node.connectionId, node.database, schema, node.objectName || node.label, objectType as any, node.signature);
|
||||
const statements = await buildRoutineRenameObjectSourceStatements({
|
||||
databaseType: dbType!,
|
||||
objectType: objectType as any,
|
||||
@@ -5938,7 +5939,8 @@ function treeItemMenuItems(): ContextMenuItem[] {
|
||||
:connection-id="objectSourceTarget.node.connectionId!"
|
||||
:database="objectSourceTarget.node.database!"
|
||||
:schema="objectSourceTarget.node.schema"
|
||||
:name="objectSourceTarget.node.label"
|
||||
:name="objectSourceTarget.node.objectName || objectSourceTarget.node.label"
|
||||
:signature="objectSourceTarget.node.signature"
|
||||
:object-type="objectSourceType"
|
||||
:database-type="objectSourceDatabaseType"
|
||||
:dialect="objectSourceDialect"
|
||||
|
||||
Reference in new issue
Block a user