A simple postgresql client driver for Dictu
Clone the repository:
git clone --recurse-submodules https://github.com/liz3/dictu-pg.git
Note: You need a version of dictu build from Dictus develop branch because the FFI API is not currently in a release.
cd third-party/pq
./configure with_icu=no --prefix=$(pwd)/build
make -j && make install
Note: If you Cygwin installation is NOT c:\cygwin64
then update third-party\pq\src\tools\msvc\buildenv.pl
Note: Make sure there are no cygwin or msys compilers in your path, so to use the MSVC Compiler
cd <repository root>
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cd <repository-root>\third-party\pq\src\tools\msvc
.\build.bat
cd third-party\pq
.\src\tools\msvc\install.bat .\build
cd <repository root>
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j
cd <repository root>
cd build
cmake --build . --config Release
Note: On windows after building you need to copy the DLLs from
third-party\pg\build\libinto
build\Release` for the mod to work.
from "mod.du" import pg;
Here are a list of exposed functions:
mod.createClient(url:string) -> Client
Client.connect() -> bool
Client.exec(query: string) -> Result(Dict)
Client.exec(query: string, params: List) -> Result(Dict)