It would just be ```ts interface Platform { env: { db: D1Database; }; } ```, not with enviro
It would just be , not with environments
interface Platform {
env: {
db: D1Database;
};
}Unlike Workers Environments, production and preview are the only two options available via [env.<ENVIRONMENT>] on Pages
/api/create/[user] routeconst result = await db.select().from(schema.users); also doesn't query, same errorenv: {},... so it's not loading anythingsvelte.config.js file i had to set platformProxy.environment to 'production' inside the adapter's config




ATTACH DATABASE command to aggregate from multiple D1.
Indexes will add an additional written row when writes include the indexed column, as there are two rows written: one to the table itself, and one to the index. The performance benefit of an index and reduction in rows read will, in nearly all cases, offset this additional write.

export const GET: RequestHandler = async ({ params, platform }) => {
if (platform === undefined) return new Response('err');
if (params.user === undefined) return new Response('err');
const db = await drizzle(platform?.env.db, { schema });
const result = await db.insert(schema.users).values({ name: params.user });
return new Response(JSON.stringify(result));
};