kysely-org / kysely

A type-safe typescript SQL query builder
https://kysely.dev
MIT License
10.46k stars 268 forks source link

Add an AlterTypeBuilder #981

Open trescenzi opened 5 months ago

trescenzi commented 5 months ago

There doesn't seem to be a way to alter a type after creating it without using raw sql. The following worked fine in a migration for me but it would be nice if there was a way to do it without raw sql. Happy enough if the answer is that it's more work to support than it's worth as the sql is simple enough but wanted to file an issue since I couldn't find anything related to this.

export async function up(db: Kysely<any>): Promise<void> {
  await sql`alter type status add value 'down'`.execute(db)
}

Thanks! Really loving Kysely.