-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support experimental access to ast
Signed-off-by: Carson Farmer <[email protected]>
- Loading branch information
1 parent
05efce0
commit 82eface
Showing
10 changed files
with
101 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
.vscode | ||
.vscode | ||
.DS_Store | ||
diagrams* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
</head> | ||
<body> | ||
<p> | ||
<code id="raw">SELECT * from blah WHERE id = 1;</code> | ||
</p> | ||
<script type="module"> | ||
// Load module | ||
import init from "../module.js"; | ||
// Initialize module | ||
await init(); | ||
// Parse content in header | ||
const { statements } = await globalThis.sqlparser.normalize( | ||
document.querySelector("#raw").innerText | ||
); | ||
// Create code element with parsed string | ||
const output = document.createElement("code"); | ||
output.id = "parsed"; | ||
output.innerHTML = statements.join(";"); | ||
// Add to body | ||
document.body.appendChild(output); | ||
</script> | ||
</body> | ||
</html> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
</head> | ||
|
||
<body> | ||
<p> | ||
<code id="raw">SELECT * from blah WHERE id = 1;</code> | ||
</p> | ||
<script type="module"> | ||
// Load module | ||
import init from "../esm/out.js"; | ||
// Initialize module | ||
await init(); | ||
// Parse content in header | ||
const { Statements } = await globalThis.sqlparser.getAst( | ||
document.querySelector("#raw").innerText | ||
); | ||
// Create code element with parsed string | ||
const output = document.createElement("code"); | ||
output.id = "parsed"; | ||
output.innerHTML = JSON.stringify(Statements, null, 2); | ||
// Add to body | ||
document.body.appendChild(output); | ||
</script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,5 @@ | |
"strict": true, | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"types": ["types.d.ts", "@types/node"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters