1.0.0 • Published 6 years ago

pg-stored-procedure v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

pg-stored-procedure Build Status codecov

CLI for scaffolding out PostgreSQL stored procedures

CLI

Install

$ npm install --global pg-stored-procedure

Usage

$ pgsp --help

  Usage
    $ pgsp [name]

  Options
    --path / -p  Path to SQL file output
      (Outputs to clipboard if omitted)

  Examples
    $ pgsp get_user_info
    $ pgsp get_user_info -p .

Code

Install

npm install pg-stored-procedure

Usage

const pgsp = require('pg-stored-procedure');

pgsp('foo_bar');
//=>
// DROP TYPE IF EXISTS type_foo_bar CASCADE;
// CREATE TYPE type_foo_bar AS (

// );

// CREATE OR REPLACE FUNCTION foo_bar(

// ) RETURNS SETOF type_foo_bar AS $FUNCTION$
// DECLARE

// BEGIN

// END;
// $FUNCTION$ LANGUAGE plpgsql;

API

pgsp(functionName)

functionName

Type: string

Name of the stored procedure.

License

MIT © Hoishin