Skip to main content

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.node is 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: .nvmrc pins v26.13.0, and the GitHub Actions workflows run on 26.13.0.

    @types/node moves to ^26.6.6 to match the supported runtime.

Minor Changes​

  • 2b1297a - Thanks to @almahdi404 !

    feat(cli): make generate usable for non-interactive agents

    durcno generate no longer blocks on rename prompts in non-interactive environments. Interactive terminals still prompt, while runs without a TTY or with CI=true exit with code 1 and print the exact flags needed to resolve ambiguous table/column renames.

    Declare renames explicitly with repeatable --rename-table old=new and --rename-column table.old=new flags; the schema defaults to public. Pass --yes to treat any remaining potential renames as drop + create.

    durcno generate --rename-table public.users=public.members \
    --rename-column public.members.username=handle
    durcno generate --yes

    durcno push accepts the same flags and forwards them to generate.

  • d686b39 - Thanks to @almahdi404 !

    feat(qb): add full-text search support

    Add a tsvector column 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, and numnode.

    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. tsMatch also tracks direct Arg operands so unprepared queries reject bound placeholders while db.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 sql tag 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 accept Sql/SqlFn keys directly. Prepared Arg values are rejected in index expressions.