mysql

package
v0.0.0-...-da5a1f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Copyright 2017 by GoSpider author. 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

This section is empty.

Functions

This section is empty.

Types

type Mysql

type Mysql struct {
	Config MysqlConfig
	Client *sql.DB
}

a client

func New

func New(config MysqlConfig) Mysql

func (*Mysql) Create

func (db *Mysql) Create(prestring string, parm ...interface{}) (int64, error)

建表 Create table

func (*Mysql) Drop

func (db *Mysql) Drop(prestring string, parm ...interface{}) (int64, error)

删表

func (*Mysql) Insert

func (db *Mysql) Insert(prestring string, parm ...interface{}) (int64, error)

插入数据 Insert Data

func (*Mysql) Open

func (db *Mysql) Open(maxopen int, maxidle int)

打开数据库连接 open a connecttion

func (*Mysql) Select

func (db *Mysql) Select(prestring string, parm ...interface{}) (returnrows []map[string]interface{}, err error)

查询数据库 Query

type MysqlConfig

type MysqlConfig struct {
	Username string
	Password string
	Ip       string
	Port     string
	Dbname   string
}

Mysql config

func (MysqlConfig) CreateDb

func (dbconfig MysqlConfig) CreateDb() error

create database

func (MysqlConfig) DeleteDb

func (dbconfig MysqlConfig) DeleteDb() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL