Git Product home page Git Product logo

enmap-pgsql's Introduction

Enmap-PGSql

Enmap-PGSql is a provider for the Enmap module.

Installation

enmap-psql requires a PostgreSQL server of version 9.5 or higher due to the use of the new "upsert"-ish feature (on conflict update). Lower versions will not work.

To install Enmap-PGSql simply run npm i enmap-pgsql.

Usage

// Load Enmap
const Enmap = require('enmap');
 
// Load EnmapPGSql
const EnmapPGSql = require('enmap-pgsql');
 
// Initialize the provider
const provider = new EnmapPGSql({ name: 'test' });
 
// Initialize the Enmap with the provider instance.
const myColl = new Enmap({ provider: provider });

Shorthand declaration:

const Enmap = require('enmap');
const EnmapPGSql = require('enmap-pgsql');
const myColl = new Enmap({ provider: new EnmapPGSql({ name: 'test' }); });

Options

// Example with all options.
const level = new EnmapPGSql({ 
  name: "test",
  user: "postgres",
  password: "password",
  host: "localhost",
  port: 5432,
  database: "postgres"
});

// Example with connection string
const level = new EnmapPGSql({ 
  name: "test",
  connectionString = "postgresql://dbuser:[email protected]:3211/mydb"
});

name

Defines the name of the table saved in the database.

user, password, host, port, database

I'm tired, I've been trying to get this working for a while, and in this state of mind, my documentation for these fields is:

If you can't figure out what any of those means, you're making me lose faith in humanity.

connectionString

This can be use alternatively to all of the above, a full connection string to the database. Looks like this:

postgresql://dbuser:[email protected]:3211/mydb

enmap-pgsql's People

Contributors

eslachance avatar kevlarfromdiscord avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.