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

flexgres

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flexgres

Flexibly change your Postgres schemas with Flexgres.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by500%
Maintainers
1
Weekly downloads
 
Created
Source

flexgres

Flexibly change your Postgres schemas with Flexgres

Installation

npm install flexgres --save

Usage

You will need to use the pg-query package and the pg driver. You can install it by writing:

npm install pg-query pg --save

Configuring your table is really simple all you have to do is define your table structure in JSON. An example usage is:

var name = "chris", password = "12345", host = "localhost", port = "5432", db = "flexgres";

var client    = require("pg");
var queryConn = "postgres://"+name+":"+password+"@"+host+":"+port+"/"+db+"";

    client    = new pg.Client(queryConn);

require("./test.js")({
  "driver": client,
  "logging": true,
  "tables": [
    {
      "tableName": "test",
      "columns": [
        {
        "name": "id",
        "type": "INT",
        "primary": true,
        "null": false
        },
        {
        "name": "name",
        "type": "text",
        "primary": true,
        "null": false
        }
      ]
    },
    {
      "tableName": "testTable",
      "columns": [
        {
        "name": "test",
        "type": "INT",
        "primary": true,
        "null": false
        },
        {
        "name": "test2",
        "type": "text",
        "primary": false,
        "null": false
        }
      ]
    }
  ]
})

Keywords

FAQs

Package last updated on 01 Mar 2016

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