mango-orm 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -271,6 +271,7 @@ declare class Mango {
271
271
  getTables(): MangoTable<any>[];
272
272
  createTable<T>(name: string, fields: Record<string, MangoType>): Promise<MangoTable<T>>;
273
273
  dropTable(name: string): Promise<void>;
274
+ haveTable(name: string): boolean;
274
275
  customQuery<Type>(query: string, supplies: any[]): Promise<Type>;
275
276
  }
276
277
  export { Mango, MangoType, MangoTable };
package/dist/src/mango.js CHANGED
@@ -707,6 +707,14 @@ class Mango {
707
707
  }
708
708
  }
709
709
  }
710
+ haveTable(name) {
711
+ for (const table of this.tables) {
712
+ if (table.getName() === name.toLowerCase()) {
713
+ return true;
714
+ }
715
+ }
716
+ return false;
717
+ }
710
718
  customQuery(query, supplies) {
711
719
  return this.query.customQuery(query, supplies);
712
720
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mango-orm",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "description": "A lightweight, type-safe MySQL ORM for Node.js and TypeScript",
6
6
  "main": "dist/src/mango.js",