Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

typeorm-extension

tada5hi521.6kMIT3.7.1TypeScript support: included

A library to create/drop database, simple seeding data sets, ...

database, create, drop, api, json-api, jsonapi, migration, seeder, seeding, cli

readme

Typeorm Extension 🚀

npm version codecov Master Workflow Known Vulnerabilities Conventional Commits

This is a library to

  • create, drop & seed the (default-) database 🔥
  • manage one or many data-source instances 👻
  • parse & apply query parameters (extended JSON:API specification & fully typed) to:
    • filter (related) resources according to one or more criteria,
    • reduce (related) resource fields,
    • include related resources,
    • sort resources according to one or more criteria,
    • limit the number of resources returned in a response by page limit & offset

Warning This readme includes the documentation for the upcoming version 3. This is the link for the v2.

Table of Contents

Installation

npm install typeorm-extension --save

Documentation

To read the docs, visit https://typeorm-extension.tada5hi.net

Usage

CLI

If you use esm, the executable must be changed from typeorm-extension to typeorm-extension-esm. The following commands are available in the terminal:

  • typeorm-extension db:create to create the database
  • typeorm-extension db:drop to drop the database
  • typeorm-extension seed:run seed the database
  • typeorm-extension seed:create to create a new seeder

If the application has not yet been built or is to be tested with ts-node, the commands can be adapted as follows:

"scripts": {
    "db:create": "ts-node ./node_modules/typeorm-extension/bin/cli.cjs db:create",
    "db:drop": "ts-node ./node_modules/typeorm-extension/bin/cli.cjs db:drop",
    "seed:run": "ts-node ./node_modules/typeorm-extension/bin/cli.cjs seed:run",
    "seed:create": "ts-node ./node_modules/typeorm-extension/bin/cli.cjs seed:create"
}

To test the application in the context of an esm project, the following adjustments must be made:

  • executable ts-node to ts-node-esm
  • library path cli.cjs to cli.mjs

Read the Seeding Configuration section to find out how to specify the path, for the seeder- & factory-location.

CLI Options

Option Commands Default Description
--root or -r db:create, db:drop, seed:create & seed:run process.cwd() Root directory of the project.
--dataSource or -d db:create, db:drop & seed:run data-source Name (or relative path incl. name) of the data-source file.
--synchronize or -s db:create yes Synchronize the database schema after database creation. Options: yes or no.
--initialDatabase db:create undefined Specify the initial database to connect to. This option is only relevant for the postgres driver, which must always connect to a database. If no database is provided, the database name will be equal to the connection user name.
--name seed:create & seed:run undefined Name (or relative path incl. name) of the seeder.
--preserveFilePaths db:create, db:drop, seed:create & seed:run false This option indicates if file paths should be preserved and treated as if the just-in-time compilation environment is detected.

CLI Examples

Database Create

ts-node ./node_modules/typeorm-extension/bin/cli.cjs db:create  -d src/data-source.ts

Database Drop

ts-node ./node_modules/typeorm-extension/bin/cli.cjs db:drop  -d src/data-source.ts

Seed Run

ts-node ./node_modules/typeorm-extension/bin/cli.cjs seed:run  -d src/data-source.ts

Seed Run Explicit

ts-node ./node_modules/typeorm-extension/bin/cli.cjs seed:run  -d src/data-source.ts --name src/database/seeds/user.ts

Seed Create

ts-node ./node_modules/typeorm-extension/bin/cli.cjs seed:create  --name src/database/seeds/user.ts

Database

An alternative to the CLI variant, is to create the database in the code base during the runtime of the application. Therefore, provide the DataSourceOptions for the DataSource manually, or let it be created automatically:

Create

Example #1

import { DataSource, DataSourceOptions } from 'typeorm';
import { createDatabase } from 'typeorm-extension';

(async () => {
    const options: DataSourceOptions = {
        type: 'better-sqlite',
        database: 'db.sqlite'
    };

    // Create the database with specification of the DataSource options
    await createDatabase({
        options
    });

    const dataSource = new DataSource(options);
    await dataSource.initialize();
    // do something with the DataSource
})();

Example #2

import {
    buildDataSourceOptions,
    createDatabase
} from 'typeorm-extension';

(async () => {
    const options = await buildDataSourceOptions();

    // modify options

    // Create the database with specification of the DataSource options
    await createDatabase({
        options
    });

    const dataSource = new DataSource(options);
    await dataSource.initialize();
    // do something with the DataSource
})();

Example #3

It is also possible to let the library automatically search for the data-source under the hood. Therefore, it will search by default for a data-source.{ts,js} file in the following directories:

  • {src,dist}/db/
  • {src,dist}/database
  • {src,dist}
import { createDatabase } from 'typeorm-extension';

(async () => {
    // Create the database without specifying it manually
    await createDatabase();
})();

To get a better overview and understanding of the createDatabase function, check out the documentation.

Drop

Example #1

import {
    DataSource,
    DataSourceOptions
} from 'typeorm';
import { dropDatabase } from 'typeorm-extension';

(async () => {
    const options: DataSourceOptions = {
        type: 'better-sqlite',
        database: 'db.sqlite'
    };

    // Drop the database with specification of the DataSource options
    await dropDatabase({
        options
    });
})();

Example #2

import {
    buildDataSourceOptions,
    dropDatabase
} from 'typeorm-extension';

(async () => {
    const options = await buildDataSourceOptions();

    // modify options

    // Drop the database with specification of the DataSource options
    await dropDatabase({
        options
    });
})();

Example #3

It is also possible to let the library automatically search for the data-source under the hood. Therefore, it will search by default for a data-source.{ts,js} file in the following directories:

  • {src,dist}/db/
  • {src,dist}/database
  • {src,dist}
import { dropDatabase } from 'typeorm-extension';

(async () => {
    // Drop the database without specifying it manually
    await dropDatabase();
})();

To get a better overview and understanding of the dropDatabase function, check out the documentation.

Instances

Single

The default DataSource instance can be acquired, by not providing any alias at all or using the key default. If no DataSource instance or DataSourceOptions object is deposited initially the method will attempt to locate and load the DataSource file and initialize itself from there.

import { useDataSource } from 'typeorm-extension';

(async () => {
    const dataSource : DataSource = await useDataSource();
})();

Reference(s):

Multiple

It is also possible to manage multiple DataSource instances. Therefore, each additional DataSource must be registered under a different alias. This can be done by either setting the DataSource instance or the DataSourceOptions object for the given alias.

import { DataSource, DataSourceOptions } from 'typeorm';
import { setDataSource, useDataSource } from 'typeorm-extension';

(async () => {
    const secondDataSourceOptions : DataSourceOptions = {
        // ...
    };

    const dataSource = new DataSource(secondDataSourceOptions);
    setDataSource(dataSource, 'second');

    const instance : DataSource = await useDataSource('second');
})();

Reference(s):

Seeding

Seeding the database is fairly easy and can be achieved by following the steps below:

  • Configuration: Specify the seed and factory location by path or object.
  • Entity: Define one or more entities.
  • Factory (optional): Define a factory for each entity for which data should be automatically generated.
  • Seed: Define one or more seed classes to populate the database with an initial data set or generated data by a factory.
  • Execute: Run the seeder(s) with the CLI or in the code base.

Configuration

Seeder paths are configured as glob patterns, making it easy to match all the factory/seeder files in your project without configuration effort:

  • use * to match anything expect slashes and hidden files
  • use ** to match zero or more directories
  • use comma separate values between {} to match against a list of options

Check out the glob documentation for other supported pattern features. It is important to use the posix/unix path separator (/) because the Windows path separator (\) is used to match paths with literal global pattern characters.

The seeder- & factory-location, can be specified via:

  • environment variable(s)
  • extended data-source.ts file
  • runSeeder(s) method options parameter, in case of a direct code base usage

The following values are assumed by default:

  • factory path: src/database/factories/**/*{.ts,.js}
  • seed path: src/database/seeds/**/*{.ts,.js}

Note: When seeder paths are configured as glob patterns, the paths are resolved and sorted in alphabetical order using filenames. This helps to ensure that the seeders are executed in the correct order.

It is possible to define that a seeder is only executed once. This can either be set globally using the seedTacking option or locally using the track property of a seeder class.

data-source.ts

import { DataSource, DataSourceOptions } from 'typeorm';
import { SeederOptions } from 'typeorm-extension';

const options: DataSourceOptions & SeederOptions = {
    type: 'better-sqlite',
    database: 'db.sqlite',

    seeds: ['src/database/seeds/**/*{.ts,.js}'],
    seedTracking: false,
    factories: ['src/database/factories/**/*{.ts,.js}'],
};

export const dataSource = new DataSource(options);

runSeeder(s)

import { DataSource, DataSourceOptions } from 'typeorm';
import { runSeeders, SeederOptions } from 'typeorm-extension';

(async () => {
    const options: DataSourceOptions = {
        type: 'better-sqlite',
        database: 'db.sqlite',
    };

    const dataSource = new DataSource(options);
    await dataSource.initialize();

    runSeeders(dataSource, {
        seeds: ['src/database/seeds/**/*{.ts,.js}'],
        factories: ['src/database/factories/**/*{.ts,.js}']
    });
})();

Entity

To get started, define one or more entities.

user.ts

import {
    Entity,
    PrimaryGeneratedColumn,
    Column
} from 'typeorm';

@Entity()
export class User {
    @PrimaryGeneratedColumn()
    id: number

    @Column()
    firstName: string

    @Column()
    lastName: string

    @Column()
    email: string
}

Factory

To create entities with random data, create a factory for each desired entity. The definition of a factory is optional.

The factory callback provides an instance of the faker library as function argument, to populate the entity with random data.

user.factory.ts

import { setSeederFactory } from 'typeorm-extension';
import { User } from './user';

export default setSeederFactory(User, (faker) => {
    const user = new User();
    user.firstName = faker.name.firstName('male');
    user.lastName = faker.name.lastName('male');
    user.email = faker.internet.email(user.firstName, user.lastName);

    return user;
})

Seed

And last but not least, create a seeder. The seeder can be called by the cli command seed or in the codebase by using the function runSeeder. A seeder class only requires one method, called run and provides the arguments dataSource & factoryManager.

user.seeder.ts

A seeder class must implement the Seeder interface, and could look like this:

import { Seeder, SeederFactoryManager } from 'typeorm-extension';
import { DataSource } from 'typeorm';
import { User } from './user';

export default class UserSeeder implements Seeder {
    /**
     * Track seeder execution.
     *
     * Default: false
     */
    track = false;

    public async run(
        dataSource: DataSource,
        factoryManager: SeederFactoryManager
    ): Promise<any> {
        const repository =  dataSource.getRepository(User);
        await repository.insert([
            {
                firstName: 'Caleb',
                lastName: 'Barrows',
                email: 'caleb.barrows@gmail.com'
            }
        ]);

        // ---------------------------------------------------

        const userFactory = await factoryManager.get(User);
        // save 1 factory generated entity, to the database
        await userFactory.save();

        // save 5 factory generated entities, to the database
        await userFactory.saveMany(5);
    }
}

Execute

Populate the database from the code base:

import { DataSource, DataSourceOptions } from 'typeorm';
import { runSeeders, SeederOptions } from 'typeorm-extension';
import { User } from 'user';

(async () => {
    const options: DataSourceOptions & SeederOptions = {
        type: 'better-sqlite',
        database: 'db.sqlite',
        entities: [User],

        seeds: ['./*.seeder.ts'],
        factories: ['./*.factory.ts']
    };

    const dataSource = new DataSource(options);
    await dataSource.initialize();

    await runSeeders(dataSource);
})();

Populate the database by explicit definitions from the codebase.

import { DataSource, DataSourceOptions } from 'typeorm';
import { runSeeders, SeederOptions } from 'typeorm-extension';
import { User } from 'user';
import UserSeeder from 'user.seeder';
import UserFactory from 'user.factory';

(async () => {
    const options: DataSourceOptions & SeederOptions = {
        type: 'better-sqlite',
        database: 'db.sqlite',
        entities: [User],

        seeds: [UserSeeder],
        factories: [UserFactory]
    };

    const dataSource = new DataSource(options);
    await dataSource.initialize();

    await runSeeders(dataSource);
})();

Query

The query submodule enables query parameter (fields, filter, ...) values to be build, parsed & validated. Therefore, the rapiq library is used under the hood.

The query parameter options (allowed, default, ...) are fully typed 🔥 and depend on the (nested-) properties of the target entity passed to the typeorm query builder.

For explanation proposes, two simple entities with a relation between them are declared to demonstrate the usage of the query utils:

import {
    Entity,
    PrimaryGeneratedColumn,
    Column,
    OneToOne,
    JoinColumn
} from 'typeorm';

@Entity()
export class User {
    @PrimaryGeneratedColumn({unsigned: true})
    id: number;

    @Column({type: 'varchar', length: 30})
    @Index({unique: true})
    name: string;

    @Column({type: 'varchar', length: 255, default: null, nullable: true})
    email: string;

    @OneToOne(() => Profile)
    profile: Profile;
}

@Entity()
export class Profile {
    @PrimaryGeneratedColumn({unsigned: true})
    id: number;

    @Column({type: 'varchar', length: 255, default: null, nullable: true})
    avatar: string;

    @Column({type: 'varchar', length: 255, default: null, nullable: true})
    cover: string;

    @OneToOne(() => User)
    @JoinColumn()
    user: User;
}

In this example routup and the plugin @routup/query is used to handle HTTP requests, but there is also a guide available for express.

import { createServer } from 'node:http';
import type { Request, Response } from 'routup';
import { createNodeDispatcher, Router } from 'routup';
import { createHandler, useQuery } from '@routup/query';

import {
    applyQuery,
    useDataSource
} from 'typeorm-extension';

const router = new Router();
router.use(createHandler());

/**
 * Get many users.
 *
 * Request example
 * - url: /users?page[limit]=10&page[offset]=0&include=profile&filter[id]=1&fields[user]=id,name
 *
 * Return Example:
 * {
 *     data: [
 *         {id: 1, name: 'tada5hi', profile: {avatar: 'avatar.jpg', cover: 'cover.jpg'}}
 *      ],
 *     meta: {
 *        total: 1,
 *        limit: 20,
 *        offset: 0
 *    }
 * }
 * @param req
 * @param res
 */
router.get('users', async (req: Request, res: Response) => {
    const dataSource = await useDataSource();
    const repository = dataSource.getRepository(User);
    const query = repository.createQueryBuilder('user');

    // -----------------------------------------------------

    const { pagination } = applyQuery(query, useQuery(req), {
        defaultAlias: 'user',
        fields: {
            // porfile fields can only be included,
            // if the relation 'profile' is included.
            allowed: ['id', 'name', 'profile.id', 'profile.avatar'],
        },
        filters: {
            // porfile.id can only be used as a filter,
            // if the relation 'profile' is included.
            allowed: ['id', 'name', 'profile.id'],
        },
        pagination: {
            // only allow to select 20 items at maximum.
            maxLimit: 20
        },
        relations: {
            allowed: ['profile']
        },
        sort: {
            // profile.id can only be used as sorting key,
            // if the relation 'profile' is included.
            allowed: ['id', 'name', 'profile.id']
        },
    });

    // -----------------------------------------------------

    const [entities, total] = await query.getManyAndCount();

    return {
        data: entities,
        meta: {
            total,
            ...pagination
        }
    };
});

const server = createServer(createNodeDispatcher(router));
server.listen(80);

Contributing

Before starting to work on a pull request, it is important to review the guidelines for contributing and the code of conduct. These guidelines will help to ensure that contributions are made effectively and are accepted.

License

Made with 💚

Published under MIT License.

changelog

3.7.1 (2025-04-15)

Bug Fixes

  • isUnique check - use indicies if ownUniques columns are not populated (7f4aed4)

3.7.0 (2025-02-27)

Bug Fixes

  • deps: bump the minorandpatch group across 1 directory with 12 updates (#1284) (f32f812)

Features

  • add create database template support for postgres (#1244) (d4d66d3), closes #1226
  • postgres: allow schema creation for postgres (#1247) (986ff58)

3.6.3 (2024-11-06)

Bug Fixes

  • deps: bump locter from 2.1.3 to 2.1.5 (#1191) (ee4d5d0)
  • enhance skipRelation check in validate entity join columns fn (3120433)
  • validate entity join columns - respect nullable join columns (ab87659)

3.6.2 (2024-10-08)

Bug Fixes

  • consider runSchema- & synchronize-option in checkDatabase fn (b90a127)
  • deps: bump locter from 2.1.0 to 2.1.3 (#1155) (48752e7)

3.6.1 (2024-08-11)

Bug Fixes

  • adjust data source cleanup behaviour to jsdoc description (e27f42e)
  • schema detection in check-database fn (39dcc92)

3.6.0 (2024-07-27)

Features

  • add experimental entity-{uniqueness,property-names,join-columns} helpers (#1062) (9ab61cc)

3.5.1 (2024-04-09)

Bug Fixes

  • deps: bump locter from 2.0.2 to 2.1.0 (#957) (34d491f)
  • deps: bump reflect-metadata from 0.2.1 to 0.2.2 (#958) (7e8e885)
  • deps: bump smob from 1.4.1 to 1.5.0 (#961) (d14f79a)
  • remove extension in typeorm-extension import in seeder template file (#954) (4ccb4b6)

Performance Improvements

  • opimized seeder-factory save-many fn (#955) (a4dfce5)

3.5.0 (2024-02-12)

Bug Fixes

  • deps: bump @faker-js/faker from 8.3.1 to 8.4.0 (#859) (7d505d4)
  • deps: bump @faker-js/faker from 8.4.0 to 8.4.1 (#885) (e9585f6)
  • optimized useEnv singleton fn (a7f08d1)

Features

  • use envix for environment management (883b9d4)

3.4.1-beta.1 (2024-02-07)

Bug Fixes

  • deps: bump @faker-js/faker from 8.3.1 to 8.4.0 (#859) (7d505d4)
  • don't export bin path (3f9708d)

3.4.0 (2024-01-18)

Bug Fixes

  • deps: bump locter to v2.0.2 (4108ee3)
  • remove duplicate runtime environment checks (25db92a)

Features

  • add bin directory as export (#849) (d0e83e6)
  • prioritize seeder track property over global option (b21bb6f)
  • simplify data-source options detection (328b4f0)

3.4.0-beta.2 (2024-01-18)

Bug Fixes

  • remove duplicate runtime environment checks (25db92a)

Features

  • add bin directory as export (#849) (d0e83e6)
  • prioritize seeder track property over global option (b21bb6f)

3.4.0-beta.1 (2024-01-18)

Features

  • simplify data-source options detection (328b4f0)

3.3.0 (2024-01-11)

Bug Fixes

Features

3.2.0 (2023-11-25)

Bug Fixes

  • deps: bump @faker-js/faker from 8.2.0 to 8.3.1 (#782) (fa7a114)
  • deps: bump locter from 1.2.2 to 1.2.3 (#779) (e89daea)

Features

3.1.1 (2023-10-24)

Bug Fixes

  • multiple shebangs in cli entrypoint (c227c66)

3.1.0 (2023-10-21)

Bug Fixes

  • deps: bump @faker-js/faker from 8.0.2 to 8.2.0 (#734) (f3e5054)
  • deps: bump smob from 1.4.0 to 1.4.1 (#732) (fb71fae)

Features

  • async data-source exports (a2cdb9d)

3.0.2 (2023-09-15)

Bug Fixes

  • deps: bump locter from 1.2.1 to 1.2.2 (#687) (3c26fdd)

3.0.1 (2023-07-27)

Bug Fixes

  • export seeder entity (4f728fd)
  • seeder: ensure SeederExecutor properly sort seed file on fileName (#642) (a9c4f92)

3.0.0 (2023-07-25)

Bug Fixes

  • adjust build action to cache bin and dist dir (9afa905)
  • adjust runSeeder(s) method to use seeder executor (3f55d49)
  • align cli options with README (4f3432c)
  • circular dependencies (23b8d6c)
  • circular dependencies between seder and data-source-options (c5d1d09)
  • cleanup file path adjustment (01332c5)
  • deps: bump locter from 1.1.2 to 1.1.3 (#633) (90ce900)
  • deps: bump locter from 1.2.0 to 1.2.1 (#637) (47ffdac)
  • deps: bump rapiq from 0.8.1 to 0.9.0 (#618) (e2d9d1b)
  • include bin directory in package-json file list (327ce47)
  • keepà bin directory + updated .gitignore (58aebad)
  • logging of seed file name on creation (8bb0ec5)
  • minor cleanup (8773e02)
  • only track one time seeder (8edf6cf)
  • preserve bin/cli.{mjs,cjs} for publishing (7b175e9)
  • rename seeder property oneTimeOnly to track + global seedTracking option (b8c4b35)
  • resolve seeder/factory file patterns & paths relative to root directory (622aec9)
  • seeds without timestamp should be considered older (f511978)
  • yargs import for esm cli entry-point (3d46dff)

Features

  • allow setting (faker) locale for seeder factories (5387d44)
  • explicit seed execution, comparison by file-name/path (61de8dd)
  • generate cli entry point for cjs/esm (0cc73b6)
  • implemented seed:craete cli command + adjusted seed run command (7cc56bc)
  • only create seeder table if trackable seed found or global flag is set (379c296)
  • option to execute seeds only once (5f6d98f)
  • refactor and optimized file path modification (5bdfd0a)
  • refactored cli options + enhanced commands (637250b)
  • remove legacy data-source options building (6cb4d77)
  • use rollup and swc to create bundles for cjs & esm (46016e8)

BREAKING CHANGES

  • public api changed
  • ormconfig no longer supported
  • CLI path changed

3.0.0-alpha.9 (2023-07-22)

Bug Fixes

  • logging of seed file name on creation (8bb0ec5)
  • resolve seeder/factory file patterns & paths relative to root directory (622aec9)

Features

  • explicit seed execution, comparison by file-name/path (61de8dd)
  • refactor and optimized file path modification (5bdfd0a)

BREAKING CHANGES

  • public api changed

3.0.0-alpha.8 (2023-07-21)

Bug Fixes

  • align cli options with README (4f3432c)
  • deps: bump locter from 1.1.2 to 1.1.3 (#633) (90ce900)
  • rename seeder property oneTimeOnly to track + global seedTracking option (b8c4b35)

Features

  • implemented seed:craete cli command + adjusted seed run command (7cc56bc)
  • refactored cli options + enhanced commands (637250b)

3.0.0-alpha.7 (2023-07-20)

Bug Fixes

  • circular dependencies (23b8d6c)
  • cleanup file path adjustment (01332c5)

3.0.0-alpha.6 (2023-07-16)

Bug Fixes

  • adjust runSeeder(s) method to use seeder executor (3f55d49)
  • deps: bump rapiq from 0.8.1 to 0.9.0 (#618) (e2d9d1b)
  • only track one time seeder (8edf6cf)
  • seeds without timestamp should be considered older (f511978)

Features

  • allow setting (faker) locale for seeder factories (5387d44)
  • option to execute seeds only once (5f6d98f)

3.0.0-alpha.5 (2023-05-29)

Bug Fixes

  • adjust build action to cache bin and dist dir (9afa905)

3.0.0-alpha.4 (2023-05-29)

Bug Fixes

  • preserve bin/cli.{mjs,cjs} for publishing (7b175e9)

3.0.0-alpha.3 (2023-05-29)

Bug Fixes

  • keepà bin directory + updated .gitignore (58aebad)

3.0.0-alpha.2 (2023-05-29)

Bug Fixes

  • include bin directory in package-json file list (327ce47)

3.0.0-alpha.1 (2023-05-29)

Bug Fixes

  • circular dependencies between seder and data-source-options (c5d1d09)
  • yargs import for esm cli entry-point (3d46dff)

Features

  • generate cli entry point for cjs/esm (0cc73b6)
  • remove legacy data-source options building (6cb4d77)
  • use rollup and swc to create bundles for cjs & esm (46016e8)

BREAKING CHANGES

  • ormconfig no longer supported
  • CLI path changed

2.8.1 (2023-05-29)

Bug Fixes

  • deps: bump @faker-js/faker from 7.6.0 to 8.0.2 (#589) (1cc418b)
  • deps: bump rapiq from 0.8.0 to 0.8.1 (#590) (ae669c8)
  • deps: bump smob from 1.0.0 to 1.4.0 (#588) (7b0d094)

v2.8.0

compare changes

🚀 Enhancements

  • Sort by filename when using seed pattern (#546)

🩹 Fixes

  • deps: Bump yargs from 17.7.1 to 17.7.2 (#554)

📦 Build

  • deps-dev: Bump typeorm from 0.3.12 to 0.3.13 (#534)
  • deps-dev: Bump @tada5hi/commitlint-config from 1.0.0 to 1.0.1 (#530)
  • deps: Bump codecov/codecov-action from 3.1.1 to 3.1.3 (#547)
  • deps-dev: Bump better-sqlite3 from 8.2.0 to 8.3.0 (#535)
  • deps-dev: Bump eslint from 8.36.0 to 8.38.0 (#537)
  • deps-dev: Bump vitepress from 1.0.0-alpha.64 to 1.0.0-alpha.73 (#545)
  • deps-dev: Bump changelogen from 0.5.2 to 0.5.3 (#549)
  • deps-dev: Bump eslint from 8.38.0 to 8.39.0 (#550)
  • deps-dev: Bump @types/node from 18.15.11 to 18.16.0 (#548)
  • deps-dev: Bump vitepress from 1.0.0-alpha.73 to 1.0.0-alpha.74 (#551)
  • deps-dev: Bump @types/node from 18.16.0 to 18.16.2 (#553)
  • deps-dev: Bump @types/node from 18.16.2 to 18.16.3 (#556)
  • deps-dev: Bump typeorm to v0.3.15 (33c34b1)
  • deps-dev: Remove semantic release dependency (5b9047e)

✅ Tests

  • Fix file-path sort test for windows os (30971e3)

❤️ Contributors

v2.7.0

compare changes

🚀 Enhancements

  • Prepare & extend env reading for env data-source otions reading (c3a401c)
  • Experimental read env data-source options and merge them with file based options (e5c4e1b)
  • Add extra utility to merge data-source options (df5637c)

🩹 Fixes

  • deps: Bump locter from 1.0.10 to 1.1.0 (#523)
  • Export env sub module (fc9090d)

📦 Build

  • Replaced semantic-release with changelogen for release management (66e3997)
  • deps-dev: Bump vitepress from 1.0.0-alpha.61 to 1.0.0-alpha.64 (#529)
  • deps-dev: Bump @tada5hi/eslint-config-typescript (#526)
  • deps-dev: Bump @types/yargs from 17.0.22 to 17.0.24 (#527)
  • deps-dev: Bump @types/node from 18.15.7 to 18.15.11 (#528)

❤️ Contributors

2.6.2 (2023-03-25)

Bug Fixes

  • typo in mongo-db connection creation (f828f26)

2.6.1 (2023-03-25)

Bug Fixes

  • deps: bump locter from 1.0.9 to 1.0.10 (#512) (a4ef42d)

2.6.0 (2023-03-25)

Features

  • add generate migraiton helper utility (c9e3736)
  • add mongodb driver support (5ef4d74)
  • better env variable(s) handling (fea6bf7)

2.5.4 (2023-03-13)

Bug Fixes

  • use of default export for data-source search (66eddf0)

2.5.3 (2023-03-13)

Bug Fixes

  • deps: bump locter to v1.0.9 (ce0abc0)
  • deps: bump yargs from 17.6.2 to 17.7.1 (#492) (0850571)
  • safer strategy for replacing windows separator (8839b57)

2.5.2 (2023-02-16)

Bug Fixes

  • more secure path extension replacement (51f2056)

2.5.1 (2023-02-16)

Bug Fixes

  • enhance path replacement for ts -> js (dd141ab)
  • minor enhancements for path replacing + enhanced find operation (17160ea)

2.5.0 (2023-02-15)

Bug Fixes

  • deps: bump rapiq, better-sqlite(dev) & typeorm(dev) (acff4f7)

Features

  • lazy transpiling of seeder-/data-source-files (5d092ad)
  • stricter typescript rules (64a2868)

2.4.2 (2023-01-17)

Bug Fixes

  • deps: bump locter from 0.6.1 to 0.7.0 (bb0d2fa)
  • deps: bump rapiq from 0.6.2 to 0.6.3 (#438) (d2d4919)
  • generic type for seeder meta (f82c655)

2.4.1 (2022-12-28)

Bug Fixes

  • deps: bump locter from 0.6.0 to 0.6.1 (79f44bf)
  • deps: bump rapiq from 0.6.1 to 0.6.2 (1c941a1)

2.4.0 (2022-12-16)

Features

  • run migrations with specified transaction mode (3e7f9a5)

2.3.1 (2022-12-09)

Bug Fixes

  • deps: bump locter from 0.5.1 to 0.6.0 (8f12f18)
  • deps: bump rapiq from 0.6.0 to 0.6.1 (f15a95e)
  • pending migrations check (532cd2f)

2.3.0 (2022-11-27)

Features

  • add check-database utility fn (706e044)
  • allow null value in query filter list (949124c)

2.2.13 (2022-11-16)

Bug Fixes

  • typo in apply-query check (df79051)

2.2.12 (2022-11-06)

Bug Fixes

  • deps: bump yargs from 17.6.0 to 17.6.2 (b76eeac)

2.2.11 (2022-10-28)

Bug Fixes

  • only apply query parameter if options are defined (49b1d0a)

2.2.10 (2022-10-27)

Bug Fixes

  • deps: bump rapiq from 0.3.1 to 0.3.2 (dd0fc55)

2.2.9 (2022-10-26)

Bug Fixes

  • deps: bump rapiq from 0.0.6 to 0.3.1 (b78dfe8)

2.2.8 (2022-10-21)

Bug Fixes

  • param order in apply-query-parse-output (4fff8cd)

2.2.7 (2022-10-21)

Bug Fixes

  • add apply-query function + cleaned up query sub-module (247fa0a)

2.2.6 (2022-10-20)

Bug Fixes

  • apply-sort should rely on apply-query-sort (dc7f713)

2.2.5 (2022-10-20)

Bug Fixes

  • updated rapiq to v0.2.6 (2220d4d)

2.2.4 (2022-10-20)

Bug Fixes

  • use default-path as alternative default-alias (13594d4)

2.2.3 (2022-10-20)

Bug Fixes

  • updated rapiq to v0.2.5 & updated docs (09226cb)

2.2.2 (2022-10-19)

Bug Fixes

  • updated rapiq to v0.2.4 (0b35d43)

2.2.1 (2022-10-19)

Bug Fixes

  • export parse* methods + updated docs & README.md (3251135)

2.2.0 (2022-10-19)

Features

  • strongly typed options for query parse functions (206c653)

2.1.15 (2022-10-13)

Bug Fixes

  • deps: bump @faker-js/faker from 7.5.0 to 7.6.0 (9730d27)

2.1.14 (2022-10-11)

Bug Fixes

2.1.13 (2022-10-10)

Bug Fixes

  • deps: bump rapiq from 0.0.4 to 0.0.6 (591848e)

2.1.12 (2022-10-04)

Bug Fixes

  • add missing save argument for seeder-factory make method (3f5f32b)

2.1.11 (2022-10-03)

Bug Fixes

  • set seeder to synchronous execution by default (955f2ef)