Skip to content

Releases: IzumiSy/kyrage

@izumisy/kyrage@1.5.8

11 Feb 07:01
4955756

Choose a tag to compare

Patch Changes

@izumisy/kyrage@1.5.7

22 Jan 02:08
bd664f7

Choose a tag to compare

Patch Changes

@izumisy/kyrage@1.5.6

06 Jan 06:40
5c254fe

Choose a tag to compare

Patch Changes

@izumisy/kyrage@1.5.5

30 Dec 16:05
fce23e2

Choose a tag to compare

Patch Changes

@izumisy/kyrage@1.5.3

20 Oct 01:39
a735381

Choose a tag to compare

Patch Changes

@izumisy/kyrage@1.5.2

20 Oct 01:57
454ade5

Choose a tag to compare

Patch Changes

@izumisy/kyrage@1.5.1

03 Oct 16:37
9e9934e

Choose a tag to compare

Patch Changes

@izumisy/kyrage@1.5.0

26 Sep 09:08
0de30cc

Choose a tag to compare

Minor Changes

  • #131 23e21eb Thanks @IzumiSy! - Add foreign key constraint merging to table creation operations with inline control option

    Kyrage now automatically merges foreign key constraints into CREATE TABLE statements alongside existing primary key and unique constraints. This reduces SQL operations and improves migration performance. Added inline option to schema builder's reference() method for fine-grained control over constraint merging.

    Example schema with inline foreign key:

    import { column as c, defineTable as t } from "@izumisy/kyrage";
    
    const users = t("users", {
      id: c("uuid", { primaryKey: true }),
    });
    
    const posts = t(
      "posts",
      {
        id: c("uuid", { primaryKey: true }),
        userId: c("uuid"),
      },
      (t) => [
        // Merged into CREATE TABLE (default: inline: true)
        t.reference("userId", users, "id"),
      ]
    );

    Example with separate constraint:

    const posts = t(
      "posts",
      {
        id: c("uuid", { primaryKey: true }),
        userId: c("uuid"),
      },
      (t) => [
        // Separate ALTER TABLE statement
        t.reference("userId", users, "id", { inline: false }),
      ]
    );

Patch Changes

  • #131 23e21eb Thanks @IzumiSy! - Table operations are now sorted to always respect foreign key and other dependency relationships. Independent tables are ordered alphabetically, ensuring stable and predictable output for migrations and SQL generation.

    Example:

    import { column as c, defineTable as t } from "@izumisy/kyrage";
    
    const users = t("users", {
      id: c("uuid", { primaryKey: true }),
      name: c("varchar"),
    });
    
    const posts = t(
      "posts",
      {
        id: c("uuid", { primaryKey: true }),
        userId: c("uuid"),
        content: c("text"),
      },
      (t) => [
        t.reference("userId", users, "id"), // posts depends on users
      ]
    );
    
    const categories = t("categories", {
      id: c("uuid", { primaryKey: true }),
      label: c("varchar"),
    });

    The generated SQL will always be:

    CREATE TABLE categories (
      id uuid PRIMARY KEY,
      label varchar
    );
    
    CREATE TABLE users (
      id uuid PRIMARY KEY,
      name varchar
    );
    
    CREATE TABLE posts (
      id uuid PRIMARY KEY,
      userId uuid,
      content text,
      CONSTRAINT posts_userId_fkey FOREIGN KEY (userId) REFERENCES users(id)
    );

@izumisy/kyrage@1.4.0

25 Sep 14:52
ff81f91

Choose a tag to compare

Minor Changes

  • #128 81034d5 Thanks @IzumiSy! - Optimize table creation by merging constraints into CREATE TABLE statements

    Kyrage now automatically combines table creation with primary key and unique constraints into a single CREATE TABLE statement, reducing the number of SQL operations and improving migration performance.

    Before:

    CREATE TABLE "users" ("id" integer, "email" varchar);
    ALTER TABLE "users" ADD CONSTRAINT "users_pkey" PRIMARY KEY ("id");
    ALTER TABLE "users" ADD CONSTRAINT "users_email_unique" UNIQUE ("email");

    After:

    CREATE TABLE "users" (
      "id" integer,
      "email" varchar,
      CONSTRAINT "users_pkey" PRIMARY KEY ("id"),
      CONSTRAINT "users_email_unique" UNIQUE ("email")
    );

    This optimization happens automatically when generating migrations - no changes to your schema definitions are required.

@izumisy/kyrage@1.3.1

17 Sep 13:10
6fd86e3

Choose a tag to compare

Patch Changes

  • #119 55b769a Thanks @IzumiSy! - Fix CockroachDB dialect to filter out system-generated rowid column during introspection

    CockroachDB automatically generates a rowid column for tables without an explicit primary key. This system-generated column was being included in introspection results, causing unwanted diffs between the actual database schema and user-defined configuration. The CockroachDB dialect now filters out the rowid column to match user expectations and prevent false positives in schema comparisons.

  • #121 5fcfb5b Thanks @IzumiSy! - Fix container detection for dev database commands by properly matching multiple Docker labels. This resolves the issue where users would see "No running dev containers found" even when containers were actually running.

    The kyrage dev status, kyrage dev clean, and kyrage dev get-url commands were unable to detect running containers due to incomplete label matching in the container detection logic.

  • #116 75fca73 Thanks @IzumiSy! - Fix migration provider to use the acquired DB connection by Kysely migrator

    Resolves issue where migration provider was not using the acquired DB connection passed to the Migration interface's up method, which is required for databases with connection limits like SQLite.