Git Product home page Git Product logo

pghuelle's Introduction

PG Huelle

What is this Project about?

PG Huelle is a project, to work with postgresql databases without the need to write real SQL commands via a function based approach. Everything you can do with normal SQL in a postgres environment can be done with PG Huelle aswell.

Installation

For now PG Huelle is only available via GitHub cloning. If you want to test this Repository, use the test folder and write you're own tests. When the Project is in an acceptable state, it will be published to the NPM registry and can be used as a normal package.

Example

The Example will be held, as we import this from the npm registry
To give a quick example, how things work in PG Huelle, we will use a quick query example. The installation script can be found under src/test/testdb.sql. In simple terms it creates a Table Person consisting of an ID as the PK, a Name and an Age.

const PGHuelle = require('pghuelle').PGHuelle;

const config = {
  user: 'postgres',
  password: 'root',
  port: 5432,
  database: '<your_database>',
  host: 'localhost',
};

const db = new PGHuelle(config);

db.select().from('person').execute();

First we import our PHuelle class, and create a config object to connect to the Database. Then we create an instance of a PGHuelle class and give it our config object. With db.select().from('person').execute(); we query every person in our persons table, and execute the query. This function then returns a Promise with our result.

pghuelle's People

Contributors

trowl3r avatar

Watchers

 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.