You can use the query function everywhere you want, as long the function is being called on the server side.
src/routes/api/posts/+server.ts
Copy
import { json } from '@sveltejs/kit';import { query } from '@neokit-dev/relational';export async function GET() { const result = await query('SELECT * FROM posts'); return json(result);}