π Patch Changes
- #10677
1662aa8a850ff4f860a80c2f33a8b33bcc7aee12Thanks @matthewp! - Fix compatibility of @astrojs/db with Cloudflare
1662aa8a850ff4f860a80c2f33a8b33bcc7aee12 Thanks @matthewp! - Fix compatibility of @astrojs/db with Cloudflaref395ebcc08279515f8d53bb82edeee288d8579db Thanks @bholmesdev! - Rename internal import from runtime/config to runtime/virtualb1eda3dc5c33c1c6d50d5ee8a2a08d34851dc253 Thanks @matthewp! - Pass through appToken on static sites with Astro DB713f99e849b26edb831ea6527b7103ad7a6b200f Thanks @lilnasy! - Fixes an issue astro:db could not be used on serverless platforms.#10599 5a7733dde52d439402404d5207a2b1d897c4e025 Thanks @bholmesdev! - Seed database on dev server startup, and log whenever the seed file is reloaded.
#10636 504d15d77291f0fe36aa9fecc22f276b734f83cb Thanks @bholmesdev! - Detailed error messages for remote database exceptions.
#10635 17badaf55c79cec460c74f4da58bf188eedef7e3 Thanks @matthewp! - Give proper error when seed missing default export
#10631 157392ee44db08de0d3c01222644dae0a904044d Thanks @matthewp! - Make ASTRO_DATABASE_FILE work with file paths
#10589 ed1031ba29af9a8a89ab386d772a228ba1414b4d Thanks @column.text(),! - Update the table indexes configuration to allow generated index names. The indexes object syntax is now deprecated in favor of an array.
You can update your indexes configuration object to an array like so:
import { defineDb, defineTable, column } from 'astro:db';
const Comment = defineTable({ columns: { postId: column.number(),
body: column.text(), }, indexes: { postIdIdx: { on: 'postId' }, authorPostIdIdx: { on: ['author, postId'], unique: true }, }, indexes: [ { on: 'postId' /* 'name' is optional */ }, { on: ['author, postId'], unique: true }, ]})This example will generate indexes with the names Comment_postId_idx and Comment_author_postId_idx, respectively. You can specify a name manually by adding the name attribute to a given object. This name will be global, so ensure index names do not conflict between tables.
#10587 62a1d6df6916e08cb25d51814dfad352bc4cce75 Thanks @matthewp! - Conditionally drop table with βforce-reset
#10460 713abb2998bc179443a476f6274432b2fc7d8434 Thanks @bholmesdev! - Remove legacy Astro DB internals using the βcollectionsβ naming convention instead of βtables.β
#10579 f5df12cfebba1abdef50faa7a5549b545f0b3f8c Thanks @matthewp! - Provide guidance when βremote is missing
When running the build astro build without the --remote, either require a DATABASE_FILE variable be defined, which means you are going expert-mode and having your own database, or error suggesting to use the --remote flag.
#10568 764d67fc3f399d62b6a97a2ee698dca03b9f0557 Thanks @matthewp! - Prevent runtime from importing core code
b5a80405b93a166f6f019209152b860ffe2f73ef Thanks @bholmesdev! - Fix db.run() type signature in production.6576f5d458ee8cc872210f3a7ae629439546e361 Thanks @matthewp! - Ensure ASTRO_STUDIO_APP_TOKEN is found at runtime30ce9a0c47a4653a9e9619380a6514459563cf92 Thanks @matthewp! - Fix accessing remote database URL980020c5e0935a2e0e177164d02f5e49f0a9ab4b Thanks @matthewp! - Ensure βforce-reset drops previous tablesf0fc78c8734b2bcf39078c782998e60b49ecc146 Thanks @bholmesdev! - Expose isDbError() utility to handle database exceptions when querying.ad57a02c330b544770ab853fe0521eb784421016 Thanks @bholmesdev! - Expose Drizzle aggregation helpers including count() from the astro:db module.#10501 48310512601e0c0b2886759e4d81b4091042eb8f Thanks @bholmesdev! - Remove db.transaction() from type definitions until it is supported by our remote database adapter.
#10497 2fc7231df28e5a3425ee47b871ba3766e0856bd8 Thanks @matthewp! - Remove embedded app token from CI
#10405 2ebcf94d0af5ac789c61b4190dea0ad6a402a6ea Thanks @43081j! - Added github-slugger as a direct dependency
124cdd64f20d86f936853f3cf834fde8cd6abcb7 Thanks @FredKSchott! - Remove redundant wait time on token creation#10435 37a485b4d1d4b7e60eee2067ffd86d0eea4f03e8 Thanks @matthewp! - Fetch new app token when previous has expired
#10457 219c49473fe44d8df2b69444b2dce0f5bc971655 Thanks @bholmesdev! - Fix type error in db/seed.ts file before type generation is run.
#10439 0989cd3284281e3e471a92ac116e14e65f59f8a5 Thanks @bholmesdev! - Add success and error logs to astro db execute command
#10438 5b48cc0fc8383b0659a595afd3a6ee28b28779c3 Thanks @bholmesdev! - Generate Astro DB types when running astro sync.
#10445 098623c2616124bcc689e2409564dfda187f6688 Thanks @matthewp! - Prefer getting the app token from the runtime env
#10441 5166e9715a1ea18eb5c737ccf834c2ff446d253c Thanks @bholmesdev! - Remove duplicate astro:db log during type generation
238f047b9d1ebc407f53d61ee61574b380a76ac9 Thanks @lilnasy! - Fixes an issue where astro:db could not be used in serverless environments.#10431 1076864cc4aa4b4dad570bbab9907996642cdd1f Thanks @FredKSchott! - Add wait time for the db token to propagate
#10432 4e24628aacc556515b27d0c04361df1526ae778f Thanks @FredKSchott! - Add all regions to the link command