Giter Club home page Giter Club logo

Comments (5)

jiho-kr avatar jiho-kr commented on June 2, 2024 2

I found the use of the Active Record Pattern in the code.

This will be fixed in #377

and I am checking can apply ObjectLiteral not EntitySchema

from nestjs-library-crud.

jiho-kr avatar jiho-kr commented on June 2, 2024

hi tkahng

Right
It is not using ActiveRecord Pattern, so there is no problem with not extended from BaseEntity.

The BaseEntity Type is being simply used for the purpose that is Entity.

It can use EntitySchema instead of BaseEntity. how is it?

from nestjs-library-crud.

tkahng avatar tkahng commented on June 2, 2024

you mean like

export class CrudService<T extends EntitySchema<T>> {

never used EntitySchema, but doing a quick test it doesnt seem to work wit regular entities. or am i misunderstanding what you said?

I was thinking what nestjsx/crud did would be fine.

export declare class TypeOrmCrudService<T> extends CrudService<T, DeepPartial<T>> {

where T extends ObjectLiteral

and anything they needed for the Entity, like columns, relations was through the repo:

protected get entityType(): ClassType<T> { return this.repo.target as ClassType<T>; }

not sure if this would be an easy task from a quick look at the source. what do you think of this?

from nestjs-library-crud.

jiho-kr avatar jiho-kr commented on June 2, 2024

I don't like that it forces type casting in some code,
but this could be improved with future refactoring.

#384

import { ObjectLiteral } from 'typeorm';

export type EntityType = ObjectLiteral;

from nestjs-library-crud.

jiho-kr avatar jiho-kr commented on June 2, 2024

resolved in 0.9.0

from nestjs-library-crud.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.