I'm working on implementing a drag-and-drop feature on my website, not the file uploading kind but allowing users to move things around. I plan to use an HTML embed that will cover the entire site so I can have full control. Right now, I'm in the process of creating a backend script to retrieve data from my database. My question is whether I'll be able to integrate this script into my code or if the HTML embed functions independently? Thank you for any advice!
import { sql } from '@velo/wix-data-sql-backend';
export async function fetchData() {
try {
const results = await sql("SELECT * FROM collection;");
return results.payload.data.rows;
} catch (error) {
console.error(error);
}
}