How to use the sequelize.TEXT function in sequelize

To help you get started, we’ve selected a few sequelize examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / sequelize_v4.x.x / flow_v0.42.x- / test_sequelize.js View on Github external
//
//  DataTypes
// ~~~~~~~~~~~
//
//  https://github.com/sequelize/sequelize/blob/v3.4.1/test/unit/sql/data-types.test.js
//

Sequelize.STRING;
Sequelize.STRING( 1234 );
Sequelize.STRING( { length : 1234 } );
Sequelize.STRING( 1234 ).BINARY;
Sequelize.STRING.BINARY;
Sequelize.TEXT;
Sequelize.TEXT( 'tiny' );
Sequelize.TEXT( { length : 'tiny' } );
Sequelize.TEXT( 'medium' );
Sequelize.TEXT( 'long' );
Sequelize.CHAR;
Sequelize.CHAR( 12 );
Sequelize.CHAR( { length : 12 } );
Sequelize.CHAR( 12 ).BINARY;
Sequelize.CHAR.BINARY;
Sequelize.BOOLEAN;
Sequelize.DATE;
Sequelize.DATE(6);
Sequelize.UUID;
Sequelize.UUIDV1;
Sequelize.UUIDV4;
Sequelize.NOW;
Sequelize.INTEGER;
Sequelize.INTEGER.UNSIGNED;
github flow-typed / flow-typed / definitions / npm / sequelize_v4.x.x / flow_v0.42.x- / test_sequelize.js View on Github external
//  DataTypes
// ~~~~~~~~~~~
//
//  https://github.com/sequelize/sequelize/blob/v3.4.1/test/unit/sql/data-types.test.js
//

