typeorm
Version:
Data-Mapper ORM for TypeScript and ES2023+. Supports MySQL/MariaDB, PostgreSQL, MS SQL Server, Oracle, SAP HANA, SQLite, MongoDB databases.
31 lines (30 loc) • 1.15 kB
TypeScript
import type { DataSource } from "../data-source/DataSource";
import type { QueryRunner } from "../query-runner/QueryRunner";
import { EntityManager } from "./EntityManager";
/**
* A special EntityManager that includes import/export and load/save function
* that are unique to Sql.js.
*/
export declare class SqljsEntityManager extends EntityManager {
readonly "@instanceof": symbol;
private driver;
constructor(dataSource: DataSource, queryRunner?: QueryRunner);
/**
* Loads either the definition from a file (Node.js) or localstorage (browser)
* or uses the given definition to open a new database.
*
* @param fileNameOrLocalStorageOrData
*/
loadDatabase(fileNameOrLocalStorageOrData: string | Uint8Array): Promise<void>;
/**
* Saves the current database to a file (Node.js) or localstorage (browser)
* if fileNameOrLocalStorage is not set options.location is used.
*
* @param fileNameOrLocalStorage
*/
saveDatabase(fileNameOrLocalStorage?: string): Promise<void>;
/**
* Returns the current database definition.
*/
exportDatabase(): Uint8Array;
}