Skip to content

Commit 2ffa8ad

Browse files
plossonclaude
andcommitted
feat(sql): include username in profile display name
Format SQL profile names as username@host/database for better identification when multiple profiles connect to the same server. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 007e6a9 commit 2ffa8ad

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/commands/sql.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ const getSqlClient = createClientGetter<SqlCredentials, SqlClient>({
1616
function extractDisplayName(url: string): string {
1717
try {
1818
const parsed = new URL(url);
19+
const username = parsed.username ? decodeURIComponent(parsed.username) : '';
1920
const host = parsed.hostname || 'localhost';
2021
const db = parsed.pathname.replace(/^\//, '') || 'database';
21-
return `${host}/${db}`;
22+
return username ? `${username}@${host}/${db}` : `${host}/${db}`;
2223
} catch {
2324
return url.substring(0, 30);
2425
}

0 commit comments

Comments
 (0)