durcno@1.0.0-alpha.36
Major Changes
-
74ab7f0 - Thanks to @almahdi404 !
change!: raise minimum Node.js to 26.13.0
Durcno now requires Node.js 26.13.0 or newer.
engines.nodeis raised to>=26.13.0, so package managers that honor the field refuse installs on older runtimes.The same floor is used by the development toolchain and CI:
.nvmrcpinsv26.13.0, and the GitHub Actions workflows run on26.13.0.@types/nodemoves to^26.6.6to match the supported runtime.
Minor Changes
-
2b1297a - Thanks to @almahdi404 !
feat(cli): make generate usable for non-interactive agents
durcno generateno longer blocks on rename prompts in non-interactive environments. Interactive terminals still prompt, while runs without a TTY or withCI=trueexit with code1and print the exact flags needed to resolve ambiguous table/column renames.Declare renames explicitly with repeatable
--rename-table old=newand--rename-column table.old=newflags; the schema defaults topublic. Pass--yesto treat any remaining potential renames as drop + create.durcno generate --rename-table public.users=public.members \--rename-column public.members.username=handledurcno generate --yesdurcno pushaccepts the same flags and forwards them togenerate. -
d686b39 - Thanks to @almahdi404 !
feat(qb): add full-text search support
Add a
tsvectorcolumn type with Zod validation, driver conversion, and migration support. Declare search columns directly and index them with GIN:export const Articles = table("public","articles",{id: pk(),title: varchar({ length: 255, notNull }),body: text({ notNull }),search: tsvector({ notNull }),},{indexes: (t) => [index([t.search]).using("gin")],},);Introduce
tsMatch(vector, query)for the@@predicate and the full-text helper family:toTsvector,toTsquery,plaintoTsquery,phrasetoTsquery,websearchToTsquery,tsHeadline,tsRank,tsRankCd,setweight,strip,querytree, andnumnode.const term = websearchToTsquery("postgres full text");const results = await db.from(Articles).select(() => ({ id: Articles.id, rank: tsRank(Articles.search, term) })).where(() => tsMatch(Articles.search, term)).orderBy(() => desc(tsRank(Articles.search, term)));Vector and query literals are cast to
tsvector/tsquery, and text search configurations accept named configs or prepared parameters.tsMatchalso tracks directArgoperands so unprepared queries reject bound placeholders whiledb.prepare()accepts them. -
c405fc2 - Thanks to @almahdi404 !
feat(schema): add expression indexes
Index keys now accept SQL expressions in addition to columns, enabling GIN full-text search indexes and other expression-based indexes. Prefer scalar function builders, which keep expressions type-checked:
index("posts_content_tsv_idx", [toTsvector(t.content, "english"),]).using("gin"),index("posts_user_lower_title_idx", [t.userId, lower(t.title)]);Use the
sqltag only when no builder exists:index("posts_content_tsv_raw_idx", [sql`to_tsvector('english', ${t.content})`,]).using("gin");Expression indexes require an explicit name. The migration generator emits
sql.raw(...)keys, snapshots round-trip expressions so unchanged schemas produce no diff, and DDL builders acceptSql/SqlFnkeys directly. PreparedArgvalues are rejected in index expressions.