Documentation
¶
Index ¶
- type DbConn
- func (dbConn *DbConn) Close(db *sql.DB) error
- func (dbConn *DbConn) ClosureError(err error) error
- func (dbConn *DbConn) Connect() (*sql.DB, error)
- func (dbConn *DbConn) ConnectionError(err error) error
- func (dbConn *DbConn) Exec(query string) error
- func (dbConn *DbConn) GetConn() DbConn
- func (dbConn *DbConn) GetConnString() string
- func (dbConn *DbConn) QueryExecError(err error) error
- func (dbConn *DbConn) RowScanError(err error) error
- type Enum
- type Table
- type TableColumn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DbConn ¶
DBConn database connection details
func (*DbConn) Close ¶
Close closes the connection with the database The method return an error if something goes wrong
func (*DbConn) ClosureError ¶ added in v1.0.1
CloseError returns a formatted database disconnection error
func (*DbConn) Connect ¶
Connect establishes a connection with the database and validates the connection The method return the db connection or an error if something goes wrong
func (*DbConn) ConnectionError ¶ added in v1.0.1
ConnectionError returns a formatted database connection error
func (*DbConn) Exec ¶
Exec executes a query on the database The method return an error if something goes wrong
func (*DbConn) GetConn ¶
getConn gets the database connection details from environment variables If the documented environment variables are not set the method return default values
func (*DbConn) GetConnString ¶
GetDBConnString gets the database connection details and returns the database connection string
func (*DbConn) QueryExecError ¶ added in v1.0.1
QueryExecError returns a formatted database query execution error
func (*DbConn) RowScanError ¶ added in v1.0.1
RowScanError returns a formatted database error while scanning rows
type Enum ¶
Enum represents a Enum type in the database
func (*Enum) Create ¶
Create creates a new enum type in the database The method returns an error if something goes wrong
func (*Enum) Delete ¶
Delete removes the enum type from the database The method returns an error if something goes wrong
func (*Enum) Exists ¶
Exists checks if a enum type already exists or not in the database The method returns a boolean value and an error depending on the result
func (*Enum) Get ¶
Get returns a list of enum type values The method returns the values of a enum or an error
func (*Enum) IsValidEnumName ¶ added in v1.0.3
IsValidEnumName checks if enum name is not empty The method return an error if enum name is a empty value
type Table ¶
type Table struct { Name string Columns []TableColumn }
func (*Table) Create ¶
Create creates a new table in the database The method returns an error if something goes wrong
func (*Table) Delete ¶
Delete drops the table from tha database The method returns an error if something goes wrong