Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/codiepp/pl_lmdb

Prolog interface to LMDB (Lightning Memory-mapped Database)
https://github.com/codiepp/pl_lmdb

hacktoberfest lmdb prolog

Last synced: about 18 hours ago
JSON representation

Prolog interface to LMDB (Lightning Memory-mapped Database)

Awesome Lists containing this project

README

        

# Interfacing to LMDB from Prolog

[![building the package for SWI Prolog](https://github.com/CodiePP/pl_lmdb/actions/workflows/compilation.yml/badge.svg?branch=main)](https://github.com/CodiePP/pl_lmdb/actions/workflows/compilation.yml)

[LMDB](http://www.lmdb.tech/doc/) is a very fast database which maps committed records into memory.

## compilation

```sh
aclocal --force && autoheader --force && autoconf --force
```
then run
```sh
./configure
```
then call `make swi` to compile for SWI Prolog, or `make gp` to compile for GNU Prolog.
A simple `make` will produce both.

## installation (SWI Prolog)

```sh
mkdir -p ${HOME}/lib/sbcl
cp src/lmdb.qlf ~/lib/sbcl/
cp pllmdb-* ~/lib/sbcl/pllmdb
```

add to the search path for SWI Prolog:
```sh
echo ":- assertz(file_search_path(sbcl,'${HOME}/lib/sbcl'))." >> ${HOME}/.config/swi-prolog/init.pl
```

## tests

run `make check` to start all tests using SWI Prolog and GNU Prolog. Note the time to completion.

this test will populate a database with one million of records:
```sh
swipl -l test/t3.pl -g test
```

this test reads them all back and verifies them:
```sh
swipl -l test/t4.pl -g test
```