[Feature request] Allow to pass side-data param to typeorm
See original GitHub issueMotivation: #68
TypeORM has an ability to pass data as an additional free-shape param to repository operations, that is available on the query runner instance.
// user sends request during entity save
postRepository.save(post, { data: { request: request } });
// in logger you can access it this way:
logQuery(query: string, parameters?: any[], queryRunner?: QueryRunner) {
const requestUrl = queryRunner && queryRunner.data["request"] ? "(" + queryRunner.data["request"].url + ") " : "";
console.log(requestUrl + "executing query: " + sql);
}
The example is from the end of: https://github.com/typeorm/typeorm/blob/master/docs/logging.md#using-custom-logger
If the passed data will be configurable somehow (maybe an async callback that gets request context of something more high-level/) it will be possible to implement #68 with
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:5
Top Results From Across the Web
How to pass data to typeorm transaction - typescript
You are using Transaction type as an argument to your registerTransactionInfo function, checkout some docs about how to use it, ...
Read more >Mutations | NestJS - A progressive Node.js framework
To create an equivalent mutation in Nest, we'll make use of the @Mutation() decorator. Code first#. Let's add another method to the AuthorResolver...
Read more >Theme development
Admin panel Theme Editor allows users to modify layout of blocks, change text or images, styles, etc. This feature works only with standard...
Read more >michael
As soon as the features brag about spying on which URLs your employees are viewing ... a background process and used a global...
Read more >Shortcomings in Backbone, React without Redux
As we built more new features, we noticed some shortcomings in ... to manage our client-side data, but replace Backbone's UI rendering.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Nothing yet? need to get current user from request on Subscriber…
How did you do that?