书栈网 · BookStack 本次搜索耗时 0.008 秒,为您找到 243 个相关结果.
  • Using Repositories

    Using Repositories Using Repositories Now let’s refactor our code and use Repository instead of EntityManager .Each entity has its own repository which handles all operations ...
  • 隐藏列

    隐藏列 隐藏列 如果要查询的模型具有”select:false”的列,则必须使用addSelect 函数来从列中检索信息。 假设你有以下实体: import { Entity , PrimaryGeneratedColumn , Column } from "typeorm" ; @Entity () ex...
  • 从数据库加载

    从数据库加载 从数据库加载 让我们使用 Repository 尝试更多的加载操作: import { createConnection } from "typeorm" ; import { Photo } from "./entity/Photo" ; createConnection ( /*.....
  • Creating and inserting a photo into the database

    Creating and inserting a photo into the database Creating and inserting a photo into the database Now let’s create a new photo to save it in the database: import { createCon...
  • Create a model

    Create a model Create a model Working with a database starts from creating tables.How do you tell TypeORM to create a database table?The answer is - through the models.Your mod...
  • 创建一个模型

    创建一个模型 创建一个模型 使用数据库从创建表开始。如何告诉 TypeORM 创建数据库表?答案是 - 通过模型。应用程序中的模型即是数据库中的表。 举个例子, 你有一个Photo 模型: export class Photo { id : number ; name : string ; descri...
  • Column data types

    Column data types Column data types Next, let’s fix our data types. By default, string is mapped to a varchar(255)-like type (depending on the database type).Number is mapped t...
  • 添加和插入 photo

    添加和插入 photo 添加和插入 photo 现在创建一个新的 photo 存到数据库: import { createConnection } from "typeorm" ; import { Photo } from "./entity/Photo" ; createConnection ( ...
  • Working with Repository

    What is Repository What is Repository Repository is just like EntityManager but its operations are limited to a concrete entity. You can access repository via getRepository(...
  • Asynchronous providers

    1147 2019-11-16 《Nest.js v6.0 Document》
    Asynchronous providers Injection Example Asynchronous providers At times, the application start should be delayed until one or more asynchronous tasks are completed. For exa...