Skip to content

goodybag/pg-range-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PG Range

Handles parsing of postgres range types

install

npm install -S pg-range-parser

usage

var pgRangeType = require('pg-range-parser');
  
// { start:  { value: '2015-01-01', inclusive: true }
// , end:    { value: '2015-02-01', inclusive: false }
// }
pgRangeType.parse('[2015-01-01,2015-02-01)')

// '[2015-01-01,2015-02-01)'
pgRangeType.serialize({
  start:  { value: '2015-01-01', inclusive: true }
, end:    { value: '2015-02-01', inclusive: false }
})

pgtype will modify your enums (never drops) and add new types.

API

Root Namespace

.parse( String ) -> Object

Parse a range from a string

.serialize( Object ) -> String

Serialize a range object

About

Parses postgres range types

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published