Skip to main content

durcno@1.0.0-alpha.25

Minor Changes​

  • b71d48b - Thanks to @almahdi404 !

    feat(ddl): add extension and schema existence helper functions

    Introduces PostgreSQL extension DDL support (CREATE EXTENSION and DROP EXTENSION) to the migration DDL API, along with IF NOT EXISTS / IF EXISTS helper functions for schemas and extensions.

    The new helper functions include createExtension, createExtensionIfNotExists, dropExtension, dropExtensionIfExists, createSchemaIfNotExists, and dropSchemaIfExists.

    ddl.createExtensionIfNotExists("vector").withSchema("public");
    // CREATE EXTENSION IF NOT EXISTS "vector" WITH SCHEMA "public";

    ddl.createSchemaIfNotExists("analytics");
    // CREATE SCHEMA IF NOT EXISTS analytics;
  • ac78909 - Thanks to @almahdi404 !

    feat(functions): support literals and arguments

    Updated string and mathematical SQL functions to support literal values (e.g., strings, numbers) and Arg instances, expanding their flexibility beyond only accepting columns and other SQL functions.

    import { abs, Arg, lower } from "durcno";

    // You can now pass literal values directly
    lower("HELLO"); // -> lower('HELLO')
    abs(-42); // -> abs(-42)

    // As well as Arg instances
    abs(Arg.number()); // -> abs($1)
  • d7cd66d - Thanks to @almahdi404 !

    feat(filters): add ilike string filter

    Introduces ilike(col, pattern) for case-insensitive pattern matching in WHERE and CHECK clauses, wrapping PostgreSQL's ILIKE operator.

    Supports both string literal patterns and query parameters via Arg.

    import { ilike } from "durcno";

    await db.from(Users).select().where(ilike(Users.email, "%@example.com"));