Skip to content
Yuki Tanaka edited this page Jan 31, 2021 · 19 revisions

TODO: Move this page to .md in repo

Development

Versioning

TODO: Current versioning is not ideal 😢

How to release

  1. Update src/version.ts
  2. Make a new release.

How to bump Deno

  1. Update ci.yml
  2. Bump deno_std using dem
$ dem update https://deno.land/std@0.67.0

Limitations/Differences

Decorator metadata is not supported

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;
}

@TransactionRepository is not supported

This decorator depends on decorator metadata.

@Column

  • ColumnOptions.type is required.
    • This is due to lack of decorator metadata support.

binary type is mapped to Uint8Array instead of Buffer

  • This is because in Deno, binary data is usually represented by a Uint8Array.

glob

The following patterns are not supported:

  • /path/to/entities/*{.js,.ts}

(sqlite only) @CreateDateColumn and @UpdateDateColumn are not currently supported

SqliteDriver

Some types are treated differently from the original typeorm:

  • int8, bigint, and unsigned big int are mapped to BigInt #88

Required permissions

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

Articles