Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Data Population | Deployment and Database
course content

Course Content

Next.js 14

Data PopulationData Population

Let's add some initial data to the database.

Look for the file named seed.js in the scripts folder of the project. This script contains instructions for creating and seeding tables for invoices, sellers, users, and income.

Don't worry if you don't fully understand the code details. In essence, the script uses SQL to create the tables and populates them with data from the placeholder-data.js file.

To proceed, add the following line to your scripts in the package.json file:

package.json

To proceed, we need to access the terminal and execute the following command: npm run seed.

We should see the following messages in the terminal, indicating that the data was successfully populated.

content
Spend some time inspecting the data we populated. Follow the instructions below to find the data storage.

Database Testing

Navigate to the "Query" tab to execute the SQL request. Let's attempt to run the following query.

We should get the following result:

In Practice

Everything was clear?

Section 4. Chapter 4
course content

Course Content

Next.js 14

Data PopulationData Population

Let's add some initial data to the database.

Look for the file named seed.js in the scripts folder of the project. This script contains instructions for creating and seeding tables for invoices, sellers, users, and income.

Don't worry if you don't fully understand the code details. In essence, the script uses SQL to create the tables and populates them with data from the placeholder-data.js file.

To proceed, add the following line to your scripts in the package.json file:

package.json

To proceed, we need to access the terminal and execute the following command: npm run seed.

We should see the following messages in the terminal, indicating that the data was successfully populated.

content
Spend some time inspecting the data we populated. Follow the instructions below to find the data storage.

Database Testing

Navigate to the "Query" tab to execute the SQL request. Let's attempt to run the following query.

We should get the following result:

In Practice

Everything was clear?

Section 4. Chapter 4
some-alt