MCPcopy Create free account
hub / github.com/bytebase/dbhub / scanDoubleQuotedString

Function scanDoubleQuotedString

src/utils/sql-parser.ts:90–99  ·  view source on GitHub ↗
(sql: string, i: number)

Source from the content-addressed store, hash-verified

88}
89
90function scanDoubleQuotedString(sql: string, i: number): SQLToken | null {
91 if (sql[i] !== '"') { return null; }
92 let j = i + 1;
93 while (j < sql.length) {
94 if (sql[j] === '"' && sql[j + 1] === '"') { j += 2; }
95 else if (sql[j] === '"') { j++; break; }
96 else { j++; }
97 }
98 return { type: TokenType.QuotedBlock, end: j };
99}
100
101// Matches $$ or $tag$ where tag is [a-zA-Z_]\w* (digits after $ do NOT start a tag, so $1 is safe)
102const dollarQuoteOpenRegex = /^\$([a-zA-Z_]\w*)?\$/;

Callers 5

scanTokenAnsiFunction · 0.85
scanTokenPostgresFunction · 0.85
scanTokenMySQLFunction · 0.85
scanTokenSQLiteFunction · 0.85
scanTokenSQLServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected