Here is the library. This is a package I write it for some production services.https://www.npmjs.com/package/ts-datastore-ormGithubFeature Highlights:Covering all features of datastore: query, transaction, ancestor, index, allocateIds, namespace, etc..Simple class structure using typescript decorator. (Very similar to type-orm)Support default values and variable casting. This will be useful if you decided to add/modify columns to an entity.Switching the namespace of entity easily.Quick Start: (With much more features, pls check out the link above.)import {BaseEntity, Column, Entity} from "ts-datastore-orm"; @Entity({namespace: "testing", kind: "user"}) export class User extends BaseEntity { @Column({generateId: true}) public id: number = 0; } async function main() { const user = User.create(); await user.save(); const id = user.id; }
Submitted December 17, 2019 at 08:53AM by plk83
No comments:
Post a Comment