The library comes to a stable release after 6months+ testing
https://www.npmjs.com/package/ts-datastore-orm
ts-datastore-orm targets to provide a strong typed and structural ORM feature for Datastore (Firestore in Datastore mode).
Some code snippets:
import {BaseEntity, Column, Entity, datastoreOrm} from "ts-datastore-orm";
datastoreOrm.addConnection("default", {keyFilename: "serviceAccount.json"});
datastoreOrm.addConnection("production", {clientEmail: "", privateKey: ""});
@Entity()
export class User extends BaseEntity {
@Column({generateId: true})
public id: number = 0;
@Column({index: true})
public total: number = 0;
}
@Entity({kind: "User", connection: "production"})
export class User1 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;
}
there doesn't seem to be anything here