Gets the size of a specific D1 database in bytes.
Uses efficient SQLite pragma queries to determine database size.
Parameters
shardBinding: string
The shard binding name to check the size of
Returns Promise<number>
Promise resolving to the database size in bytes
Throws
If shard not found or size query fails
Example
// Get size of a specific shard constsizeInBytes = awaitgetDatabaseSizeForShard('db-east'); console.log(`Database size: ${Math.round(sizeInBytes/1024/1024)} MB`);
Gets the size of a specific D1 database in bytes. Uses efficient SQLite pragma queries to determine database size.