Documentation ¶
Index ¶
- func AddRow(newRow interface{}, tableName string) error
- func AddRows(newRows []interface{}, tableName string) error
- func Delete(serverTableName string, parameters []string) (bool, error)
- func DeleteFromTable(tableName string, parameters []string) error
- func DeleteFromView(viewName string, parameters []string) (bool, error)
- func Get(tableName string) ([]map[string]interface{}, error)
- func GetColTypeMap() map[string]string
- func GetColumnNames(tableName string) []string
- func GetForeignKeyColumns(tableName string) ([]string, map[string]map[string]interface{})
- func GetForeignKeyMap() map[string]ForeignKey
- func GetForeignKeyRows(tableName string) map[string]map[string]interface{}
- func GetForeignKeyValues(tableName string, colName string) map[string]interface{}
- func GetTableMap() map[string][]string
- func GetTableNames() []string
- func InitializeDatabase(username string, password string, environment string) sqlx.DB
- func IsTable(serverTableName string) bool
- func MakeView(viewName string, view string) error
- func Post(tableName string, jsonByte []byte) (string, error)
- func PostRows(tableName string, jsonByte []byte) error
- func PostViews(jsonByte []byte) (string, error)
- func Put(tableName string, parameters []string, jsonByte []byte) error
- func RunDeleteQuery(serverTableName string, parameters []string) error
- func StringToType(b []byte, t string) (interface{}, error)
- func TypeToString(data interface{}) (string, error)
- func UpdateRow(newRow interface{}, tableName string, parameters []string) error
- func UpdateRows(newRows []interface{}, tableName string, parameters []string) error
- type ForeignKey
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
********************************************************************************
- DELETE FUNCTIONALITY *******************************************************************************
func DeleteFromTable ¶
deletes from a table
func DeleteFromView ¶
deletes from a view
func GetColTypeMap ¶
returns a map of each column name in table to its appropriate GoLang tpye (name string)
func GetColumnNames ¶
returns array of column names from table in database
func GetForeignKeyColumns ¶
func GetForeignKeyMap ¶
func GetForeignKeyMap() map[string]ForeignKey
func GetForeignKeyRows ¶
func GetForeignKeyValues ¶
func GetTableMap ¶
func GetTableNames ¶
func GetTableNames() []string
returns array of table name strings from queried database
func InitializeDatabase ¶
********************************************************************************
- DB INITIALIZE: Connects given DB creds, creates ColMap FOR SESSION *******************************************************************************
func IsTable ¶
********************************************************************************
- HELPER FUNCTIONS *******************************************************************************
if is table, returns 1. else (for example, is view), returns 0.
func Post ¶
********************************************************************************
- POST FUNCTIONALITY *******************************************************************************
func Put ¶
********************************************************************************
- PUT FUNCTIONALITY *******************************************************************************
func RunDeleteQuery ¶
runs query of format "delete from tableName where parameterA=valueA and..."
func StringToType ¶
given a []byte b and type t, return b in t form
func TypeToString ¶
given data of generic type, returns data of string type
func UpdateRows ¶
Types ¶
type ForeignKey ¶
func MakeForeignKey ¶
func MakeForeignKey(table string, column string, alias string) ForeignKey