Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sequelize-interval-postgres

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sequelize-interval-postgres

Add support for INTERVAL data-type for PostgreSQL in Sequelize

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
384
increased by71.43%
Maintainers
1
Weekly downloads
 
Created
Source

sequelize-interval-postgres

NPM version

Add support for INTERVAL data-type for PostgreSQL in Sequelize.

Motivation

Read:

Install

npm install --save sequelize-interval-postgres

Use to define models

models/my_model.js

const withInterval = require('sequelize-interval-postgres');

module.exports = function (sequelize, SequelizeDataTypes) {
  const DataTypes = withInterval(SequelizeDataTypes);

  const MyModel = sequelize.define('myModel', {
    someIntervalField: {
      type: DataTypes.INTERVAL
    },

    // ...
  });

  // ...

  return MyModel;
};

Use in migrations

migrations/<timestamp>-add-some-interval-field-to-my-model.js

const withInterval = require('sequelize-interval-postgres');

module.exports = {
  up: function (queryInterface, SequelizeBase) {
    const Sequelize = withInterval(SequelizeBase);

    return queryInterface.addColumn('myModel', 'someIntervalField', {
      type: Sequelize.INTERVAL
    });
  },

  // ...
};

Keywords

FAQs

Package last updated on 13 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc