-
-
Notifications
You must be signed in to change notification settings - Fork 16
Home
uki00a edited this page Jul 30, 2020
·
19 revisions
TODO: Move this page to .md in repo
TODO
$ dem update https://deno.land/[email protected]Using decorator metadata in Deno causes circular references between entities for the following reasons:
- Deno only supports
esnextas a compilation target. - TypeORM is not yet compatible with
esnext.
See also: https://github.com/typeorm/typeorm/issues/4103
Workarounds:
- use EntitySchema instead of ES decorators and decorator metadata.
- specify the column type with
ColumnOptions.typeas follows:
@Entity()
class User {
@PrimaryGeneratedColumn()
id: number;
@Column({ type: 'varchar' }) // or `@Column({ type: String })`
name!: string;
}This decorator depends on decorator metadata.
-
ColumnOptions.typeis required.- This is due to lack of decorator metadata support.
- This is because in Deno, binary data is usually represented by a Uint8Array.
The following patterns are not supported:
/path/to/entities/*{.js,.ts}
Some types are treated differently from the original typeorm:
-
int8,bigint, andunsigned big intshould be mapped toBigInt#88
| driver | --allow-read | --allow-write | --allow-net | --allow-env | --allow-plugin | --allow-run |
|---|---|---|---|---|---|---|
| sqlite | ✔️ | ✔️ | ||||
| postgres | ✔️ | |||||
| mysql | ✔️ |