mssql

package
v2.0.0-...-8094968 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package mssql implements gdb.Driver, which supports operations for MSSql.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() gdb.Driver

New create and returns a driver that implements gdb.Driver, which supports operations for Mssql.

Types

type DriverMssql

type DriverMssql struct {
	*gdb.Core
}

DriverMssql is the driver for SQL server database.

func (*DriverMssql) DoFilter

func (d *DriverMssql) DoFilter(ctx context.Context, link gdb.Link, sql string, args []interface{}) (newSql string, newArgs []interface{}, err error)

DoFilter deals with the sql string before commits it to underlying sql driver.

func (*DriverMssql) DoInsert

func (d *DriverMssql) DoInsert(ctx context.Context, link gdb.Link, table string, list gdb.List, option gdb.DoInsertOption) (result sql.Result, err error)

DoInsert is not supported in mssql.

func (d *DriverMssql) FilteredLink() string

FilteredLink retrieves and returns filtered `linkInfo` that can be using for logging or tracing purpose.

func (*DriverMssql) GetChars

func (d *DriverMssql) GetChars() (charLeft string, charRight string)

GetChars returns the security char for this type of database.

func (*DriverMssql) New

func (d *DriverMssql) New(core *gdb.Core, node *gdb.ConfigNode) (gdb.DB, error)

New creates and returns a database object for SQL server. It implements the interface of gdb.Driver for extra database driver installation.

func (*DriverMssql) Open

func (d *DriverMssql) Open(config *gdb.ConfigNode) (db *sql.DB, err error)

Open creates and returns an underlying sql.DB object for mssql.

func (*DriverMssql) TableFields

func (d *DriverMssql) TableFields(ctx context.Context, table string, schema ...string) (fields map[string]*gdb.TableField, err error)

TableFields retrieves and returns the fields information of specified table of current schema.

Also see DriverMysql.TableFields.

func (*DriverMssql) Tables

func (d *DriverMssql) Tables(ctx context.Context, schema ...string) (tables []string, err error)

Tables retrieves and returns the tables of current schema. It's mainly used in cli tool chain for automatically generating the models.

Jump to

Keyboard shortcuts

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