MCPcopy Index your code
hub / github.com/Ptechgithub/pp-worker / getPlanetScaleConnection

Function getPlanetScaleConnection

_worker.js:151–162  ·  view source on GitHub ↗

* Creates a PlanetScale connection object and returns it. * @param {{DATABASE_HOST: string, DATABASE_USERNAME: string, DATABASE_PASSWORD: string}} env The environment variables containing the database connection information. * @returns {Promise } A Promise that resolves to the PlanetScale

(env)

Source from the content-addressed store, hash-verified

149 * @returns {Promise<object>} A Promise that resolves to the PlanetScale connection object.
150 */
151function getPlanetScaleConnection(env) {
152 const config = {
153 host: env.DATABASE_HOST,
154 username: env.DATABASE_USERNAME,
155 password: env.DATABASE_PASSWORD,
156 fetch: (url, init) => {
157 delete (init)["cache"];
158 return fetch(url, init);
159 }
160 }
161 return connectdb(config)
162}
163
164/**
165 * Handles VLESS over WebSocket requests by creating a WebSocket pair, accepting the WebSocket connection, and processing the VLESS header.

Callers

nothing calls this directly

Calls 1

fetchFunction · 0.85

Tested by

no test coverage detected