MCPcopy Create free account
hub / github.com/bytebase/dbhub / createMockConnector

Function createMockConnector

src/tools/__tests__/search-objects.test.ts:10–27  ·  view source on GitHub ↗
(id: ConnectorType = 'sqlite')

Source from the content-addressed store, hash-verified

8
9// Mock connector for testing
10const createMockConnector = (id: ConnectorType = 'sqlite'): Connector => ({
11 id,
12 name: 'Mock Connector',
13 getId: () => 'default',
14 dsnParser: {} as any,
15 connect: vi.fn(),
16 disconnect: vi.fn(),
17 clone: vi.fn(),
18 getSchemas: vi.fn(),
19 getTables: vi.fn(),
20 getViews: vi.fn(),
21 tableExists: vi.fn(),
22 getTableSchema: vi.fn(),
23 getTableIndexes: vi.fn(),
24 getStoredProcedures: vi.fn(),
25 getStoredProcedureDetail: vi.fn(),
26 executeSQL: vi.fn(),
27});
28
29// Helper function to parse tool response
30const parseToolResponse = (response: any) => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected