Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] release #10362

Merged
merged 4 commits into from
Mar 8, 2024
Merged

[ci] release #10362

merged 4 commits into from
Mar 8, 2024

Conversation

astrobot-houston
Copy link
Contributor

@astrobot-houston astrobot-houston commented Mar 7, 2024

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@astrojs/[email protected]

Minor Changes

  • #10363 b6ccaa6dc76027f4230d6e7dfecc75b5d8b97267 Thanks @delucis! - Changes the seed file format to require exporting a default function instead of running seed code at the top level.

    To migrate a seed file, wrap your existing code in a default function export:

    // db/seed.ts
    import { db, Table } from 'astro:db';
    
    + export default async function() {
      await db.insert(Table).values({ foo: 'bar' });
    + }
  • #10363 b6ccaa6dc76027f4230d6e7dfecc75b5d8b97267 Thanks @delucis! - Introduce astro build --remote to build with a remote database connection. Running astro build plain will use a local database file, and --remote will authenticate with a studio app token.

  • #10363 b6ccaa6dc76027f4230d6e7dfecc75b5d8b97267 Thanks @delucis! - Adds support for integrations providing astro:db configuration and seed files, using the new astro:db:setup hook.

    To get TypeScript support for the astro:db:setup hook, wrap your integration object in the defineDbIntegration() utility:

    import { defineDbIntegration } from '@astrojs/db/utils';
    
    export default function MyDbIntegration() {
      return defineDbIntegration({
        name: 'my-astro-db-powered-integration',
        hooks: {
          'astro:db:setup': ({ extendDb }) => {
            extendDb({
              configEntrypoint: '@astronaut/my-package/config',
              seedEntrypoint: '@astronaut/my-package/seed',
            });
          },
        },
      });
    }

    Use the extendDb method to register additional astro:db config and seed files.

    Integration config and seed files follow the same format as their user-defined equivalents. However, often while working on integrations, you may not be able to benefit from Astro’s generated table types exported from astro:db. For full type safety and autocompletion support, use the asDrizzleTable() utility to wrap your table definitions in the seed file.

    // config.ts
    import { defineTable, column } from 'astro:db';
    
    export const Pets = defineTable({
      columns: {
        name: column.text(),
        age: column.number(),
      },
    });
    // seed.ts
    import { asDrizzleTable } from '@astrojs/db/utils';
    import { db } from 'astro:db';
    import { Pets } from './config';
    
    export default async function () {
      // Convert the Pets table into a format ready for querying.
      const typeSafePets = asDrizzleTable('Pets', Pets);
    
      await db.insert(typeSafePets).values([
        { name: 'Palomita', age: 7 },
        { name: 'Pan', age: 3.5 },
      ]);
    }
  • #10363 b6ccaa6dc76027f4230d6e7dfecc75b5d8b97267 Thanks @delucis! - Add support for batch queries with db.batch(). This includes an internal bump to Drizzle v0.29.

  • #10364 3f27e096283b6b477c4a66d0a7df52feaa3f4233 Thanks @delucis! - Renames the Astro DB defineDB() helper to defineDb()

    ⚠️ Breaking change: update your imports from astro:db to use defineDb with a lowercase “b”.

Patch Changes

[email protected]

4.4.15

Patch Changes

[email protected]

Patch Changes

@github-actions github-actions bot added pkg: example Related to an example package (scope) pkg: astro Related to the core `astro` package (scope) labels Mar 7, 2024
@github-actions github-actions bot force-pushed the changeset-release/main branch from 693d9dc to 1403fe9 Compare March 8, 2024 00:46
@github-actions github-actions bot force-pushed the changeset-release/main branch from 1403fe9 to 6156872 Compare March 8, 2024 01:22
@github-actions github-actions bot added the pkg: create-astro Related to the `create-astro` package (scope) label Mar 8, 2024
@natemoo-re natemoo-re merged commit 82d81a1 into main Mar 8, 2024
14 checks passed
@natemoo-re natemoo-re deleted the changeset-release/main branch March 8, 2024 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) pkg: create-astro Related to the `create-astro` package (scope) pkg: example Related to an example package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants