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 { NextRequest, NextResponse } from 'next/server';
|
||||||
import { db } from '@/lib/db';
|
import { db } from '@/lib/db';
|
||||||
|
import { candles } from '@/lib/db/schema';
|
||||||
|
|
||||||
export async function GET(request: NextRequest) {
|
export async function GET(request: NextRequest) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -14,7 +15,7 @@ export async function GET(request: NextRequest) {
|
||||||
if (checkDb === 'db') {
|
if (checkDb === 'db') {
|
||||||
try {
|
try {
|
||||||
// Test database connectivity with a simple query
|
// Test database connectivity with a simple query
|
||||||
await db.execute('SELECT 1');
|
await db.select().from(candles).limit(1);
|
||||||
response.database = 'ok';
|
response.database = 'ok';
|
||||||
} catch (dbError: any) {
|
} catch (dbError: any) {
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue