How to use postgres - 5 common examples

To help you get started, we’ve selected a few postgres 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 DracoBlue / spludo / core / PostgresStorage.js View on Github external
this.db_reconnect = function() {
        var Postgres = require("postgres");
        db = new Postgres.Connection(database_name, username, password, port, host);
    };
github wechatpivot / wechatpivot / mockup / config / config.default.js View on Github external
config.onerror = {
    accepts: function (ctx) {
      if (ctx.req.url.indexOf('/api/') === 0) {
        return 'json';
      } else {
        return 'html';
      }
    },
  };

  config.view = nunjucks;

  config.sequelize = {
    dialect: 'postgres',
    database: props['postgres.database'],
    host: process.env.POSTGRES_ADDRESS || props['postgres.address'],
    port: '5432',
    username: props['postgres.username'],
    password: props['postgres.password'],
    define: {
      freezeTableName: true,
      underscored: true,
    },
  };


  return config;
};
github wechatpivot / wechatpivot / mockup / config / config.default.js View on Github external
config.onerror = {
    accepts: function (ctx) {
      if (ctx.req.url.indexOf('/api/') === 0) {
        return 'json';
      } else {
        return 'html';
      }
    },
  };

  config.view = nunjucks;

  config.sequelize = {
    dialect: 'postgres',
    database: props['postgres.database'],
    host: process.env.POSTGRES_ADDRESS || props['postgres.address'],
    port: '5432',
    username: props['postgres.username'],
    password: props['postgres.password'],
    define: {
      freezeTableName: true,
      underscored: true,
    },
  };


  return config;
};
github wechatpivot / wechatpivot / mockup / config / config.default.js View on Github external
return 'json';
      } else {
        return 'html';
      }
    },
  };

  config.view = nunjucks;

  config.sequelize = {
    dialect: 'postgres',
    database: props['postgres.database'],
    host: process.env.POSTGRES_ADDRESS || props['postgres.address'],
    port: '5432',
    username: props['postgres.username'],
    password: props['postgres.password'],
    define: {
      freezeTableName: true,
      underscored: true,
    },
  };


  return config;
};
github wechatpivot / wechatpivot / mockup / config / config.default.js View on Github external
if (ctx.req.url.indexOf('/api/') === 0) {
        return 'json';
      } else {
        return 'html';
      }
    },
  };

  config.view = nunjucks;

  config.sequelize = {
    dialect: 'postgres',
    database: props['postgres.database'],
    host: process.env.POSTGRES_ADDRESS || props['postgres.address'],
    port: '5432',
    username: props['postgres.username'],
    password: props['postgres.password'],
    define: {
      freezeTableName: true,
      underscored: true,
    },
  };


  return config;
};

postgres

Fastest full featured PostgreSQL client for Node.js

Unlicense
Latest version published 2 months ago

Package Health Score

83 / 100
Full package analysis