dbtools

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 6 Imported by: 1

README

dbtools

Operaciones en Base de datos, elimination tablas, creación db copia de data etc...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddColumn

func AddColumn(table_name, column_name, data_type string, tx *sql.Tx, ctx context.Context) bool

func CreateTableInTransaction

func CreateTableInTransaction(table model.Object, tx *sql.Tx, ctx context.Context) bool

func FetchAll

func FetchAll(rows *sql.Rows) ([]map[string]string, error)

FetchAll .

func FetchOne

func FetchOne(rows *sql.Rows) (map[string]string, error)

FetchOne .

func IdpkTABLA

func IdpkTABLA(keyNameIN, table_name string) (primarykey, primaryKeyThisTable bool)

IdpkTABLA recibe kname y tabla name retorna 2 true si: es fk y pkey de la tabla

func New

func New(db *sql.DB, orm ormAdapter) *operation

ormAdapter: SQLTableInfo() string //sql como obtiene la base de datos el nombre de la tabla SQLColumName() string //sql como se llama a la columna en el motor de base de datos SQLDropTable() string //sql de eliminación de tabla

func RenameColumn

func RenameColumn(table_name, old_column, new_column string, tx *sql.Tx, ctx context.Context) bool

func RenameTable

func RenameTable(old_name, new_name string, tx *sql.Tx, ctx context.Context) bool

func ScanOne

func ScanOne(rows *sql.Rows, columnCount int, columns []string) (map[string]string, error)

ScanOne

func SelectAll

func SelectAll(sql string, st *sql.DB, ctx context.Context) (rowsMap []map[string]string, ok bool)

SelectAll...

func SelectOne

func SelectOne(sql string, st *sql.DB, ctx context.Context) (rowsMap map[string]string, ok bool)

Types

This section is empty.

Jump to

Keyboard shortcuts

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