Any way to query D1 during build process?

I have a sveltekit app that I want pre-rendered, some data of which relies on D1. Is there some way to query it directly or am I stuck with the HTTP API?
Was this page helpful?