@mikro-orm/sql 7.0.0-dev.104 → 7.0.0-dev.106

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.
@@ -48,10 +48,8 @@ export declare abstract class AbstractSqlConnection extends Connection {
48
48
  private prepareQuery;
49
49
  execute<T extends QueryResult | EntityData<AnyEntity> | EntityData<AnyEntity>[] = EntityData<AnyEntity>[]>(query: string | NativeQueryBuilder | RawQueryFragment, params?: readonly unknown[], method?: 'all' | 'get' | 'run', ctx?: Transaction, loggerContext?: LoggingOptions): Promise<T>;
50
50
  stream<T extends EntityData<AnyEntity>>(query: string | NativeQueryBuilder | RawQueryFragment, params?: readonly unknown[], ctx?: Transaction<Kysely<any>>, loggerContext?: LoggingOptions): AsyncIterableIterator<T>;
51
- /**
52
- * Execute raw SQL queries from file
53
- */
54
- loadFile(path: string): Promise<void>;
51
+ /** @inheritDoc */
52
+ executeDump(dump: string): Promise<void>;
55
53
  private getSql;
56
54
  protected transformRawResult<T>(res: any, method?: 'all' | 'get' | 'run'): T;
57
55
  }
@@ -196,15 +196,11 @@ export class AbstractSqlConnection extends Connection {
196
196
  throw e;
197
197
  }
198
198
  }
199
- /**
200
- * Execute raw SQL queries from file
201
- */
202
- async loadFile(path) {
199
+ /** @inheritDoc */
200
+ async executeDump(dump) {
203
201
  await this.ensureConnection();
204
- const { readFile } = globalThis.process.getBuiltinModule('node:fs/promises');
205
- const buf = await readFile(path);
206
202
  try {
207
- const raw = CompiledQuery.raw(buf.toString());
203
+ const raw = CompiledQuery.raw(dump);
208
204
  await this.getClient().executeQuery(raw);
209
205
  }
210
206
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/sql",
3
- "version": "7.0.0-dev.104",
3
+ "version": "7.0.0-dev.106",
4
4
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -56,6 +56,6 @@
56
56
  "@mikro-orm/core": "^6.6.2"
57
57
  },
58
58
  "peerDependencies": {
59
- "@mikro-orm/core": "7.0.0-dev.104"
59
+ "@mikro-orm/core": "7.0.0-dev.106"
60
60
  }
61
61
  }