2.0.0 • Published 3 years ago

tortoise-orm v2.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

What is Tortoise-orm

Tortoise is a small wrapper around firebase-admin for better typescript integration and manage collection easily.

Why use Tortoise-orm ?

  • Tortoise-orm implement the same function that firestore, so it's easy to implement
  • Tortoise-orm was built with TS in mind, so you know what you get in your document
  • Tortoise-orm was built to be as small as possible
  • Tortoise-orm implement some other useful functions like the data function to get document's data directly

How to use Tortoise-orm

To use tortoise-orm you first need to create a client :

import { createNewTortoiseClient } from "./createNewTortoiseClient";

export const client = createNewTortoiseClient(firebaseApp);

Now you can use tortoise-orm like you would do with firebase-admin for example if you want to create a doc you can do this like that :

interface User {
  email: string;
  firstname: string;
  lastname: string;
  age: number
}

const doc = await client.collection<User>("users").add({ email: "email", firstname: "john", lastname: "doe", age: 35 });

Furthermore, you can use the special tortoise-orm function. For example if you want to update all the users where the name is john you can do like that :

const users = await client.collection<"User">("user").where("firstname", "==", "john").update({ firstname: "Paul" });

🔥 Roadmap

  • Implement better typing for fieldvalue
  • Better verification on where condition
  • Add more example with typescript on readme
2.0.0

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.6

3 years ago

1.2.0

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago