fix(sqlserver): preserve local temp table count sessions
This commit is contained in:
6 files changed
+158
-8
No files matched your search
@@ -0,0 +1,12 @@
|
||||
import { tokenizeSqlSemantic, unquoteSqlSemanticIdentifier } from "@/lib/sql/semantic/tokens";
|
||||
import type { DatabaseType } from "@/types/database";
|
||||
|
||||
export function sqlServerCountUsesLocalTempTable(databaseType: DatabaseType | undefined, sql: string): boolean {
|
||||
if (databaseType !== "sqlserver" || !sql) return false;
|
||||
|
||||
return tokenizeSqlSemantic(sql, "sqlserver").some((token) => {
|
||||
if (token.kind !== "word" && token.kind !== "quoted_identifier") return false;
|
||||
const identifier = token.kind === "quoted_identifier" ? unquoteSqlSemanticIdentifier(token) : token.text;
|
||||
return identifier.startsWith("#") && !identifier.startsWith("##");
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user