Skip to content
On this page

Seeding

In this document, we will explore how to use the Knex.js library with TypeScript to seed a database. Database seeding involves populating the database with initial data, such as default records or sample data, to aid in application development or testing.

Knex.js is a popular SQL query builder for JavaScript, which provides a flexible and convenient way to interact with databases. TypeScript is a statically typed superset of JavaScript that adds type safety and enhances code maintainability.

We will cover the following topics in this document:

  1. Setting up a project with Knex.js and TypeScript
  2. Creating seed files
  3. Running database seeders

Maintained by Passakon Puttasuwan & Dev Core Team.