1.0.5 • Published 3 years ago

typeorm-nested-where v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Nested relations filtering for Typeorm repositories. Warning: works with typeorm v.2.2.5. For other versions is not checked.

Function whereToRaw can convert your find conditions to raw SQL string. After that you can use this string in repository query.

Example:

const whereConditions: FindConditions<Pet> = {
    name: 'Mike',
    owner: {
        age: 20,
        status: In(['a', 'b']),
    } as FindConditions<User>,
};

// convert conditions to raw SQL string
const rawWhere = whereToRaw('Pet', whereConditions, 'snake_to_camelcase'));

const count = await getConnection().getRepository(Pet).find({
    where: rawWhere,
    relations: ['owner']
});

1.0.5

3 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago