Skip to content

Releases: anchan828/nest-kysely

v0.7.0

07 Sep 02:15
Compare
Choose a tag to compare

Breaking changes

Migration functionality has been separated to @anchan828/kysely-migration. Import paths for all migrations have changed.

import { KyselyMigrationClassProvider } from "@anchan828/nest-kysely";

import { KyselyMigrationClassProvider } from "@anchan828/kysely-migration";

What's Changed

  • chore(deps): update all dependencies by @renovate in #337
  • chore(deps): update dependency typescript-eslint to v8.4.0 by @renovate in #338
  • chore(deps): update dependency @types/node to v20.16.4 by @renovate in #339
  • chore(deps): update dependency @types/node to v20.16.5 by @renovate in #340
  • chore(deps): update eslint to v9.10.0 by @renovate in #341
  • feat: add migration packages by @anchan828 in #342

Full Changelog: v0.6.5...v0.7.0

v0.5.0

11 May 17:34
Compare
Choose a tag to compare

Repeatable Migrations

This is a feature to support migrations that need to be regenerated multiple times, such as views/functions/triggers/etc. Unlike migrations that are executed only once, it compares the checksum of the SQL to be executed to determine the need for migration.

KyselyModule.register({
  dialect: createDialect(),
  repeatableMigrations: {
    migrationsRun: true,
    migratorProps: {
      provider: new KyselyRepeatableMigrationSqlFileProvider({
        sqlFiles: [resolve(__dirname, "user-view.sql")],
        sqlTexts: [{ name: "test", sql: "SELECT 1;" }],
      }),
    },
  },
});
name hash timestamp
user-view 6c7e36422f79696602e19079534b4076 2024-05-11T17:04:20.211Z
test e7d6c7d4d9b1b0b4c7f5d7b3d5e9d4d4 2024-05-11T17:04:20.211Z

Note

  • Once the file is renamed, the migration is executed even if the contents have not changed.
  • Views/Functions/Triggers created by Repeatable Migration are not automatically deleted (or update/rename) by simply deleting the corresponding SQL, so please delete them using the normal migration function.

v0.4.0

06 May 15:12
Compare
Choose a tag to compare
  • Add KyselyMigrationFileProvider
  • Add KyselyMigrationMergeProvider
  • Improve CLI

v0.3.0

05 May 01:28
Compare
Choose a tag to compare
  • Rename from KyselyMigrationProvider to KyselyMigrationClassProvider

v0.2.0

10 Apr 09:09
Compare
Choose a tag to compare

Breaking Changes

There was a bug that KyselyMigrationProvider could not generate more than 10 migration files. This version fixes the problem, but the name does not match the name registered in the migration table. Therefore, if you have already run the migration, please fix it as follows.

const provider = new KyselyMigrationProvider(migrationClasses, {
  prefixFn: (index) => {
    if (index <= 9) {
      return index.toString();
    }
    return `9${index}`.padEnd(8, "0");
  },
});