https://github.com/634750802/tidb-sql-parser
Parse TiDB SQL with wasm
https://github.com/634750802/tidb-sql-parser
Last synced: 2 months ago
JSON representation
Parse TiDB SQL with wasm
- Host: GitHub
- URL: https://github.com/634750802/tidb-sql-parser
- Owner: 634750802
- Created: 2022-10-20T09:24:47.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-13T08:50:26.000Z (over 2 years ago)
- Last Synced: 2024-10-18T16:25:54.979Z (8 months ago)
- Language: Go
- Homepage: https://634750802.github.io/tidb-sql-parser/
- Size: 209 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TiDB SQL Parser
***WIP*** This project provide a wasm library for parsing TiDB SQL.
The wasm module will create a global function `__tidbSqlParse(sql: string): Ast[]`.## Prepare
- go 1.18
- nodeIt's recommended to set GO path in this directory.(e.g. `.go`)
```shell
# Copy go wasm runtime script to static dir
npm run prepare:go-wasm-runtime# Apply some patches to go mods to support wasm
npm run prebuild
```## Build
```shell
npm run build
```## Preview
```shell
# Install a simple web server `serve`
npm i# Normally, the http server would listen 3000 if available
npm start
```Visit `http://127.0.0.1:3000/` and have fun!
Open browser console and type `__tidbSqlParse('SELECT * FROM TiDB')`