MCPcopy Create free account
hub / github.com/app-generator/api-server-nodejs / connect

Function connect

src/server/database.ts:22–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20export let connection : Connection | undefined;
21
22export const connect = async (): Promise<Connection | undefined> => {
23 try {
24 const conn = await createConnection(options);
25 connection = conn;
26 console.log(`Database connection success. Connection name: '${conn.name}' Database: '${conn.options.database}'`);
27 } catch (err) {
28 console.log(err);
29 }
30 return undefined;
31};
32
33export const PrepareDB = () => new sqlite3.Database(':memory:');

Callers 3

updateUserFunction · 0.90
index.tsFile · 0.90
basic.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected