Implement Create Operation

Follow the step-by-step instructions to create an entity and save an address to a MySQL database.

Connecting the TypeORM entity and repository

Now we’ve learned how to configure TypeORM within our app. In this lesson, we’ll dive into creating entities and repositories. We’ll also explore how to update our service methods and connect these key components.

Create an entity

An entity represents a database table and its data. Below is AddressEntity with the @Entity() decorator that marks it as a TypeORM entity. The name property specifies the table name in the database.

Get hands-on with 1400+ tech skills courses.