-
-
Notifications
You must be signed in to change notification settings - Fork 16
Home
Yuki Tanaka edited this page Jan 31, 2021
·
19 revisions
TODO: Move this page to .md in repo
TODO: Current versioning is not ideal 😢
$ dem update https://deno.land/std@0.67.0
Using decorator metadata in Deno causes circular references between entities for the following reasons:
- Deno only supports
esnext
as 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.type
as follows:
@Entity()
class User {
@PrimaryGeneratedColumn()
id: number;
@Column({ type: 'varchar' }) // or `@Column({ type: String })`
name!: string;
}
This decorator depends on decorator metadata.
-
ColumnOptions.type
is 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 int
are mapped toBigInt
#88
This module requires --allow-net
permission, because it uses dynamic import to implement lazy loading of third party modules. The following table shows the additional permissions required for each driver:
driver | --allow-read | --allow-write | --allow-env | --allow-plugin | --allow-run |
---|---|---|---|---|---|
sqlite | ✔️ | ✔️ | |||
postgres | |||||
mysql |