A single threaded language means it can do only one thing at a time. Then why we use a single threaded language like NodeJS to create high traffic web applications with lots of concurrent connection.
Doesn’t it look counterintuitive?
Don’t you think a multi-thread language like Java and C++ will be more appropriate for this use case?
SQL commands are instructions. It is used to communicate with the database. It is also used to perform specific tasks,
functions, and queries of data.
SQL can perform various tasks like create a table, add data to tables, drop the table, modify the table, set permission for users.
Sentry is a software platform that helps developers to identify and fix errors in their applications in real time. It is designed to work with a wide range of programming languages and technologies, and it integrates with various development and deployment tools.
Serverless computing is a cloud computing execution model in which the cloud provider allocates machine resources on-demand, taking care of the servers on behalf of their customers.
When an app is not in use, there are no computing resources allocated to the app.
Pricing is based on the actual amount of resources consumed by application
Custom providers in nest JS consist of dependency injection.
Dependency injection is an inversion of control (IoC) technique wherein you delegate instantiation of dependencies to the IoC container, instead of doing it in your own code imperatively.
Nest is built around a language feature called decorators. Decorators are a well-known concept in a lot of commonly used programming languages but in the JavaScript world they're still relatively new.
Interceptor in nest is an interceptor is a class annotated with the @Injectable() decorator and implements the NestInterceptor interface.
Interceptors have a set of useful capabilities
As yesterday was sharing views over the guards in nest JS. Today let's find out the execution context of auth guard.
Execution Context
The canActivate() function takes a single argument, the ExecutionContext instance. The ExecutionContext inherits from ArgumentsHost.
A guard is a class annotated with the @Injectable() decorator which implements the CanActivate interface.
Guards have a single responsibility that determine whether a given request will be handled by the route handler or not, depending on certain conditions like permissions, roles, ACLs etc. present at run-time which refers to authorization.
Multiple relations of same models
sequelize-typescript resolves the foreign keys by identifying the corresponding class references.
So if we define a model with multiple relations like
class Book extends Model {
@ForeignKey(() => Person)
@Column
authorId: number;
@BelongsTo(() => Person)
author: Person;
@ForeignKey(() => Person)
@Column
proofreaderId: number;
@BelongsTo(() => Person)
proofreader: Person;
}
@Table
class Person extends Model {
@HasMany(() => Book)
writtenBooks: Book[];
@HasMany(() => Book)
proofedBooks: Book[];
}