Documentation ¶
Overview ¶
Copyright 2016 Wenhui Shen <www.webx.top>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Wenhui Shen <www.webx.top>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Wenhui Shen <www.webx.top>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Wenhui Shen <www.webx.top>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Wenhui Shen <www.webx.top>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Wenhui Shen <www.webx.top>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Wenhui Shen <www.webx.top>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Wenhui Shen <www.webx.top>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Wenhui Shen <www.webx.top>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Wenhui Shen <www.webx.top>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Wenhui Shen <www.webx.top>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- type Collation
- type Collations
- 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 SupportedEngine
- type TableStatus
- type Trigger
- type TriggerOption
- type TriggerOptions
Constants ¶
This section is empty.
Variables ¶
var ( UnsignedTags = []string{"unsigned", "zerofill", "unsigned zerofill"} EnumLength = "'(?:''|[^'\\\\]|\\\\.)*'" OnActions = "RESTRICT|NO ACTION|CASCADE|SET NULL|SET DEFAULT" ///< @var string used in foreignKeys() PartitionTypes = []string{`HASH`, `LINEAR HASH`, `KEY`, `LINEAR KEY`, `RANGE`, `LIST`} )
Functions ¶
This section is empty.
Types ¶
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:"-"` }
type Collations ¶
func NewCollations ¶
func NewCollations() *Collations
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 }
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 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