GithubHelp home page GithubHelp logo

linecode / ozo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yandex/ozo

0.0 2.0 0.0 1.76 MB

OZO is a C++17 Boost.Asio based header-only library for asyncronous communication with PostgreSQL DBMS.

License: PostgreSQL License

CMake 2.85% Python 0.35% C++ 91.14% CSS 4.00% Dockerfile 0.35% C 0.08% Shell 1.23%

ozo's Introduction

ozo

Build Status codecov

What's this

OZO is a C++17 library for asyncronous communication with PostgreSQL DBMS. The library leverages the power of template metaprogramming, providing convenient mapping from C++ types to SQL along with rich query building possibilities. OZO supports different concurrency paradigms (callbacks, futures, coroutines), using Boost.Asio under the hood. Low-level communication with PostgreSQL server is done via libpq. All concepts in the library are designed to be easily extendable (even replaceable) by the user to simplify adaptation to specific project requirements.

API

Since the project is on early state of development it lacks of documentation. We understand the importance of good docs and are working hard on this problem. Complete documentation is on the way, but now:

Dependencies

These things are needed:

  • CMake is used as build system
  • GCC or Clang C++ compiler with C++17 support (tested with GCC 7.0, Clang 5.0 and Apple LLVM version 9.0.0)
  • Boost >= 1.66 with BOOST_HANA_CONFIG_ENABLE_STRING_UDL defined.
  • libpq >= 9.3

If you want to run integration tests and/or build inside Docker container:

  • Docker >= 1.13.0
  • Docker Compose >= 1.10.0

Build

The library is header-only, but if you want to build and run unit-tests you can do it as listed below.

Build and run tests on custom environment

First of all you need to satsfy requirements listed above. You can run tests using these commands.

mkdir -p build
cd build
cmake ..
make -j$(nproc)
ctest -V

Or use build.sh which accepts folowing commands:

scripts/build.sh help

prints help.

scripts/build.sh <compiler> <target>

build and run tests with specified compiler and target, the compiler parameter can be:

  • gcc - for build with gcc,
  • clang - for build with clang.

The target parameter depends on compiler. For gcc:

  • debug - for debug build and tests
  • release - for release build and tests
  • coverage - for code coverage calculation

For clang:

scripts/build.sh all

build all possible configuration.

scripts/build.sh docs

generates documentation.

Build and run tests on MacOS 10.X

For MacOS the best way to satisfy minimum requirements is brew

brew install cmake boost libpq postresql

Build and run tests within Docker

To build code and run tests inside docker container:

scripts/build.sh docker <compiler> <target>

To generate documentation using docker container:

scripts/build.sh docker docs

Test against a local postgres

You can use scripts/build.sh but add pg first:

scripts/build.sh pg <compiler> <target>

or if you want build code in docker:

scripts/build.sh pg docker <compiler> <target>

This will attempt to launch postgres:alpine from your Docker registry. Or you can point ozo tests to a postgres of your choosing by setting these environment variables prior to building:

export OZO_BUILD_PG_TESTS=ON
export OZO_PG_TEST_CONNINFO='your conninfo (connection string)'

scripts/build.sh gcc debug

ozo's People

Contributors

dpotepalov avatar elsid avatar thed636 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.