PRAGMA defer_foreign_keys = true 
.raw(), .all() and .run() query statement methods (https://developers.cloudflare.com/d1/build-databases/query-databases/#query-statement-methods) have been updated to reflect their intended behaviour and improving compatibility with ORMs..raw() now correctly returns results an array of arrays, allowing the correct handling of duplicate column names (such as when joining tables), as compared to .all(), which is unchanged and returns an array of objects. To include an array of column names in the results when using .raw(), use .raw({columnNames: true})..run() no longer incorrectly returns a D1Result and instead returns a D1ExecResult (https://developers.cloudflare.com/d1/build-databases/query-databases/#return-object) as originally intended and documented..raw() to return an array of objects.


.run() and expecting it to return results, you should be using .all(): d1-databaseall(), raw() and first() 

.all().all().all().run().run().run().raw({columnNames: true})D1ExecResultall()raw()first()