is that counting towards my quota or it's just the queries / write?
is that counting towards my quota or it's just the queries / write?
wrangler d1 insights, as well as the Cloudflare dashboard (see the Metrics tab for your D1 database). You can use that data to figure out what D1 will cost you..sql file been added yet? The ability to back up / download the DB locally, ideally from the Dashboard, is what’s keeping me from using this over Turso / sqldnpx wrangler --persist-to ../../../.wrangler d1 execute content --local --file sql/content.articles.sql
wrangler 3.28.1
-------------------Mapping SQL input into an array of statements
Executing on local database content (00000000-0000-0000-0007-000000000000) from ../../../.wrangler/v3/d1:
workerd/jsg/setup.c++:493: error: CODE_MOVED for unknown code block?
workerd/jsg/setup.c++:493: error: CODE_MOVED for unknown code block?
45332.058900462966 which I thought was easier to query. the numeric part is the number of days while the decimal is the time.. if I am querying a BETWEEN statement, the process will be straightforward..not authorized [code: 7500] on executing sql scriptswrangler pages dev —d1 DB=IDnpx wrangler d1 execute myD1DatabaseName --local --file="./src/lib/server/d1/migrations/stocks.sql"myD1DatabaseName is the database_name in wrangler.toml-- Disable foreign key enforcement
PRAGMA foreign_keys = OFF;
-- Create a temporary table to hold the existing data
CREATE TEMPORARY TABLE temp_stocks AS SELECT * FROM stocks;
-- Drop the existing stocks table
DROP TABLE stocks;
-- Create a new stocks table with the additional uniqueStockId column
CREATE TABLE stocks (
id INTEGER PRIMARY KEY,
conversionFactor REAL NOT NULL,
createdBy INTEGER NOT NULL,
createdAt REAL NOT NULL,
updatedBy INTEGER,
updatedAt REAL,
branch INTEGER NOT NULL,
product INTEGER NOT NULL,
stock INTEGER NOT NULL,
uniqueStockId TEXT UNIQUE, -- New column with UNIQUE constraint
FOREIGN KEY (branch) REFERENCES branches (id),
FOREIGN KEY (product) REFERENCES products (id),
FOREIGN KEY (createdBy) REFERENCES users (id),
FOREIGN KEY (updatedBy) REFERENCES users (id)
);
-- Populate the new stocks table with data from the temporary table, computing the uniqueStockId
INSERT INTO stocks (id, conversionFactor, createdBy, createdAt, updatedBy, updatedAt, branch, product, stock, uniqueStockId)
SELECT id, conversionFactor, createdBy, createdAt, updatedBy, updatedAt, branch, product, stock, CAST(branch || '-' || product AS TEXT) AS uniqueStockId
FROM temp_stocks;
PRAGMA foreign_keys = ON; "avgRowsRead": 92284,
"totalRowsRead": 7659605,
"avgRowsWritten": 0,
"totalRowsWritten": 0,
"avgDurationMs": 26.3779313253012,
"totalDurationMs": 2189.3682999999996,
"numberOfTimesRun": 8345332.058900462966INSERT INTO db VALUES (1), (2)const MS_PER_DAY = 24 * 60 * 60 * 1000;
const EPOCH_1900 = new Date('1899-12-30T00:00:00.000Z').getTime();
export function dateToExcelNumberWithTime(date: Date): number {
const gmtOffset = date.getTimezoneOffset();
const adjustment = (0 - gmtOffset) * 60 * 1000;
const finalDate = (date.getTime() - EPOCH_1900 + adjustment) / MS_PER_DAY;
return finalDate;
}