fix: use proper Drizzle query syntax in health endpoint instead of execute()
This commit is contained in:
parent
1f87950caf
commit
957663e29a
1 changed files with 2 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { db } from '@/lib/db';
|
||||
import { candles } from '@/lib/db/schema';
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
try {
|
||||
|
|
@ -14,7 +15,7 @@ export async function GET(request: NextRequest) {
|
|||
if (checkDb === 'db') {
|
||||
try {
|
||||
// Test database connectivity with a simple query
|
||||
await db.execute('SELECT 1');
|
||||
await db.select().from(candles).limit(1);
|
||||
response.database = 'ok';
|
||||
} catch (dbError: any) {
|
||||
return NextResponse.json(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue