env file is unrelated.schema.sql in the docs does not look like that: https://developers.cloudflare.com/d1/get-started/#configure-your-d1-databaseSQL code did not contain a statement.
PS C:\Users\Pyke\vscode-projects\healthInspection\database> npx wrangler d1 execute healthyinspection-db --local --file=./schema.sql
๐ Mapping SQL input into an array of statements
๐ Executing on local database healthyinspection-db (a3b682b3-f960-44d4-a85d-17871c266637) from .wrangler\state\v3\d1:
X [ERROR] SQL code did not contain a statement.
If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose
๐ชต Logs were written to "C:\Users\Pyke\AppData\Roaming\xdg.config\.wrangler\logs\wrangler-2023-12-10_21-14-19_077.log"--- 2023-12-10T21:18:54.162Z debug
๐ชต Writing logs to "C:\Users\Pyke\AppData\Roaming\xdg.config\.wrangler\logs\wrangler-2023-12-10_21-18-53_940.log"
---
--- 2023-12-10T21:18:54.162Z debug
Failed to load .env file ".env": Error: ENOENT: no such file or directory, open '.env'
at Object.openSync (node:fs:603:3)
at Object.readFileSync (node:fs:471:35)
at tryLoadDotEnv (C:\Users\Pyke\vscode-projects\healthInspection\database\node_modules\wrangler\wrangler-dist\cli.js:122684:72)
at loadDotEnv (C:\Users\Pyke\vscode-projects\healthInspection\database\node_modules\wrangler\wrangler-dist\cli.js:122693:12)
at C:\Users\Pyke\vscode-projects\healthInspection\database\node_modules\wrangler\wrangler-dist\cli.js:145784:20
at C:\Users\Pyke\vscode-projects\healthInspection\database\node_modules\wrangler\wrangler-dist\cli.js:129270:16
at maybeAsyncResult (C:\Users\Pyke\vscode-projects\healthInspection\database\node_modules\wrangler\wrangler-dist\cli.js:127491:44)
at C:\Users\Pyke\vscode-projects\healthInspection\database\node_modules\wrangler\wrangler-dist\cli.js:129269:14
at C:\Users\Pyke\vscode-projects\healthInspection\database\node_modules\wrangler\wrangler-dist\cli.js:127478:22
at Array.reduce (<anonymous>) {
errno: -4058,
syscall: 'open',
code: 'ENOENT',
path: '.env'
}
---
--- 2023-12-10T21:18:54.170Z log
๐ Mapping SQL input into an array of statements
---
--- 2023-12-10T21:18:54.172Z log
๐ Executing on local database healthyinspection-db (a3b682b3-f960-44d4-a85d-17871c266637) from .wrangler\state\v3\d1:
---envschema.sqlDROP TABLE IF EXISTS Accounts;
CREATE TABLE IF NOT EXISTS Accounts (
Id INTEGER PRIMARY KEY NOT NULL,
Email TEXT NOT NULL,
Username TEXT NOT NULL, Password TEXT NOT NULL,
FirstName TEXT, LastName TEXT, 'Language' TEXT NOT NULL DEFAULT 'de',
Age INTEGER, Height INTEGER, 'Weight' INTEGER,
UpdatedAt TEXT DEFAULT CURRENT_TIMESTAMP,
CreatedAt TEXT DEFAULT CURRENT_TIMESTAMP
);
-- INSERT INTO Customers (CustomerID, CompanyName, ContactName)
-- VALUES (1, 'Alfreds Futterkiste', 'Maria Anders'),
-- (4, 'Around the Horn', 'Thomas Hardy'),
-- (11, 'Bs Beverages', 'Victoria Ashworth'),
-- (13, 'Bs Beverages', 'Random Name');