github withastro/astro @astrojs/db@0.17.0

Minor Changes

  • #14190 438adab Thanks @Adammatthiesen! - Adds support for enum support for text columns in Astro DB tables.

    import { column, defineTable } from 'astro:db';
    
    // Table definition
    const UserTable = defineTable({
      columns: {
        id: column.number({ primaryKey: true }),
        name: column.text(),
        rank: column.text({ enum: ['user', 'mod', 'admin'] }),
      },
    });
    
    // Resulting type definition
    type UserTableInferInsert = {
      id: string;
      name: string;
      rank: 'user' | 'mod' | 'admin';
    };

Don't miss a new astro release

NewReleases is sending notifications on new releases.