Sequelize.STRING;
Sequelize.STRING( 1234 );
Sequelize.STRING( { length : 1234 } );
Sequelize.STRING( 1234 ).BINARY;
Sequelize.STRING.BINARY;
Sequelize.TEXT;
Sequelize.TEXT( 'tiny' );
Sequelize.TEXT( { length : 'tiny' } );
Sequelize.TEXT( 'medium' );
Sequelize.TEXT( 'long' );
Sequelize.CHAR;
Sequelize.CHAR( 12 );
Sequelize.CHAR( { length : 12 } );
Sequelize.CHAR( 12 ).BINARY;
Sequelize.CHAR.BINARY;
Sequelize.BOOLEAN;
Sequelize.DATE;
Sequelize.DATE(6);
Sequelize.UUID;
Sequelize.UUIDV1;
Sequelize.UUIDV4;
Sequelize.NOW;
Sequelize.INTEGER;
Sequelize.INTEGER.UNSIGNED;
Sequelize.INTEGER.UNSIGNED.ZEROFILL;
Sequelize.INTEGER( 11 );
github kingsquare / swagger-sequelize / index.js View on Github external
default:
          if (swaggerPropertySchema.maxLength) {
            // http://stackoverflow.com/questions/13932750/tinytext-text-mediumtext-and-longtext-maximum-sto
            // http://stackoverflow.com/questions/7755629/varchar255-vs-tinytext-tinyblob-and-varchar65535-v
            // NOTE: text may be in multibyte format!
            if (swaggerPropertySchema.maxLength > 5592415) {
              return Sequelize.TEXT("long");
            }

            if (swaggerPropertySchema.maxLength > 21845) {
              return Sequelize.TEXT("medium");
            }

            // NOTE: VARCHAR(255) may container 255 multibyte chars: it's _NOT_ byte delimited
            if (swaggerPropertySchema.maxLength > 255) {
              return Sequelize.TEXT();
            }
          }

          return Sequelize.STRING; // === VARCHAR
      }

    case "array":
      if (dialect === "postgres") {
        return Sequelize.ARRAY(getSequalizeType(swaggerPropertySchema.items));
      }
      console.log(
        "Warning: encountered",
        JSON.stringify(swaggerPropertySchema)
      );
      console.log(
        "Can only handle array for postgres (yet?), see http://docs.sequelizejs.com/en/latest/api/datatypes/#array, falling back to blob"
github zalando / zappr / server / server.js View on Github external
params: [db.queryInterface, Sequelize]
    },
    storageOptions: {
      // The configured instance of Sequelize.
      sequelize: db,
      // this one is actually undocumented
      schema: 'zappr_meta',
      // The name of the to be used model.
      // (not sure if we need this actually)
      modelName: 'SequelizeMeta',
      // The name of table to create if `model` option is not supplied
      tableName: 'migrations',
      // The name of table column holding migration name.
      columnName: 'migration',
      // The type of the column holding migration name.
      columnType: new Sequelize.TEXT
    }
  })
  await db.createSchemas()
  // apply migrations
  await umzug.up({from: nconf.get('DB_UMZUG_FROM') || null})
  init().listen(port)
  info(`listening on port ${port}`)
  if (opts.metricsEnabled) {
    const actualMetricsPort = opts.metricsPort || 3003
    initMetrics().listen(actualMetricsPort)
    info(`metrics available on port ${actualMetricsPort}`)
  }
}
github kingsquare / swagger-sequelize / index.js View on Github external
return Sequelize.DATE;

        case "uuid":
          return Sequelize.UUID;

        default:
          if (swaggerPropertySchema.maxLength) {
            // http://stackoverflow.com/questions/13932750/tinytext-text-mediumtext-and-longtext-maximum-sto
            // http://stackoverflow.com/questions/7755629/varchar255-vs-tinytext-tinyblob-and-varchar65535-v
            // NOTE: text may be in multibyte format!
            if (swaggerPropertySchema.maxLength > 5592415) {
              return Sequelize.TEXT("long");
            }

            if (swaggerPropertySchema.maxLength > 21845) {
              return Sequelize.TEXT("medium");
            }

            // NOTE: VARCHAR(255) may container 255 multibyte chars: it's _NOT_ byte delimited
            if (swaggerPropertySchema.maxLength > 255) {
              return Sequelize.TEXT();
            }
          }

          return Sequelize.STRING; // === VARCHAR
      }

    case "array":
      if (dialect === "postgres") {
        return Sequelize.ARRAY(getSequalizeType(swaggerPropertySchema.items));
      }
      console.log(
github Automattic / woocommerce-services / tests / e2e-tests / fixtures / db.js View on Github external
type: Sequelize.DATE,
		allowNull: false,
		defaultValue: Sequelize.NOW
	},
	post_date_gmt : {
		type: Sequelize.DATE,
		allowNull: false,
		defaultValue: Sequelize.NOW
	},
	post_content  : {
		type: Sequelize.TEXT,
		allowNull: false,
		defaultValue: ''
	},
	post_title: {
		type: Sequelize.TEXT( 'tiny' ),
		allowNull: false
	},
	post_excerpt: {
		type: Sequelize.TEXT( 'tiny' ),
		allowNull: false,
		defaultValue: ''
	},
	post_status: {
		type: Sequelize.STRING( 20 ),
		allowNull: false,
		defaultValue: 'publish'
	},
	comment_status: {
		type: Sequelize.STRING( 20 ),
		allowNull: false,
		defaultValue: 'open'
github CodeChain-io / codechain-indexer / src / models / transaction.ts View on Github external
type: DataTypes.STRING
            },
            sig: {
                allowNull: false,
                type: DataTypes.STRING,
                validate: {
                    is: ["^[a-f0-9]{130}$"]
                }
            },
            signer: {
                allowNull: false,
                type: DataTypes.STRING
            },

            errorHint: {
                type: Sequelize.TEXT("MEDIUM")
            },
            timestamp: {
                type: DataTypes.INTEGER
            },
            isPending: {
                allowNull: false,
                type: DataTypes.BOOLEAN
            },
            pendingTimestamp: {
                type: DataTypes.INTEGER
            },
            createdAt: {
                allowNull: false,
                type: DataTypes.DATE
            },
            updatedAt: {

sequelize

Sequelize is a promise-based Node.js ORM tool for Postgres, MySQL, MariaDB, SQLite, Microsoft SQL Server, Amazon Redshift and Snowflake’s Data Cloud. It features solid transaction support, relations, eager and lazy loading, read replication and more.

MIT
Latest version published 10 days ago

Package Health Score

95 / 100
Full package analysis