jdb

package
v1.0.43 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandDefine = "DEFINE"
	CommandInsert = "INSERT"
	CommandUpdate = "UPDATE"
	CommandDelete = "DELETE"
)
View Source
const Postgres = "postgres"

Variables

This section is empty.

Functions

func ChangePassword added in v0.0.85

func ChangePassword(db *DB, name, password string) error

Changue password

func CreateColumn added in v0.0.85

func CreateColumn(db *DB, schema, table, name, kind, defaultValue string) error

Create column

func CreateDatabase added in v0.0.85

func CreateDatabase(db *DB, name string) error

Crate database

func CreateIndex added in v0.0.85

func CreateIndex(db *DB, schema, table, field string) error

Create index

func CreateSchema added in v0.0.85

func CreateSchema(db *DB, name string) error

Create schema

func CreateSequence added in v0.0.169

func CreateSequence(db *DB, schema, tag string) error

Create serie

func CreateTrigger added in v0.0.108

func CreateTrigger(db *DB, schema, table, name, when, event, function string) error

Create trigger

func CreateUser added in v0.0.85

func CreateUser(db *DB, name, password string) error

Create user

func DropColumn added in v0.0.107

func DropColumn(db *DB, schema, table, name string) error

Drop column

func DropDatabase added in v0.0.107

func DropDatabase(db *DB, name string) error

Drop database

func DropIndex added in v0.0.107

func DropIndex(db *DB, schema, table, field string) error

Drop index

func DropSchema added in v0.0.107

func DropSchema(db *DB, name string) error

Drop schema

func DropSerie added in v0.0.108

func DropSerie(db *DB, schema, name string) error

Drop serie

func DropTable added in v0.0.107

func DropTable(db *DB, schema, name string) error

Drop table

func DropTrigger added in v0.0.108

func DropTrigger(db *DB, schema, table, name string) error

Drop trigger

func DropUser added in v0.0.107

func DropUser(db *DB, name string) error

Drop user

func ExistColum added in v0.0.85

func ExistColum(db *DB, schema, table, name string) (bool, error)

Exist column

func ExistDatabase added in v0.0.85

func ExistDatabase(db *DB, name string) (bool, error)

Exist database

func ExistIndex added in v0.0.85

func ExistIndex(db *DB, schema, table, field string) (bool, error)

Exist index

func ExistSchema added in v0.0.85

func ExistSchema(db *DB, name string) (bool, error)

Exist schema

func ExistSerie added in v0.0.85

func ExistSerie(db *DB, schema, name string) (bool, error)

Exist serie

func ExistTable added in v0.0.85

func ExistTable(db *DB, schema, name string) (bool, error)

Exist table

func ExistTrigger added in v0.0.108

func ExistTrigger(db *DB, schema, table, name string) (bool, error)

Exist trigger

func ExistUser added in v0.0.85

func ExistUser(db *DB, name string) (bool, error)

Exist user

func InitCore added in v0.0.169

func InitCore(db *DB) error

func LastSerie added in v0.0.169

func LastSerie(db *DB, tag string) int

func NextCode added in v0.0.169

func NextCode(db *DB, tag, prefix string) string

func NextSerie added in v0.0.169

func NextSerie(db *DB, tag string) int64

func SQLDDL

func SQLDDL(sql string, args ...any) string

* * SQLDDL * @param sql string * @param args ...any * @return string *

func SQLParse

func SQLParse(sql string, args ...any) string

* * SQLParse * @param sql string * @param args ...any * @return string *

func SQLQuote

func SQLQuote(sql string) string

* * SQLQuote * @param sql string * @return string *

func SetSerie added in v0.0.169

func SetSerie(db *DB, tag string, val int) (int, error)

Types

type DB

type DB struct {
	Description string
	Driver      string
	Host        string
	Port        int
	Dbname      string
	Connection  string
	UseCore     bool
	// contains filtered or unexported fields
}

func ConnectTo added in v0.0.169

func ConnectTo(driver, host string, port int, dbname, user, password, application_name string) (*DB, error)

func Load

func Load() (*DB, error)

* * Load * @return *Conn, error *

func (*DB) Close added in v0.0.174

func (c *DB) Close() error

func (*DB) Command added in v0.0.174

func (d *DB) Command(opt, id, sql string, args ...any) (et.Item, error)

* * Command * @param db *DB * @param sql string * @param args ...any * @return et.Items * @return error *

func (*DB) Describe added in v0.0.174

func (c *DB) Describe() et.Json

func (*DB) GetCommand added in v0.0.174

func (d *DB) GetCommand(id string) (et.Item, error)

* * GetCommand * @params id string * @return js.Item * @return error *

func (*DB) Query added in v0.0.174

func (d *DB) Query(sql string, args ...any) (et.Items, error)

* * Query * @param db *DB * @param sql string * @param args ...any * @return et.Items * @return error *

func (*DB) QueryOne added in v0.0.174

func (d *DB) QueryOne(sql string, args ...any) (et.Item, error)

* * QueryOne * @param db *DB * @param sql string * @param args ...any * @return et.Item * @return error *

func (*DB) SetCommand added in v0.0.174

func (d *DB) SetCommand(opt, id, query string) error

* * SetCommand * @params query string *

func (*DB) SetListen added in v0.0.174

func (db *DB) SetListen(channels []string, listen HandlerListend)

* * SetListen * @param channels []string * @param listen HandlerListend *

func (*DB) SetMutex added in v0.0.174

func (d *DB) SetMutex(opt, id, query string, index int64) error

* * SetMutex * @params id string * @params query string * @params index int64 * @return error *

func (*DB) Source added in v0.0.174

func (d *DB) Source(sourceField string, sql string, args ...any) (et.Items, error)

* * Source * @param db *DB * @param sourceField string * @param sql string * @param args ...any * @return et.Items * @return error *

func (*DB) SourceOne added in v0.0.174

func (d *DB) SourceOne(sourceField string, sql string, args ...any) (et.Item, error)

* * SourceOne * @param db *DB * @param sourceField string * @param sql string * @param args ...any * @return et.Item * @return error *

func (*DB) SyncCommand added in v0.0.174

func (d *DB) SyncCommand() error

* * SyncCommand * @return error *

type HandlerListend added in v0.0.174

type HandlerListend func(res et.Json)

Jump to

Keyboard shortcuts

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