Google Cloud Datastore ORM

Viewed 1574

Is there some high level ORM for nodejs datastore client library? Because it becoming really hard to maintain relatively small application when entities referencing and objects versioning takes place. Just interested, should I start write my own bicycle or someone already wrote something like that?

If not, maybe there some separate libraries to implemented appropriate referencing mechanism?

2 Answers

You may try on this one, very well structure, written in Typescript.

https://www.npmjs.com/package/ts-datastore-orm

import {BaseEntity, Column, Entity} from "ts-datastore-orm";

@Entity({kind: "user"})
export class User extends BaseEntity {
    @Column({generateId: true})
    public id: number = 0;

    @Column({index: true})
    public total: number = 0;
}

async function main() {
    const user = User.create();
    await user.save();
    const id = user.id;
}
Related