Documentation ¶
Overview ¶
Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Index ¶
- Variables
- func TempDir(op string) string
- type CharsetData
- type Collation
- type Collations
- type DataTable
- type Enum
- type Field
- type FieldInfo
- type FieldType
- type FieldTypeGroup
- type ForeignKeyParam
- type Grant
- type IndexInfo
- type Indexes
- type KV
- type Operation
- type Partition
- type Privilege
- type Privileges
- type ProcessList
- type Result
- func (r *Result) Error() error
- func (r *Result) Exec(p *factory.Param) *Result
- func (r *Result) Execs(p *factory.Param) *Result
- func (r *Result) GetAffected() int64
- func (r *Result) GetBeginTime() string
- func (r *Result) GetElapsedTime() string
- func (r *Result) GetError() string
- func (r *Result) GetSQL() string
- func (r *Result) GetSQLs() []string
- func (r *Result) Queries(p *factory.Param, readRows func(*sql.Rows) error) *Result
- func (r *Result) Query(p *factory.Param, readRows func(*sql.Rows) error) *Result
- func (r *Result) QueryRow(p *factory.Param, recvs ...interface{}) *Result
- func (r *Result) SetError(err error)
- type SelectData
- type SupportedEngine
- type TableStatus
- type Trigger
- type TriggerOption
- type TriggerOptions
Constants ¶
This section is empty.
Variables ¶
var ( //Charsets MySQL 支持的字符集 Charsets = utils.Charsets // UnsignedTags 无符号标签 UnsignedTags = []string{"unsigned", "zerofill", "unsigned zerofill"} // EnumLength 枚举选项 EnumLength = "'(?:''|[^'\\\\]|\\\\.)*'" // OnActions used in foreignKeys() OnActions = "RESTRICT|NO ACTION|CASCADE|SET NULL|SET DEFAULT" // PartitionTypes 分区类型 PartitionTypes = []string{`HASH`, `LINEAR HASH`, `KEY`, `LINEAR KEY`, `RANGE`, `LIST`} )
var SQLTempDir = os.TempDir
SQLTempDir sql文件缓存目录获取函数(用于导入导出SQL)
Functions ¶
Types ¶
type CharsetData ¶
type CharsetData struct { Charset sql.NullString Description sql.NullString DefaultCollation sql.NullString Maxlen sql.NullInt64 }
type Collation ¶
type Collation struct { Collation sql.NullString Charset sql.NullString `json:"-"` Id sql.NullInt64 `json:"-"` Default sql.NullString `json:"-"` Compiled sql.NullString `json:"-"` Sortlen sql.NullInt64 `json:"-"` PadAttribute sql.NullString `json:"-"` }
type Collations ¶
func NewCollations ¶
func NewCollations() *Collations
type DataTable ¶ added in v1.3.0
type DataTable struct { Columns []string Values []map[string]*sql.NullString }
func NewDataTable ¶ added in v1.3.0
func NewDataTable() *DataTable
type Field ¶
type Field struct { Field string Full_type string Type string Length string Unsigned string Default sql.NullString Null bool AutoIncrement sql.NullString On_update string On_delete string Collation string Privileges map[string]int Comment string Primary bool Original string // contains filtered or unexported fields }
type FieldInfo ¶
type FieldInfo struct { Field sql.NullString Type sql.NullString Collation sql.NullString Null sql.NullString Key sql.NullString Default sql.NullString Extra sql.NullString Privileges sql.NullString Comment sql.NullString }
type FieldTypeGroup ¶
func (*FieldTypeGroup) IsNumeric ¶
func (f *FieldTypeGroup) IsNumeric(typeName string) bool
func (*FieldTypeGroup) IsString ¶
func (f *FieldTypeGroup) IsString(typeName string) bool
type ForeignKeyParam ¶
type Grant ¶
type IndexInfo ¶
type IndexInfo struct { Table sql.NullString Non_unique sql.NullString Key_name sql.NullString Seq_in_index sql.NullString Column_name sql.NullString Collation sql.NullString Cardinality sql.NullString Sub_part sql.NullString Packed sql.NullString Null sql.NullString Index_type sql.NullString Comment sql.NullString Index_comment sql.NullString Visible sql.NullString }
type Operation ¶
type Operation struct { Revoke []string Grant []string Columns string On string User string Scope string //all|database|table|column|proxy }
func (*Operation) HasAllPrivileges ¶
type Partition ¶
type Partition struct { Method sql.NullString Position sql.NullString Expression sql.NullString Names []string Values []string }
type Privilege ¶
type Privilege struct { Privilege sql.NullString Context sql.NullString Comment sql.NullString }
type Privileges ¶
type Privileges struct { Privileges []*Privilege // contains filtered or unexported fields }
func NewPrivileges ¶
func NewPrivileges() *Privileges
func (*Privileges) Parse ¶
func (p *Privileges) Parse()
type ProcessList ¶
type ProcessList struct { Id sql.NullInt64 User sql.NullString Host sql.NullString Db sql.NullString Command sql.NullString Time sql.NullInt64 State sql.NullString Info sql.NullString Progress sql.NullFloat64 }
type Result ¶
type Result struct { SQL string SQLs []string RowsAffected int64 TimeStart time.Time TimeEnd time.Time Started string Elapsed string ErrorString string // contains filtered or unexported fields }
func (*Result) GetAffected ¶
func (*Result) GetBeginTime ¶
func (*Result) GetElapsedTime ¶
type SelectData ¶ added in v1.3.0
type SupportedEngine ¶
type SupportedEngine struct { Engine sql.NullString //CSV|InnoDB|MyISAM|MEMORY... Support sql.NullString //YES|DEFAULT Comment sql.NullString Transactions sql.NullString //NO|YES XA sql.NullString //NO|YES Savepoints sql.NullString //NO|YES }
type TableStatus ¶
type TableStatus struct { Name sql.NullString Engine sql.NullString Version sql.NullString Row_format sql.NullString Rows sql.NullInt64 Avg_row_length sql.NullInt64 Data_length sql.NullInt64 Max_data_length sql.NullInt64 Index_length sql.NullInt64 Data_free sql.NullInt64 Auto_increment sql.NullInt64 Create_time sql.NullString Update_time sql.NullString Check_time sql.NullString Collation sql.NullString Checksum sql.NullString Create_options sql.NullString Comment sql.NullString }
func (*TableStatus) FKSupport ¶
func (t *TableStatus) FKSupport(currentVersion string) bool
func (*TableStatus) IsView ¶
func (t *TableStatus) IsView() bool
func (*TableStatus) Size ¶
func (t *TableStatus) Size() int64
type Trigger ¶
type Trigger struct { Trigger sql.NullString Event sql.NullString Table sql.NullString Statement sql.NullString Timing sql.NullString Created sql.NullString Sql_mode sql.NullString Definer sql.NullString Character_set_client sql.NullString Collation_connection sql.NullString Database_collation sql.NullString Of string Type string }
type TriggerOption ¶
type TriggerOptions ¶
type TriggerOptions []*TriggerOption
func (TriggerOptions) Get ¶
func (t TriggerOptions) Get(typeName string) []string