Original post


Im working on a project that’s meant to run a .Sql File that’s abasic CREATE TABLE statement with some parameters.

The statement would be something like: CREATE TABLE <name> and when I run main, I can define the parameter for name.

Then, I want to run this .Sql file on specific environments. So if I run main, Id like to define what Environment to run the file on.

When I ran main, and wanted to run the .sql file it could be something like: go run main.go dev tablenew.

Dev would be the environment and tablenew would be the parameter name for the created table.

Does anyone have any insight on how I can accomplish this? In the Ive run Sql statements via _, err = db.Exec, but Ive never worked with .Sql files.

Thank you in advance!