AbdulYadi / pgqr

PostgreSQL extension to generate QR code
BSD 3-Clause "New" or "Revised" License
16 stars 4 forks source link

pgqr

PostgreSQL extension to generate QR code

This project adds 2 functionality to QR code generator from repository https://github.com/swex/QR-Image-embedded:

  1. In-memory monochrome bitmap construction (1 bit per pixel).
  2. Wrap the whole package as PostgreSQL extension.

This project has been compiled successfully in Linux against PostgreSQL version 11.
$ make clean
$ make
$ make install

On successful compilation, install this extension in PostgreSQL environment
$ create extension pgqr

Function pgqr has 4 parameters:

  1. t text: text to be encoded.
  2. correction_level integer: 0 to 3.
  3. model_number integer: 0 to 2.
  4. scale integer: pixels for each dot.

Let us create a QR Code
$ select pgqr('QR Code with PostgreSQL', 0, 0, 4);
The output is a monochrome bitmap ready for display.