import type { Handle } from '@sveltejs/kit'
import { getConnection } from '$lib/server/database/get_connection'

export const handle: Handle = async ({ event, resolve }) => {
  const pg = getConnection();
  event.locals.db = pg;

  const result = await resolve(event);
  return result;
}