Categorygithub.com/codeindex2937/oracle-sql-parser
modulepackage
0.0.0-20240901153106-99e560b6376a
Repository: https://github.com/codeindex2937/oracle-sql-parser.git
Documentation: pkg.go.dev

# README

Oracle SQL Parser

this is an oracle sql parser. ref: https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf

supported statement

statementsub statementyaccast
Alter tableAdd column:heavy_check_mark::heavy_check_mark:
Alter tableModify column:heavy_check_mark::heavy_check_mark:
Alter tableDrop column:heavy_check_mark::heavy_check_mark:
Alter tableRename column:heavy_check_mark::heavy_check_mark:
Alter tableAdd constraint:heavy_check_mark::heavy_check_mark:
Alter tableModify constraint:heavy_check_mark::heavy_check_mark:
Alter tableRename constraint:heavy_check_mark::heavy_check_mark:
Alter tableDrop constraint:heavy_check_mark::heavy_check_mark:
Create tableRelational table:heavy_check_mark::heavy_check_mark:
Create indexRelational table:heavy_check_mark:
Drop table-:heavy_check_mark::heavy_check_mark:
Drop index-:heavy_check_mark::heavy_check_mark:

usage

package main

import (
	"fmt"
	"github.com/codeindex2937/oracle-sql-parser"
	"github.com/codeindex2937/oracle-sql-parser/ast"
)

func main() {
	stmts, err := parser.Parser("alter table db1.t1 add (id number, name varchar2(255))")
	if err != nil {
		fmt.Println(err)
		return
	}
	stmt := stmts[0]
	switch s := stmt.(type) {
	case *ast.AlterTableStmt:
		fmt.Println(s.TableName.Table.Value) // t1
	}
}

# Packages

No description provided by the author

# Functions

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