Skip to content

btouchard/pg_barcode

Repository files navigation

pg_barcode

pg_barcode is a PostgreSQL extension that allows you to generate QRCode & Datamatrix in SVG format directly from your database.

Features

  • Generate QRCode or Datamatrix in SVG format
  • Simple integration with PostgreSQL
  • Based on qrencode & dmtx c libraries

Prerequisites

  • PostgreSQL 9.5 or higher
  • PostgreSQL development tools (postgresql-server-dev-all on Debian/Ubuntu systems)
  • C compiler (gcc or clang)
  • Make

Installation

  1. Clone this repository:

    git clone https://github.com/btouchard/pg_barcode.git
    cd pg_barcode
    
  2. Compile the extension:

    make
    
  3. Install the extension:

    sudo make install
    
  4. Connect to your PostgreSQL database:

    psql -d your_database
    
  5. Create the extension:

    CREATE EXTENSION pg_barcode;

Usage

Once the extension is installed, you can generate QR codes using the generate_qrcode_svg function:

-- Generate a QR code
SELECT generate_qrcode_svg('https://www.kolapsis.com');

Generate Datamatrix using the generate_datamatrix_svg function:

-- Generate a Datamatrix
SELECT generate_datamatrix_svg('https://www.kolapsis.com');

Troubleshooting

If you encounter issues during installation or use of the extension, ensure that:

  1. PostgreSQL is properly installed and configured.
  2. PostgreSQL development tools are installed.
  3. You have the necessary permissions to install the extension.

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE.md file for details.

Acknowledgements

About

PostgreSQL SVG QRcode & Datamatrix generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published