Skip to content

Commit

Permalink
feat: using edge runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
invisal committed Mar 19, 2024
1 parent f5e6da2 commit ff347cf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/api/database/[database_id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { encrypt } from "@/lib/encryption";
import { env } from "@/env";
import { SavedConnectionItemConfig } from "@/app/connect/saved-connection-storage";

export const runtime = "edge";

const databaseSchema = zod.object({
name: zod.string().min(3).max(50),
description: zod.string(),
Expand Down
2 changes: 2 additions & 0 deletions src/app/api/databases/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import withUser from "@/lib/with-user";
import { and, desc, eq, isNull } from "drizzle-orm";
import { NextResponse } from "next/server";

export const runtime = "edge";

export const GET = withUser(async ({ user }) => {
const dbs = await db
.select()
Expand Down
2 changes: 2 additions & 0 deletions src/app/api/ops/[database_id]/batch/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import withDatabaseOperation from "@/lib/with-database-ops";
import { createClient } from "@libsql/client/web";
import { NextResponse } from "next/server";

export const runtime = "edge";

export const POST = withDatabaseOperation<{
batch: {
sql: string;
Expand Down
2 changes: 2 additions & 0 deletions src/app/api/ops/[database_id]/query/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import withDatabaseOperation from "@/lib/with-database-ops";
import { createClient } from "@libsql/client/web";
import { NextResponse } from "next/server";

export const runtime = "edge";

export const POST = withDatabaseOperation<{
sql: string;
args: (string | number)[];
Expand Down

0 comments on commit ff347cf

Please sign in to comment.