https://github.com/greenbone/pg-gvm
Greenbone Library for helper functions in PostgreSQL
https://github.com/greenbone/pg-gvm
cmake database extended greenbone ical icalendar postgresql techops tooling
Last synced: 6 months ago
JSON representation
Greenbone Library for helper functions in PostgreSQL
- Host: GitHub
- URL: https://github.com/greenbone/pg-gvm
- Owner: greenbone
- License: gpl-3.0
- Created: 2021-01-20T13:13:16.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-11T10:04:52.000Z (6 months ago)
- Last Synced: 2025-04-11T10:55:14.825Z (6 months ago)
- Topics: cmake, database, extended, greenbone, ical, icalendar, postgresql, techops, tooling
- Language: CMake
- Homepage:
- Size: 229 KB
- Stars: 9
- Watchers: 11
- Forks: 17
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README

# Greenbone Library for PostgreSQL utility functions
This library contains PostgreSQL utility functions. For example to compute host
and ical information within SQL statements.- [Build and Installation](#build-and-installation)
- [Prerequisites](#prerequisites)
- [Configure and Build](#configure-and-build)
- [Use the extension](#use-the-extension)
- [Test the extension](#test-the-extension)
- [Setup for tests](#setup-for-tests)
- [Integration](#integration)
- [Running the tests](#running-the-tests)
- [Support](#support)
- [Maintainer](#maintainer)
- [Contributing](#contributing)
- [CMake formatting](#cmake-formatting)
- [License](#license)# Build and Installation
## Prerequisites
- GCC
- cmake >= 3.5
- pkg-config
- libical >= 1.0.0
- glib >= 2.42
- PostgreSQL dev >= 9.6
- libgvm-base >= 20.8Install these packages using (on Debian GNU/Linux bookworm 12):
```sh
apt-get install gcc cmake pkg-config libical-dev libglib2.0-dev postgresql-server-dev-15
```and build the gvm-libs as described in the [README](https://github.com/greenbone/gvm-libs).
## Configure and Build
This extension can be configured, built and installed with the following commands:
```sh
cmake .
make && make install
```## Use the extension
To use the extension in a database create the extension using
```sh
CREATE EXTENSION "pg-gvm";
```## Test the extension
The tests are based on pgTAP, a unit test tool for PostgreSQL Databases.
### Setup for tests
Install pgTAP cloning the [repository](https://github.com/theory/pgtap.git)
and follow the instructions in the [setup documentation](https://pgtap.org/documentation.html#installation)
### Integration
To use pgTAP in a database use
```sh
CREATE EXTENSION IF NOT EXISTS pgtap;
```as postgres user.
To check if the extension exists use```sh
\dx
```### Running the tests
The tests are located in the ```tests``` folder of this repository.
As postgres user run (replace MY_DATABASE with the real name of the database)
```sh
pg_prove -d MY_DATABASE tests/*.sql
```## Support
For any question on the usage of `pg-vgm` please use the [Greenbone Community
Forum](https://forum.greenbone.net/). If you found a problem with the
software, please [create an issue](https://github.com/greenbone/pg-gvm/issues) on
GitHub. If you are a Greenbone customer you may alternatively or additionally
forward your issue to the Greenbone Support Portal.## Maintainer
This project is maintained by [Greenbone AG](https://www.greenbone.net/).
## Contributing
Your contributions are highly appreciated. Please [create a pull
request](https://github.com/greenbone/pg-gvm/pulls) on GitHub. Bigger changes need
to be discussed with the development team via the [issues section at
github](https://github.com/greenbone/pg-gvm/issues) first.### CMake formatting
All CMake files are formatted using [gersemi](https://github.com/BlankSpruce/gersemi).
To install gersemi on a Debian based system the following commands can be used:```sh
sudo apt install pipx
pipx install gersemi
```To format all CMake files run the command:
```sh
gersemi -i cmake .
```## License
Copyright (C) 2025 [Greenbone AG](https://www.greenbone.net/)
Licensed under the [GNU General Public License v3.0 or later](LICENSE).