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

Function scanSingleQuotedString

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

Source from the content-addressed store, hash-verified

77}
78
79function scanSingleQuotedString(sql: string, i: number): SQLToken | null {
80 if (sql[i] !== "'") { return null; }
81 let j = i + 1;
82 while (j < sql.length) {
83 if (sql[j] === "'" && sql[j + 1] === "'") { j += 2; }
84 else if (sql[j] === "'") { j++; break; }
85 else { j++; }
86 }
87 return { type: TokenType.QuotedBlock, end: j };
88}
89
90function scanDoubleQuotedString(sql: string, i: number): SQLToken | null {
91 if (sql[i] !== '"') { return null; }

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