Documentation
¶
Overview ¶
tongue-demon. A cli tool to generate go code from your sql code. Copyright (C) 2020 Rotten Network
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
tongue-demon. A cli tool to generate go code from your sql code. Copyright (C) 2020 Rotten Network
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
tongue-demon. A cli tool to generate go code from your sql code. Copyright (C) 2020 Rotten Network
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Index ¶
- type Column
- type ColumnCateg
- type ColumnType
- type Condition
- type Constraint
- type ExpressionNode
- type Join
- type KeyType
- type NodeType
- type Operator
- type Parameter
- type RelationType
- type Statement
- func (s *Statement) AddChild(cs *Statement)
- func (s *Statement) AddColumn(cl *Column)
- func (s *Statement) AddCondition(cond *Condition)
- func (s *Statement) AddField(f string)
- func (s *Statement) AddInsert(is *[]string)
- func (s *Statement) AddJoin(join *Join)
- func (s *Statement) AddUpdate(u *UpdateField)
- func (s *Statement) FindColumns(field string, term interface{}) []*Column
- func (s *Statement) GetChildren() []*Statement
- func (s *Statement) GetColumns() []*Column
- func (s *Statement) GetConditions() []*Condition
- func (s *Statement) GetFields() []string
- func (s *Statement) GetInserts() []*[]string
- func (s *Statement) GetJoinByNameOrAlias(a string) *Join
- func (s *Statement) GetJoins() []*Join
- func (s *Statement) GetParent() *Statement
- func (s *Statement) GetTable() *Table
- func (s *Statement) GetUpdates() []*UpdateField
- func (s *Statement) SetColumns(c []*Column)
- func (s *Statement) SetConditions(conditions []*Condition)
- func (s *Statement) SetParent(ps *Statement)
- func (s *Statement) SetTable(table *Table) *Table
- type Table
- type Type
- type UpdateField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Column ¶
type Column struct { Name string Type ColumnType Length int Nullable bool KeyType KeyType Constrains []Constraint Default string References string //if foreign key ,Table name reference Extras []string }
type ColumnCateg ¶
type ColumnCateg int
const ( UnknownCategory ColumnCateg = iota Integer Float Boolean String Date )
type ColumnType ¶
type ColumnType interface { GetName() string GetCateg() ColumnCateg }
type ExpressionNode ¶
type ExpressionNode struct { Lchild *ExpressionNode Rchild *ExpressionNode Parent *ExpressionNode Evaluated bool IsUnique bool Type NodeType Val string }
func NewExpressionNode ¶
func NewExpressionNode(val string, Type NodeType) *ExpressionNode
func (*ExpressionNode) PushNode ¶
func (n *ExpressionNode) PushNode(node *ExpressionNode)
type Parameter ¶
type Parameter struct { Name string Type ColumnCateg }
type RelationType ¶
type RelationType int
const ( Unknown RelationType = iota OneToOne OneToMany ManyToMany )
type Statement ¶
type Statement struct { Type Type Table *Table //Root Table Joins []*Join //All statement Joins Columns []*Column Conditions []*Condition Updates []*UpdateField InsertSets []*[]string Fields []string //Used for SELECT Children []*Statement RootExpressionNode *ExpressionNode Parent *Statement }
Statement represents a parsed query
func (*Statement) AddUpdate ¶
func (s *Statement) AddUpdate(u *UpdateField)
func (*Statement) FindColumns ¶
func (*Statement) GetUpdates ¶
func (s *Statement) GetUpdates() []*UpdateField