From 6ca5f7950d6f58d76b654890ef8a4a4fa09acd30 Mon Sep 17 00:00:00 2001 From: Hinne Stolzenberg Date: Tue, 24 Mar 2026 07:32:23 +0100 Subject: [PATCH] docs: warn about shared sqlcmd context in CLI docs Multiple Claude sessions and users share the same sqlcmd config file. Another session can switch the context at any time, so always set it explicitly before every query using chained && commands. --- lib/llm/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/llm/index.js b/lib/llm/index.js index 0cea814..69389ac 100644 --- a/lib/llm/index.js +++ b/lib/llm/index.js @@ -49,11 +49,11 @@ Common context names: local, dev, prod-ro, prod ### Running Queries -After switching contexts, run queries with the \`query\` subcommand: +**Always set the context explicitly before every query.** Multiple Claude sessions and users share the same sqlcmd config — another session can switch the context at any time. Never assume the current context is what you expect. \`\`\`bash -sqlcmd query "SELECT @@VERSION" -sqlcmd query -d MyDatabase "SELECT TOP 10 * FROM Users" +sqlcmd config use-context local && sqlcmd query "SELECT @@VERSION" +sqlcmd config use-context stage && sqlcmd query -d MyDatabase "SELECT TOP 10 * FROM Users" sqlcmd -i ./scripts/query.sql \`\`\`