zszszsz
05/06/2023, 4:45 PMGigabyte
05/06/2023, 4:54 PMwrangler d1 create pages-test
and filled it with data by executing: wrangler d1 execute pages-test --file=schema.sql
with the following schema file:
sql
CREATE TABLE IF NOT EXISTS users(
id INTEGER PRIMARY KEY,
username TEXT NOT NULL UNIQUE,
email TEXT NOT NULL UNIQUE,
password TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS posts(
id INTEGER PRIMARY KEY,
user_id INTEGER NOT NULL,
title TEXT NOT NULL,
content TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS comments(
id INTEGER PRIMARY KEY,
post_id INTEGER NOT NULL,
user_id INTEGER NOT NULL,
content TEXT NOT NULL
);
which created the database in the dashboard as I expected.
I discovered that after I linked the database to my Cloudflare Pages project which I built with my favorite Framework SvelteKit I wasn't able to access the database. While I tried to find the reason for this I saw that my ``env`` exposes a __D1_BETA__DB
variable which isn't what I called my binding (it's called DB
) although I tryed using that one but it seems like there is nothing on that Object {"__D1_BETA__DB": {}}
. The bindng DB
is entirely not existent on the ``env`` even when it's shown in the dashboard.Gigabyte
05/06/2023, 4:55 PMSkye
05/06/2023, 4:55 PMGigabyte
05/06/2023, 4:56 PMSkye
05/06/2023, 4:57 PMGigabyte
05/06/2023, 4:57 PMnora
05/06/2023, 5:03 PMSkye
05/06/2023, 5:04 PMGigabyte
05/06/2023, 5:05 PMnora
05/06/2023, 5:06 PMGigabyte
05/06/2023, 5:25 PMUnsmart | Tech debt
05/06/2023, 5:26 PMGigabyte
05/06/2023, 5:27 PMwrangler pages publish --project-name pages-test ./.svelte-kit/cloudflare
Skye
05/06/2023, 5:28 PMGigabyte
05/06/2023, 5:29 PMjs
import adapter from '@sveltejs/adapter-cloudflare';
Skye
05/06/2023, 5:34 PMGigabyte
05/06/2023, 5:35 PMGigabyte
05/06/2023, 5:35 PMGigabyte
05/06/2023, 5:35 PMGigabyte
05/06/2023, 5:36 PMSkye
05/06/2023, 5:36 PMSkye
05/06/2023, 5:36 PMJames
05/06/2023, 5:37 PMGigabyte
05/06/2023, 5:39 PMzszszsz
05/06/2023, 5:42 PMfour33
05/08/2023, 6:47 PMAccept-Encoding: identity
header is being completely clobbered by CloudFlare and gets re-written to gzip, br, deflate
-- has anyone encountered this problem?four33
05/08/2023, 7:19 PMCache-Control: no-transform
nora
05/08/2023, 8:00 PM