postgres

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MSG_FUNCION_NOT_FOUND     = "Function not found"
	MSG_COMMAND_NOT_FOUND     = "Command not found"
	MSG_JDB_NOT_DEFINED       = "JDB not defined"
	MSG_VERSION_NOT_SUPPORTED = "PostgreSQL version:%s json_object is not supported"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection added in v0.1.20

type Connection struct {
	Database string `json:"database"`
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Username string `json:"username"`
	Password string `json:"password"`
	App      string `json:"app"`
	Version  int    `json:"version"`
}

func (*Connection) Chain added in v0.1.20

func (s *Connection) Chain() (string, error)

* * Chain * @return string, error *

func (*Connection) ToJson added in v0.1.20

func (s *Connection) ToJson() et.Json

* * ToJson * @return et.Json *

func (*Connection) Validate added in v0.1.20

func (s *Connection) Validate() error

* * Validate * @return error *

type Postgres

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

func (*Postgres) ChangePassword

func (s *Postgres) ChangePassword(username, password, confirmation string) error

* * ChangePassword * @param username, password, confirmation string * @return error *

func (*Postgres) Command

func (s *Postgres) Command(command *jdb.Command) (et.Items, error)

* * Command * @param command *jdb.Command * @return et.Items, error *

func (*Postgres) Connect

func (s *Postgres) Connect(connection jdb.ConnectParams) (*sql.DB, error)

* * Connect * @param connection jdb.ConnectParams * @return *sql.DB, error *

func (*Postgres) Count

func (s *Postgres) Count(ql *jdb.Ql) (int, error)

* * Count * @param ql *jdb.Ql * @return int, error *

func (*Postgres) CreateDatabase

func (s *Postgres) CreateDatabase(db *sql.DB, name string) error

* * CreateDatabase * @param db *sql.DB, name string * @return error *

func (*Postgres) CreateUser

func (s *Postgres) CreateUser(username, password, confirmation string) error

* * CreateUser * @param username, password, confirmation string * @return error *

func (*Postgres) DeleteUser

func (s *Postgres) DeleteUser(username string) error

* * DeleteUser * @param username string * @return error *

func (*Postgres) DropDatabase

func (s *Postgres) DropDatabase(db *sql.DB, name string) error

* * DropDatabase * @param db *sql.DB, name string * @return error *

func (*Postgres) DropModel

func (s *Postgres) DropModel(model *jdb.Model) error

* * DropModel * @param model *jdb.Model * @return error *

func (*Postgres) DropSchema

func (s *Postgres) DropSchema(name string) error

* * DropSchema * @param name string * @return error *

func (*Postgres) EmptyModel added in v0.1.18

func (s *Postgres) EmptyModel(model *jdb.Model) error

* * EmptyModel * @param model *jdb.Model * @return error *

func (*Postgres) ExistDatabase added in v0.1.20

func (s *Postgres) ExistDatabase(db *sql.DB, name string) (bool, error)

* * ExistDatabase * @param db *DB, name string * @return bool, error *

func (*Postgres) Exists

func (s *Postgres) Exists(ql *jdb.Ql) (bool, error)

* * Exists * @param ql *jdb.Ql * @return bool, error *

func (*Postgres) GrantPrivileges

func (s *Postgres) GrantPrivileges(username, database string) error

* * GrantPrivileges * @param username, database string * @return error *

func (*Postgres) LoadModel

func (s *Postgres) LoadModel(model *jdb.Model) error

* * LoadModel * @param model *jdb.Model * @return error *

func (*Postgres) MutateModel

func (s *Postgres) MutateModel(model *jdb.Model) error

* * MutateModel * @param model *jdb.Model * @return error *

func (*Postgres) Name

func (s *Postgres) Name() string

func (*Postgres) Select

func (s *Postgres) Select(ql *jdb.Ql) (et.Items, error)

* * Select * @param ql *jdb.Ql * @return et.Items, error *

Jump to

Keyboard shortcuts

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