Comments (5)
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.
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.
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.
I don't like that it forces type casting
in some code,
but this could be improved with future refactoring.
import { ObjectLiteral } from 'typeorm';
export type EntityType = ObjectLiteral;
from nestjs-library-crud.
resolved in 0.9.0
from nestjs-library-crud.
Related Issues (14)
- Cannot use package in commonJS
- CrudService.getRepository getter 관련
- `routes` option should match with `only` option in `@crud` decorator HOT 2
- Error: Cannot find Entity name from TypeORM HOT 3
- add support for table inheritance HOT 2
- [Suggestion] Support ability to inject custom Connection HOT 2
- [Suggestion] Search시에 relation 검색기능을 추가하실 생각이 있으실까요? HOT 1
- [Issue]: Offset pagination - Offset skips first entity HOT 8
- [Issue]: embedded properties are always null in readMany and readOne HOT 3
- [Issue]: using .save instead of .create and .update is triggering @BeforeInsert and @AfterInsert subscriber HOT 5
- Cursor pagination of search method is not working with ViewEntity which lacks PK HOT 3
- [Regression]: 0.11.0 , nested entity update support broke readMany HOT 17
- README instructions do not work as expected HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nestjs-library-crud.