db

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sql.DB

Functions

func AddColumn

func AddColumn(tableName string, columnName string, dataType string) error

AddColumn adds a column to a specified table.

@param tableName - name of the table @param columnName - name of column to be added @param dataType - field type of the new column

func ConnectDB

func ConnectDB(dbUri string) error

ConnectDB connects the fiber app to the database.

@param dbURI - database URI (eg: ./sqlite_database/data.db)

func CreateTable

func CreateTable(tableName string) error

CreateTable adds a table to the database.

@param tableName - name of the table

func DropTable

func DropTable(tableName string) error

DeleteTable deletes a table from the database.

@param tableName - name of the table

func GetSQLQuery

func GetSQLQuery(tableName string) (string, error)

func GetTables

func GetTables() ([]string, error)

GetTables gets list of tables from the database

Types

This section is empty.

Jump to

Keyboard shortcuts

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