Skip to main content
Let’s create a simple TypeORM application that queries the Regatta database. Start by importing the relevant classes from the typeorm-regatta package:
Note that you should import all relevant classes based on the functionality of your application and its requirements.

Connection Details

Connection parameters will be defined as follows:

Example Appliaction

To help you get acquainted with TypeORM on Regatta, we’ve provided a simple code example below.
This application demonstrates common tasks such as defining entities, initializing a DataSource, inserting data, querying, updating, deleting, and cleaning up schema.

Project Structure

Create the following folder structure:

Example Code

Create the main program and save it as: src/typeorm_example.ts

TypeScript Configuration

Create tsconfig.json in the project root:

Package Setup

Create a package.json in the project root:
This package.json assumes you already downloaded the Regatta TypeORM package and the Node.js driver, and have them available on your local environment.Please ensure that you update the package.json file with the correct paths to the downloaded .tgz files before proceeding.

Running the Application

From the project root run:
Expected output: