MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / CustomConnection

Class CustomConnection

tests/Connection.test.ts:6–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4import { PostgreSqlDriver } from '@mikro-orm/postgresql';
5
6class CustomConnection extends Connection {
7 protected client: any;
8
9 override async close(force?: boolean): Promise<void> {
10 return undefined;
11 }
12
13 connect(): void {
14 return undefined;
15 }
16
17 async execute(query: string, params?: any[], method?: 'all' | 'get' | 'run'): Promise<QueryResult | any | any[]> {
18 return undefined;
19 }
20
21 async isConnected(): Promise<boolean> {
22 return false;
23 }
24
25 async checkConnection(): Promise<{ ok: true } | { ok: false; reason: string; error?: Error }> {
26 return { ok: false, reason: 'foo' };
27 }
28}
29
30describe('Connection', () => {
31 test('by default it throws when trying to use transactions', async () => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected