This library is free of use, and is a helpful list of functions I have used over and over in code.
List of functions to help the end user with their projects To use the tool add toolkit "github.com/David-Billingsley/SQL_ToolKit" to your code base
And in your function put var data DataBaseTools.Data
If a username and password is passed to the functions it will generate the user and password connection string. If there is no user / password then the system will use the Windows Auth connection string.
This function takes the following parameters fpath (filepath), server(SQL Server name), database ( database name), user, password. It will read any file in the current directory, and attempt to pass the query into sql. Checks to see if file is .sql suffix. If the number of files sent is greater then 0 it will send a true message back if zero sends false back.
This function takes the following parameters, server(SQL Server name), database ( database name), user, password, table ( this is the table name ). This function will read the column names and data types found in the table. If the table doesn't exist, the function will return an error. If the table does exist it will return the column names and types in a map.
This function takes the following parameters, server(SQL Server name), database ( database name), user, password. This function will read the table names found in the supplied database. If the tables doesn't exist, the function will return an error. If the tables does exist it will return the column names and types in a map.