Skip to content

Commit

Permalink
[Docs] Add note on the use of TypeORM
Browse files Browse the repository at this point in the history
  • Loading branch information
LoicPoullain committed Apr 18, 2022
1 parent 9388e52 commit c05c80e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
9 changes: 6 additions & 3 deletions docs/docs/tutorials/simple-todo-list/3-the-todo-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ id: tuto-3-the-todo-model
slug: 3-the-todo-model
---

Let’s create your first model. The CLI provides a useful command to generate a new file with an empty model.
The next step is to take care of the database. By default, every new project in FoalTS is configured to use an `SQLite` database as it does not require any additional installation.

Let’s start by creating your first model. The CLI provides a useful command to generate a new file with an empty model.

```sh
foal generate entity todo
```

> FoalTS uses [TypeORM](http://typeorm.io), a complete *Object-Relational Mapper*, to communicate with the database(s). In TypeORM, simple models are called *entities* and are classes decorated with the `Entity` decorator.
:::info

FoalTS uses [TypeORM](http://typeorm.io) as the default ORM in any new application. This way, you don't have to configure anything and you can start a project quickly. However, if you wish, you still can choose to [use another one](../../databases/using-another-orm.md) ([Prisma](https://www.prisma.io/), [MikroORM](https://mikro-orm.io/), [Mongoose](https://mongoosejs.com/), etc), as the framework code is ORM independent.

> Every new project in FoalTS uses an `SQLite` database as it does not require any additional installation. But TypeORM supports many other databases. We will keep this one in this tutorial for simplicity.
:::

Open the file `todo.entity.ts` in the `src/app/entities` directory and add a `text` column.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ id: tuto-3-the-todo-model
slug: 3-the-todo-model
---

Vamos a crear su primer modelo. El CLI proporciona un comando útil para generar un nuevo archivo con un modelo vacío.
El siguiente paso es ocuparse de la base de datos. Por defecto, cada nuevo proyecto en FoalTS está configurado para utilizar una base de datos `SQLite` ya que no requiere ninguna instalación adicional.

Empecemos por crear su primer modelo. El CLI proporciona un comando útil para generar un nuevo archivo con un modelo vacío.

```sh
foal generate entity todo
```

> FoalTS utiliza [TypeORM](http://typeorm.io), un completo *Object-Relational Mapper*, para comunicarse con la(s) base(s) de datos. En TypeORM, los modelos simples se llaman *entidades* y son clases decoradas con el decorador `Entity`.
:::info

FoalTS utiliza [TypeORM](http://typeorm.io) como ORM por defecto en cualquier aplicación nueva. De esta manera, no tiene que configurar nada y puede empezar un proyecto rápidamente. Sin embargo, si lo desea, puede optar por [usar otro](../../databases/using-another-orm.md) ([Prisma](https://www.prisma.io/), [MikroORM](https://mikro-orm.io/), [Mongoose](https://mongoosejs.com/), etc), ya que el código del framework es independiente del ORM.

> Cada nuevo proyecto en FoalTS utiliza una base de datos `SQLite` ya que no requiere ninguna instalación adicional. Pero TypeORM soporta muchas otras bases de datos. Mantendremos esta en este tutorial por simplicidad.
:::

Abra el archivo `todo.entity.ts` en el directorio `src/app/entities` y añada una columna `text`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ id: tuto-3-the-todo-model
slug: 3-the-todo-model
---

Créons votre premier modèle. La CLI fournit une commande utile pour générer un nouveau fichier avec un modèle vide.
L'étape suivante consiste à s'occuper de la base de données. Par défaut, chaque nouveau projet dans FoalTS est configuré pour utiliser une base de données `SQLite` car elle ne nécessite aucune installation supplémentaire.

Commençons par créer votre premier modèle. Le CLI fournit une commande utile pour générer un nouveau fichier avec un modèle vide.

```sh
foal generate entity todo
```

> FoalTS utilise [TypeORM](http://typeorm.io), un *Object-Relational Mapper* complet, pour communiquer avec la (les) base(s) de données. Dans TypeORM, les modèles simples sont appelés *entités* et sont des classes décorées avec le décorateur `Entity`.
:::info

FoalTS utilise [TypeORM](http://typeorm.io) comme ORM par défaut dans toute nouvelle application. De cette façon, vous n'avez rien à configurer et vous pouvez démarrer un projet rapidement. Toutefois, si vous le souhaitez, vous pouvez toujours choisir d'en [utiliser un autre](../../databases/using-another-orm.md) ([Prisma](https://www.prisma.io/), [MikroORM](https://mikro-orm.io/), [Mongoose](https://mongoosejs.com/), etc), le code du framework étant indépendant de l'ORM.

> Chaque nouveau projet dans FoalTS utilise une base de données `SQLite` car elle ne nécessite aucune installation supplémentaire. Mais TypeORM prend en charge de nombreuses autres bases de données. Nous garderons celle-ci dans ce tutoriel pour plus de simplicité.
:::

Ouvrez le fichier `todo.entity.ts` dans le répertoire `src/app/entities` et ajoutez une colonne `text`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ id: tuto-3-the-todo-model
slug: 3-the-todo-model
---

Let’s create your first model. The CLI provides a useful command to generate a new file with an empty model.
The next step is to take care of the database. By default, every new project in FoalTS is configured to use an `SQLite` database as it does not require any additional installation.

Let’s start by creating your first model. The CLI provides a useful command to generate a new file with an empty model.

```sh
foal generate entity todo
```

> FoalTS uses [TypeORM](http://typeorm.io), a complete *Object-Relational Mapper*, to communicate with the database(s). In TypeORM, simple models are called *entities* and are classes decorated with the `Entity` decorator.
:::info

FoalTS uses [TypeORM](http://typeorm.io) as the default ORM in any new application. This way, you don't have to configure anything and you can start a project quickly. However, if you wish, you still can choose to [use another one](../../databases/using-another-orm.md) ([Prisma](https://www.prisma.io/), [MikroORM](https://mikro-orm.io/), [Mongoose](https://mongoosejs.com/), etc), as the framework code is ORM independent.

> Every new project in FoalTS uses an `SQLite` database as it does not require any additional installation. But TypeORM supports many other databases. We will keep this one in this tutorial for simplicity.
:::

Open the file `todo.entity.ts` in the `src/app/entities` directory and add a `text` column.

Expand Down

0 comments on commit c05c80e

Please sign in to comment.