go_db_postgre

package module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: MIT Imports: 10 Imported by: 0

README

go_db_postgre

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectionString

func ConnectionString(password string) string

conexión string por defecto postgres

Types

type PG

type PG struct {
	// contains filtered or unexported fields
}

PG formato cadena conexión

func NewConnection

func NewConnection(userDatabase, passwordDatabase, iPLocalServer, dataBasePORT, dataBaseName, directory_backup string) *PG

func (*PG) BackupDataBase

func (d *PG) BackupDataBase()

func (*PG) CHECK

func (p *PG) CHECK(db *go_storage.Connection) bool

CHECK verifica el estado de la base motor PG POSTGRES

func (*PG) ConnectionString

func (d *PG) ConnectionString() string

ConnectionString formato cadena de conexión postgres:// user : passwordDatabase @ 127.0.0.1 : 5432 / nombrebasedatos ?sslmode=disable"

func (*PG) CreateUserRolDB

func (p *PG) CreateUserRolDB(user_name, password string, db *go_storage.Connection) bool

func (*PG) DBExists

func (d *PG) DBExists() string

func (PG) DataBasEngine

func (d PG) DataBasEngine() string

DataBasEngine "postgres"

func (*PG) DataBaseMaintenance

func (d *PG) DataBaseMaintenance(db *go_storage.Connection)

func (PG) DataBaseName added in v0.0.8

func (d PG) DataBaseName() string

ej "mydb"

func (*PG) DeleleDataBASE

func (p *PG) DeleleDataBASE(db *go_storage.Connection)

DeleleDataBASE ..

func (*PG) DeleteAllTables

func (p *PG) DeleteAllTables(db *go_storage.Connection)

func (*PG) DeleteDataBase

func (p *PG) DeleteDataBase()

func (*PG) DeleteRolDataBase

func (p *PG) DeleteRolDataBase(rol_name string, db *go_storage.Connection)

func (*PG) DeleteTABLE

func (p *PG) DeleteTABLE(table_name string, db *go_storage.Connection)

DeleteTABLE elimina tabla de una base de datos

func (*PG) ExistDataBase

func (d *PG) ExistDataBase(data_base_name string, db *go_storage.Connection) bool

ExistDataBase verifica si existe una base de datos postgres determinada

func (*PG) ExistDataBaseROL

func (p *PG) ExistDataBaseROL(rol string, db *go_storage.Connection) bool

ExistDataBaseROL verifica si rol usuario aplicación existe

func (PG) GetNewID

func (PG) GetNewID() string

GetNewID retorna un id único para el ingreso a la base de datos tipo unix time

func (*PG) MakeSqInsertSyntax

func (d *PG) MakeSqInsertSyntax(i *byte, setValue *[]string)

func (*PG) PlaceHolders

func (d *PG) PlaceHolders(index ...uint8) string

SQLParameters string //ej: postgres: "$" sqlite "?",

func (*PG) ROLExists

func (d *PG) ROLExists() string

func (*PG) RestoreDataBase

func (d *PG) RestoreDataBase(file_name string) bool

func (*PG) SQLColumName

func (d *PG) SQLColumName() string

func (*PG) SQLDropTable

func (d *PG) SQLDropTable() string

func (*PG) SQLTableInfo

func (d *PG) SQLTableInfo() string

func (*PG) SetListSyntax

func (d *PG) SetListSyntax(key string, i byte, set *[]string)

SetListSyntax "%v=$%v"

func (*PG) SwapConnect

func (d *PG) SwapConnect() (backupDNS PG)

SwapConnect intercambia a la conexión por defecto del motor de la base de datos

func (*PG) TotalValuesSyntax

func (d *PG) TotalValuesSyntax(fields map[string]string) string

Jump to

Keyboard shortcuts

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