JonathanJ
Denoβ€’15mo agoβ€’
3 replies
Jonathan

Setting up Deno 2.0 with Fresh and TypeORM

I am trying to setup my first deno project ever using Fresh and TypeORM. I have setup 2 files

A data.ts

import { DataSource } from "npm:typeorm";
import { User } from "../modules/auth/user.model.ts";

const dataSource = new DataSource({
    type: "mssql",
    url: Deno.env.get("DATABASE_URL"),
    entities: [User],
});

export default dataSource;


And a user.model.ts

import { Column, Entity, PrimaryColumn } from "npm:typeorm";

@Entity({ name: "User" })
export class User {
    @PrimaryColumn()
    id: string;

    @Column()
    email: string;

}


I am getting a few errors in the user.model.ts , I am not sure if I am importing type orm correctly.

Unable to resolve signature of property decorator when called as an expression. 



I am also not sure how to properly install the mssql properly for deno, do I do that in the deno.json? If so how?

And last, I am getting an error of an uncaught promise in Reflect.getMetadata.

How do I get around this?
Was this page helpful?