Category "sequelize-typescript"

Sequelize scope on create

I am quite new to sequelize and trying to use it with sequelize-typescript. I have a user model like this: @Scopes(() => ({ authenticated: { attr

How to use Haversine formula in Sequelize-typescript to get distance between two coordinates

SELECT id, ( 6371 * ACOS( COS( RADIANS( db_latitude ) ) * COS( RADIANS( $user_latitude ) ) * COS( RADIANS( $user_longitude ) -

How to automatically update virtual model property when updating its foreign key reference?

I have a order table that refers to status table by foreign key status_id: $ select order_id, status_id from "order"; order_id | status_id ----------+-------

How to automatically update virtual model property when updating its foreign key reference?

I have a order table that refers to status table by foreign key status_id: $ select order_id, status_id from "order"; order_id | status_id ----------+-------