New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embedded entities with entity schema #3632
Comments
I also have a case that I need help with here: export const AddressSchema = new EntitySchema<Address>({
name: "address",
columns: {
zipcode: {
name: "zipcode",
type: "text",
nullable: false
},
prefecture: {
name: "prefecture",
type: "text",
enum: Prefecture,
nullable: false
},
city: {
name: "city",
type: "text",
nullable: false
},
line1: [{
name: "line1",
type: string,
nullable: false
}]
}
})
export const UserSchema = new EntitySchema<User>(
{
name: "user",
columns: {
id: {
name: "user_id",
type: "uuid",
primary: true,
generated: true
},
email: {
type: "text",
nullable: false
},
address: {
name: "address",
type: AddressSchema // This is what I need to figure out
},
name: {
name: "name",
type: string
},
...timestampColumns,
...passwordColumn
}
}
) |
Ideally I want to hold all of this in the same table with |
What is the status of this? |
I'm switching from decorators to EntitySchema and this feature is essential for me. |
I would also really like this feature! Without it, I either have an ugly choice of flattening in my Domain Model or separating my Domain and Data models and adding an extra transformation between them. |
TS is a pretty raw stack as of me, you should take a look at c#, it ain't suffering from such things (children's issues). as I said before, this feature ought to have kept up with decorators way, IMHO P.S.: am gonna implement it |
Added `embeddeds` field into EntitySchemaOptions Added transformation to MetadataArgsStorage for embedded entities Updated docs Created new tests cases for EntitySceham with Embedded Entities Changed type for field: `target` in EmbeddedMetadataArgs CLOSES: typeorm#3632
Added `embeddeds` field into EntitySchemaOptions Added transformation to MetadataArgsStorage for embedded entities Updated docs Created new tests cases for EntitySceham with Embedded Entities Changed type for field: `target` in EmbeddedMetadataArgs CLOSES: typeorm#3632
Added `embeddeds` field into EntitySchemaOptions Added transformation to MetadataArgsStorage for embedded entities Updated docs Created new tests cases for EntitySceham with Embedded Entities Changed type for field: `target` in EmbeddedMetadataArgs CLOSES: typeorm#3632
Added `embeddeds` field into EntitySchemaOptions Added transformation to MetadataArgsStorage for embedded entities Updated docs Created new tests cases for EntitySchema with Embedded Entities Changed type for field: `target` in EmbeddedMetadataArgs CLOSES: typeorm#3632
Issue type:
[x] question
[ ] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[ ]
mongodb
[ ]
mssql
[ ]
mysql
/mariadb
[ ]
oracle
[x]
postgres
[ ]
sqlite
[ ]
sqljs
[ ]
react-native
[ ]
expo
TypeORM version:
[ ]
latest
[ ]
@next
[x]
0.2.12
(or put your version here)Steps to reproduce or a small repository showing the problem:
In the actual project I can not use decorators, therefore I describe the entities with entity schema.
Now, I wont use embedded entities., but it does not work.
The text was updated successfully, but these errors were encountered: