Is it possible to generate a default value concatenating with NEXTVAL?

For example, I want to do this

number: varchar({ length: 15 }).default(`'S' || NEXTVAL('number_sequence')`),


But the generated SQL is incorrect with extra quotes wrapping the default:

ALTER TABLE "sessions" ADD COLUMN "number" varchar(15) DEFAULT ''S' || NEXTVAL('session_number_sequence')';
Was this page helpful?