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

Function scanSingleLineComment

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

Source from the content-addressed store, hash-verified

13}
14
15function scanSingleLineComment(sql: string, i: number): SQLToken | null {
16 if (sql[i] !== "-" || sql[i + 1] !== "-") { return null; }
17 let j = i;
18 while (j < sql.length && sql[j] !== "\n") { j++; }
19 return { type: TokenType.Comment, end: j };
20}
21
22/**
23 * MySQL/MariaDB single-line comment scanner. Unlike ANSI SQL, MySQL and MariaDB

Callers 4

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

Calls

no outgoing calls

Tested by

no test coverage detected