Documentation
¶
Overview ¶
Copyright © 2020 NAME HERE <EMAIL ADDRESS>
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 © 2020 NAME HERE <EMAIL ADDRESS>
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 © 2020 NAME HERE <EMAIL ADDRESS>
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 ¶
Constants ¶
This section is empty.
Variables ¶
var DBTypeToStructTypeDbrInfo = map[string]string{
"int": "dbr.NullInt64",
"tinyint": "dbr.NullInt64",
"smallint": "dbr.NullInt64",
"bigint": "dbr.NullInt64",
"varchar": "dbr.NullString",
"text": "dbr.NullString",
"mediumtext": "dbr.NullString",
"json": "dbr.NullString",
"longtext": "dbr.NullString",
"char": "dbr.NullString",
"timestamp": "dbr.NullTime",
"datetime": "dbr.NullTime",
"date": "dbr.NullTime",
"time": "dbr.NullTime",
"double": "dbr.NullFloat64",
"decimal": "dbr.NullFloat64",
"float": "dbr.NullFloat64",
}
var DBTypeToStructTypeInfo = map[string]string{
"int": "int64",
"tinyint": "int8",
"smallint": "int16",
"bigint": "int64",
"varchar": "string",
"text": "string",
"mediumtext": "string",
"json": "string",
"longtext": "string",
"char": "string",
"timestamp": "time.Time",
"datetime": "time.Time",
"date": "time.Time",
"time": "time.Time",
"double": "float64",
"decimal": "float64",
"float": "float64",
}
Functions ¶
Types ¶
type DBModel ¶
func (*DBModel) ConnectMysql ¶
type StringBool ¶
type StringBool string
const ( StringBoolYes StringBool = "YES" StringBoolNO StringBool = "NO" )
type StructTpl ¶
type TableInfo ¶
type TableInfo struct { ColumnName string `db:"COLUMN_NAME" json:"column_name"` IsNullable StringBool `db:"IS_NULLABLE" json:"is_nullable"` DataType string `db:"DATA_TYPE" json:"data_type"` ColumnComment string `db:"COLUMN_COMMENT" json:"column_comment"` StructType string `db:"-" json:"-"` TagAround string `db:"-" json:"-"` }