pg_barcode is a PostgreSQL extension that allows you to generate QRCode & Datamatrix in SVG format directly from your database.
- Generate QRCode or Datamatrix in SVG format
- Simple integration with PostgreSQL
- Based on qrencode & dmtx c libraries
- PostgreSQL 9.5 or higher
- PostgreSQL development tools (postgresql-server-dev-all on Debian/Ubuntu systems)
- C compiler (gcc or clang)
- Make
-
Clone this repository:
git clone https://github.com/btouchard/pg_barcode.git cd pg_barcode
-
Compile the extension:
make
-
Install the extension:
sudo make install
-
Connect to your PostgreSQL database:
psql -d your_database
-
Create the extension:
CREATE EXTENSION pg_barcode;
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');
If you encounter issues during installation or use of the extension, ensure that:
- PostgreSQL is properly installed and configured.
- PostgreSQL development tools are installed.
- You have the necessary permissions to install the extension.
Contributions are welcome! Feel free to open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE.md file for details.
- QR Code generator library: https://fukuchi.org/works/qrencode/manual/index.html
- Datamatrix generator: https://github.com/dmtx/libdmtx
- The PostgreSQL community for their excellent resources on extension development.