JSPM

@pgpm-testing/base32

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 754
  • Score
    100M100P100Q107738F

Base32 encoding and decoding functions for PostgreSQL

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@pgpm-testing/base32) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    @pgpm-testing/base32

    RFC4648 Base32 encode/decode in plpgsql

    Usage

    select base32.encode('foo');
    -- MZXW6===
    
    
    select base32.decode('MZXW6===');
    -- foo

    credits

    Thanks to

    https://tools.ietf.org/html/rfc4648

    https://www.youtube.com/watch?v=Va8FLD-iuTg

    Development

    start the postgres db process

    First you'll want to start the postgres docker (you can also just use docker-compose up -d):

    make up

    install modules

    Install modules

    yarn install

    install the Postgres extensions

    Now that the postgres process is running, install the extensions:

    make install

    This basically sshs into the postgres instance with the packages/ folder mounted as a volume, and installs the bundled sql code as pgxn extensions.

    testing

    Testing will load all your latest sql changes and create fresh, populated databases for each sqitch module in packages/.

    yarn test:watch

    building new modules

    Create a new folder in packages/

    pgpm init

    Then, run a generator:

    pgpm generate

    You can also add arguments if you already know what you want to do:

    pgpm generate schema --schema myschema
    pgpm generate table --schema myschema --table mytable

    deploy code as extensions

    cd into packages/<module>, and run pgpm package. This will make an sql file in packages/<module>/sql/ used for CREATE EXTENSION calls to install your sqitch module as an extension.

    recursive deploy

    You can also deploy all modules utilizing versioning as sqtich modules. Remove --createdb if you already created your db:

    pgpm deploy awesome-db --yes --recursive --createdb