Sequelize-typescript: Deprecation warning

Created on 3 Oct 2017  路  14Comments  路  Source: RobinBuschmann/sequelize-typescript

I got the following output while trying to spin up a small demo of sequelize-typescript:

sequelize deprecated String based operators are now deprecated. Please use Symbol based operators for better security, read more at http://docs.sequelizejs.com/manual/tutorial/querying.html#operators node_modules/sequelize/lib/sequelize.js:236:13

Most helpful comment

Warning happens by default.

See more: https://github.com/sequelize/sequelize/issues/8417#issuecomment-334056048

To disable this warning add operatorsAliases: false to your Sequelize config (or wait v5):

import { Sequelize } from 'sequelize-typescript';

const sequelize = new Sequelize({
+   operatorsAliases: false,
    host: MYSQL_HOST,
    port: MYSQL_PORT,
    name: MYSQL_DATABASE,
    username: MYSQL_USER,
    // other options
- });
+ } as any);

@RobinBuschmann looks like there is no operatorsAliases in SequelizeConfig | ISequelizeValidationOnlyConfig typings. Oh... It should be in @types/sequelize

All 14 comments

Yeah that鈥檚 the latest sequelize

@csreid Does this happen while using operators like so $like, $gt, $lt, ... or do you get this warning without using any operators in your query?

Warning happens by default.

See more: https://github.com/sequelize/sequelize/issues/8417#issuecomment-334056048

To disable this warning add operatorsAliases: false to your Sequelize config (or wait v5):

import { Sequelize } from 'sequelize-typescript';

const sequelize = new Sequelize({
+   operatorsAliases: false,
    host: MYSQL_HOST,
    port: MYSQL_PORT,
    name: MYSQL_DATABASE,
    username: MYSQL_USER,
    // other options
- });
+ } as any);

@RobinBuschmann looks like there is no operatorsAliases in SequelizeConfig | ISequelizeValidationOnlyConfig typings. Oh... It should be in @types/sequelize

Yes, we need somebody to add typings for the operators.

Hey @mctep, what do you mean "by default"?

I mean that this warning happens always (by default 馃槃) despite string operators usage.
I think this issue should be closed because it is sequelize issue.

To be clear, I'm not actually using any operators. The following script gives me the warning:

import { Sequelize } from 'sequelize-typescript';

let seq = new Sequelize('postgres://localhost:5432/my-database');

@csreid Ah ok, thanks for clearing this. On which sequelize version does this happen?

@mctep So this happens with sequelize only as well?

Sequelize is at 4.13.3.

Whole package.json is here:

{
  "name": "sequelize-typescript-test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "author": "",
  "license": "ISC",
  "dependencies": {
    "reflect-metadata": "^0.1.10",
    "sequelize": "4.13.3",
    "sequelize-typescript": "0.5.0"
  } 
}   

@RobinBuschmann Yes. In sequelize > 4.12.0

@mctep Thanks, then you're absolutely right: This is a sequelize issue.

The warning message is still showing up (unless I set operatorsAliases: false).
As I understand the change causing it were added to sequelize over 3 months ago, do they consider it an issue?

_Updated: Initially this comment reported about more serious issue but as it appeared it was not related to this topic, I do apologize._

Hey @jazzfog thanks for reporting. Can you address your issue here: https://github.com/sequelize/sequelize/issues/8417 . Maybe you already find a solution in this issues comments :)

Was this page helpful?
0 / 5 - 0 ratings