SQL Server ORM for Node JS like .net Entity Framework?

sqougxex  于 2023-03-17  发布在  .NET
关注(0)|答案(4)|浏览(153)

I am new in node JS, and try to implement CRUD using Node JS, Express JS , MS SQL, EJS. And I am already finished with CRUD.

But I am looking for some more reliable way to pass data or object from node to sql and vice versa.

I have to write an INSERT SQL query when I am going to insert record i.e creating entry in any table.

So, can any one know, is there any ORM which help me to deals with SQL query Like we deals in .net entity framework ?

Thank in advance.

11dmarpk

11dmarpk2#

Here are some ORM and their comparison Sequelize is one of the most downloaded and featured ORM for node.js

Visit for more detail

2mbi3lxu

2mbi3lxu3#

TypeORM seems to be the best suited for Entity Framework nowdays

It allows to define entities very much like Entity Framework does with data annotations.

Plus it is totally TypeScript friendly. =)

import {Entity, PrimaryGeneratedColumn, Column} from "typeorm";

@Entity()
export class User {

    @PrimaryGeneratedColumn()
    id: string;

    @Column()
    firstName: string;

    @Column()
    lastName: string;

    @Column()
    isActive: boolean;

}
whlutmcx

whlutmcx4#

My answer is maybe late but now You have option to use C#/EF in node http://tjanczuk.github.io/edge/#/

相关问题