I have a React/Node.js project, in which I want to have a local database for development purposes.
I have the SQL code to create and populate tables in a file called db-setup.sql
.
How would I go about creating a script that would initialize a database in PostgreSQL and create the tables based on the queries in the db-setup.sql
file? I assume more things have to be initialized, but am unsure where to start.
I am new to writing such scripts, so any help is welcome!