Skip to content

Commit

Permalink
Merge pull request #255 from UTDNebula/neon-db
Browse files Browse the repository at this point in the history
switch to neon for db provider
  • Loading branch information
nl32 authored Nov 5, 2024
2 parents 1e7f939 + aa29f20 commit 6088f55
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 6 deletions.
117 changes: 115 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"dependencies": {
"@auth/drizzle-adapter": "^0.3.2",
"@hookform/resolvers": "^3.3.2",
"@neondatabase/serverless": "^0.10.2",
"@next/third-parties": "^14.2.15",
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-dialog": "^1.0.5",
Expand Down
8 changes: 4 additions & 4 deletions src/server/db/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import postgres from 'postgres';
import { drizzle } from 'drizzle-orm/postgres-js';

import { drizzle } from 'drizzle-orm/neon-http';
import { env } from '@src/env.mjs';

import * as club from './schema/club';
Expand All @@ -9,6 +7,7 @@ import * as events from './schema/events';
import * as users from './schema/users';
import * as forms from './schema/forms';
import * as admin from './schema/admin';
import { neon } from '@neondatabase/serverless';

const schema = {
...club,
Expand All @@ -19,6 +18,7 @@ const schema = {
...admin,
};

export const db = drizzle(postgres(env.DATABASE_URL, { prepare: false }), {
const neon_client = neon(env.DATABASE_URL);
export const db = drizzle(neon_client, {
schema,
});

0 comments on commit 6088f55

Please sign in to comment.