How to use the EntitySchema function from typeorm

Find comprehensive JavaScript typeorm.EntitySchema code examples handpicked from public code repositorys.

-1
fork icon29
star icon362
watch icon7

+ 13 other calls in file

-2
fork icon8
star icon69
watch icon9

+ 7 other calls in file

39
40
41
42
43
44
45
46
47
48
    this.name = name;
    this.groups = groups;
  }
}

const UserSchema = new EntitySchema({
  name: 'users',
  target: User,
  columns: {
    id: {
fork icon4
star icon3
watch icon3

+ 9 other calls in file

117
118
119
120
121
122
123
124
125
126
      entity["tableName"] = entity["tableName"] || entity["name"];
      if (JSON.parse(ormConnStr)["type"] == "oracle") {
        entity["tableName"] = entity["tableName"].toUpperCase();
        upperJSONKey(entity["columns"]);
      }
      return new typeorm.EntitySchema(entity);
    }
  });
  ormConn(ormConf, entitySchema);
}
fork icon0
star icon0
watch icon1

34
35
36
37
38
39
40
41
42
43
    this.initialize();
}
async initialize() {
    const config = await (0, helpers_1.loadConfig)('database');
    const entities = await this.getEntities();
    const modelEntities = (config.entities || []).map((schema) => new typeorm_1.EntitySchema(schema));
    modelEntities.push(...entities);
    this.datasource = new typeorm_1.DataSource({
        ...config,
        type: config.type,
fork icon0
star icon0
watch icon1

-2
fork icon0
star icon0
watch icon0

+ 3 other calls in file

-1
fork icon0
star icon0
watch icon0

+ 2 other calls in file