ntanduy/cloudflare-d1-database
Use Cloudflare D1 as a native Laravel database driver with full Eloquent ORM, Query Builder, and migration support. Choose REST API or Worker connections, batch queries, bulk inserts, read replication, import and schema dump commands, time travel, retries, and circuit breaking. Requires PHP 8.2+ and...
X-D1-Nonce and sign timestamp.nonce.body to make replay detection practical.transaction_mode / CF_D1_TRANSACTION_MODE, including silent, log, and exception modes.D1TransactionException for explicit transaction-usage failures when transaction_mode=exception.--strict support for d1:info, allowing CI workflows to fail when health checks fail.DB::transaction(), manual beginTransaction(), commit(), and rollBack() now consistently respect transaction_mode.transaction_mode=log now logs only once per connection/request to avoid noisy duplicate warnings during a single transaction lifecycle.commit() delegates to Laravel's parent commit lifecycle while keeping D1 commit behavior as a no-op.SELECT / WITH statements.JsonException in supported paths.composer.json.D1ConnectorInterface contract for type-hinting connectors without coupling to Saloon (#2)databaseExec() and databaseRaw() methods on CloudflareWorkerConnector (#12)d1_driver config validation — throws InvalidArgumentException for invalid values (#19)CF_D1_HMAC=true config adds per-request HMAC-SHA256 signatures for replay protection (#30)HMAC_REQUIRED and HMAC_WINDOW_SECONDS env vars for enforcementCHANGELOG.md following Keep a Changelog format (#42)crypto.subtle.timingSafeEqual (#10)$accountId and $apiUrl on CloudflareConnector changed from public to protected — use getAccountId() accessor (#9)D1PdoStatement::execute($params) now merges params with previously bound values (matching real PDO behavior) instead of replacing (#23)Cache facade with $this->app['cache'] in ServiceProvider for safer resolution (#21)CircuitBreaker uses now()->timestamp instead of time() for testabilityitty-router dependency (#15)composer.json keywords — removed unrelated kv, r2, workers terms (#20)printStarReminder() method and star reminder behavior from D1ServiceProvider (#5)tests/database/factories/UserFactory.php (#7)tests/Pest.php (toBeOne expectation, something() function) (#8)$this->artisan() instead of BufferedOutputsleep() with Carbon::setTestNow()npm run start → npm run dev to match Worker package.json scripts (#37)CONTRIBUTING.md link replaced with inline contribution note (#38)FormatsBytes trait for byte formatting utilityd1:time-travel command for point-in-time recoveryD1ImportCommand for importing SQL files into D1D1InfoCommand for displaying database metadata and connection statusdatabaseInfo() and databaseImport() methods on REST connectorbulkInsert() column validation and name escapingbulkInsert() method on D1Connection with D1 100-statement batch chunkingd1:schema-dump command for exporting D1 database schemad1:health command for connection diagnosticsD1Connection::batch()CloudflareWorkerConnector) for low-latency queries via Cloudflare WorkersWorker/ directorysendWithRetry)D1SchemaGrammar with cross-version Laravel compatibility (10/11/12+)MapsSqlState trait for SQLSTATE error code mappingcompileTableExists compatibility with SQLiteGrammarCloudflareD1Connector) using Cloudflare D1 REST API via SaloonD1Pdo, D1PdoStatement) for full Laravel compatibilityMockCloudflareD1ConnectorHow can I help you explore Laravel packages today?