UNPKG

firebase-admin-ql

Version:

A powerful library that bridges Firebase Admin SDK with PostgreSQL, simplifies interaction with stored procedures, facilitates seamless third-party API calls using fetch, and provides utility functions to streamline backend operations.

24 lines (23 loc) 1.01 kB
import { CollectionReference, DocumentData, Firestore } from "firebase-admin/firestore"; import { whereClause } from "../interfaces"; export declare class FirebaseModel { db: Firestore; collection: CollectionReference<DocumentData> | any; constructor(table: string, firestoreDB: Firestore); find(id: string): Promise<DocumentData | boolean>; dataExists(id: string): Promise<boolean>; update(data: object, id: string): Promise<boolean>; findAll(ids?: string[]): Promise<DocumentData[]>; findWhere({ wh }: { wh: whereClause[]; }): Promise<DocumentData[]>; save(data: object, id?: string | undefined): Promise<string | boolean>; delete(id: string): Promise<boolean>; addToArray(data: any[], key: string, id?: string): Promise<boolean>; doBackup({ whereKey, returnData, dbLabel, reference }: { whereKey?: string | string[]; returnData: object; dbLabel: string; reference?: string; }): Promise<boolean | string>; }