Skip to content

TheJumpyWizard/go-parse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Parse (WIP)

This is a SQL parser written in Go that can parse and analyze SQL statements. It supports basic SELECT and INSERT statements, as well as WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, and OFFSET clauses. It also includes basic semantic analysis checks to ensure that the input SQL statement is well-formed and conforms to the rules of SQL.

Getting Started

To build and run the SQL parser, you will need Go version 1.16 or later installed on your machine. To check your Go version, run the following command:

$ go version

If you don't have Go installed, you can download it from the official Go website.

To get started with the SQL parser, clone the repository and navigate to the project directory:

$ git clone https://github.com/your-username/go-parse.git
$ cd go-parse

Next, you can build and run the program using the following commands:

$ go build -o go-parse cmd/main.go
$ ./go-parse

This will start the SQL parser in interactive mode, where you can enter SQL statements and see the parsed result. To exit the program, type exit.

Usage

The SQL parser supports the following SQL statements:

  • SELECT Statement
    • The SELECT statement is used to select data from a database table.

SELECT column1, column2, ... FROM table_name WHERE condition GROUP BY column1, column2, ... HAVING condition ORDER BY column1 ASC/DESC, column2 ASC/DESC, ... LIMIT offset, count

  • INSERT Statement
    • The INSERT statement is used to insert new data into a database table.

INSERT INTO table_name (column1, column2, ...) VALUES (value1, value2, ...), (value1, value2, ...), ...

Contributing

If you find a bug, have a suggestion or an improvement, or just want to say hi, please open an issue or a pull request. All contributions are welcome!

About

Parse and analyze SQL statements using go & yacc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published