Categorygithub.com/redhajuanda/sqlparser
repositorypackage
1.0.0
Repository: https://github.com/redhajuanda/sqlparser.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

SQLParser

This repository is a clone of github.com/vitessio/vitess, specifically focusing on the SQL parser module. It provides an interface to parse SQL queries into structured statements for further processing.

License

This project applies the same LICENSE as vitessio/vitess.

Installation

go get github.com/redhajuanda/sqlparser

Usage

import (
	"github.com/redhajuanda/sqlparser"
)

func main() {
	ps, err := sqlparser.New(sqlparser.Options{})
	if err != nil {
		panic(err)
	}

	// Parse SQL query to sqlparser statement
	stmt, err := ps.Parse("SELECT * FROM employees")
	if err != nil {
		panic(err)
	}

	// Handle the statement based on the type
	switch stmt := stmt.(type) {
	case *sqlparser.Select:
		// Do something with SELECT statement
	}
}

Features

  • Parses SQL queries into structured statements.
  • Supports multiple SQL statement types.
  • Provides an easy-to-use API for handling parsed statements.

Acknowledgments

This project is based on the SQL parser module from Vitess.

Important Notice

This repository will be regularly updated and synced with changes from the original repository. If there are any updates that I may have missed, please don't hesitate to comment or open an issue to bring it to my attention.