Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/camertron/mysql-parser-rb
A MySQL query parser for Ruby.
https://github.com/camertron/mysql-parser-rb
Last synced: 18 days ago
JSON representation
A MySQL query parser for Ruby.
- Host: GitHub
- URL: https://github.com/camertron/mysql-parser-rb
- Owner: camertron
- Created: 2020-03-23T20:59:37.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-29T05:57:56.000Z (almost 5 years ago)
- Last Synced: 2024-11-04T00:42:03.684Z (2 months ago)
- Language: C++
- Size: 886 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mysql-parser-rb
A MySQL query parser for Ruby.NOTE: this thing doesn't work yet.
# What?
This repo is an attempt to write Ruby bindings for parsers generated by [ANTLR](https://github.com/antlr/antlr4). I've started out by generating a parser for MySQL queries, but hopefully that's just the beginning. It would be rad to be able to generate parsers for arbitrary ANTLR grammars and make them available to Ruby, complete with visitors, listeners, etc.
# Local Dev
1. Initialize the ANTLR submodule:
```bash
git submodule init
```
2. Install dependencies:
```bash
bundle install
```
3. Generate a makefile:
```
ruby ext/mysql-parser/extconf.rb
```
4. Build
```bash
make
```
5. Run the test script
```bash
bundle exec ruby tester.rb
```You should see a segfault. Everything appears to work except for at the very end when Ruby tries to exit. Trying to figure out why. It seems to only happen if a C++ object is referenced in Ruby. It doesn't even have to be retained to cause the segfault, only referenced.
# Authors
Cameron C. Dutro [https://github.com/camertron](https://github.com/camertron)