jsql

package module
v0.0.0-...-aab5e02 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

*************************************************************************** MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************

*************************************************************************** MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************

*************************************************************************** MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSqlServerString

func CreateSqlServerString(server string, user string, pass string, db string) string

func CreateSqliteString

func CreateSqliteString(file string, config string) string

func CreateSqliteStringWithPass

func CreateSqliteStringWithPass(file string, user string, pass string, config string) string

Types

type SqlServerUtils

type SqlServerUtils struct {
	SqlUtils
	IsOpen bool
}

* add by yjh 211125 * for sqlserver *

func BuildSqlServer

func BuildSqlServer() *SqlServerUtils

func (*SqlServerUtils) CloseSqlServer

func (s *SqlServerUtils) CloseSqlServer()

func (*SqlServerUtils) ConnectSqlServer

func (s *SqlServerUtils) ConnectSqlServer(constr string) bool

func (*SqlServerUtils) ConnectSqlServerString

func (s *SqlServerUtils) ConnectSqlServerString(server string, user string, pass string, db string) bool

type SqlUtils

type SqlUtils struct {
	Db     *sql.DB
	Result sql.Result
	Tx     *sql.Tx
	Stmt   *sql.Stmt
	// contains filtered or unexported fields
}

* add by yjh 211109 * define base type *

func (*SqlUtils) Begin

func (s *SqlUtils) Begin() bool

func (*SqlUtils) End

func (s *SqlUtils) End() bool

func (*SqlUtils) Error

func (s *SqlUtils) Error() string

func (*SqlUtils) ExecBatch

func (s *SqlUtils) ExecBatch(args ...interface{}) bool

func (*SqlUtils) ExecCmd

func (s *SqlUtils) ExecCmd(cmd string) bool

func (*SqlUtils) ExecCmdWithArgs

func (s *SqlUtils) ExecCmdWithArgs(cmd string, args ...interface{}) bool

func (*SqlUtils) GetInt

func (s *SqlUtils) GetInt(cmd string) (int64, bool)

func (*SqlUtils) GetString

func (s *SqlUtils) GetString(cmd string) (string, bool)

func (*SqlUtils) Prepare

func (s *SqlUtils) Prepare(cmd string) bool

func (*SqlUtils) SetError

func (s *SqlUtils) SetError(err error)

type SqliteUtils

type SqliteUtils struct {
	SqlUtils
	DbFile string
}

* add by yjh 211125 * for sqlserver *

func BuildSqlite

func BuildSqlite() *SqliteUtils

func (*SqliteUtils) OpenFile

func (s *SqliteUtils) OpenFile(dbFile string) bool

func (*SqliteUtils) OpenFileWithPass

func (s *SqliteUtils) OpenFileWithPass(dbFile string, user string, pass string) bool

Jump to

Keyboard shortcuts

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