Skip to content

No typesafety with CRUD operations #904

Open
@johannbuscail

Description

@johannbuscail

Hi,
Thanks for this awesome library.
I want to use sequelize-typescript but when I started I faced an issue:

import { Column, Model, Table } from "sequelize-typescript";

@Table
export class User extends Model {
	@Column
	nickname: string;
}

User.findAll({
	attributes: ["blabla"],
});

This doesn't throw an error even tho blabla was never defined.
I have the exact same problem when creating a user:

User.create({
	blabla: "",
        nickname: 88
});

It is totally accepted by the library even tho blabla was never defined and nickname is a number and not a string like defined in the model.
That is the first problem but because of that, the IDE doesn't provide any autocompletion.

Those 2 conditions are the main things Typescript was made for.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions