QwikDev / qwik

Instant-loading web apps, without effort
https://qwik.dev
MIT License
20.63k stars 1.29k forks source link

[✨] Add support for cloudflare network #3087

Open polRk opened 1 year ago

polRk commented 1 year ago

Is your feature request related to a problem?

For now, i cannot access cloudflare kv, d1, do, services, any cloudflare infrastructure services. Because my script do not run on cloudflare (start or dev script run vite, but not wrnagler or miniflare)

Describe the solution you'd like

Modify starter template and add support for running via wrangler or miniflare

Describe alternatives you've considered

no

Additional context

No response

leighwilliams commented 1 year ago

One alternative is to use the miniflare node packages for local development. For example.

import { D1Database, D1DatabaseAPI } from "@miniflare/d1";
import { createSQLiteDB } from "@miniflare/shared";

const sqliteDb = await createSQLiteDB("path/to/your.sqlite3"); // Or `createSQLiteDB(":memory:");` for an in-memory database.
const d1 = new D1Database(new D1DatabaseAPI(sqliteDb));

const data = await d1.prepare('select * from table').all();
PatrickJS commented 4 months ago

this should be in the docs

maiieul commented 1 month ago

@PatrickJS isn't the cloudflare adapter working through wrangler etc.? We can close this issue if the current cloudflare adapter answers these use-cases.