Skip to content

vector-of-bool/adio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adio

Asynchronous Database Library based on Asio

Adio is a database abstraction library built on top of Asio. Adio code may look very similar to code in Asio, and it follows the same patterns and styles found in Asio. For example, to open a database connection synchronously:

#include <adio/sqlite.hpp>

int main()
{
    adio::io_service ios;
    adio::sqlite::connection con{ ios };
    const auto ec = con.open("database.db");
    if (!ec)
        std::cout << "Database was opened!\n";
    else
        std::cout << "There was an error!\n";
}

And asynchronously:

#include <adio/sqlite.hpp>

int main()
{
    adio::io_service ios;
    adio::sqlite::connection con{ ios };
    con.async_open("database.db", [&con](const auto ec) {
        if (!ec)
            std::cout << "Database was opened!\n";
        else
            std::cout << "There was an error!\n";
    });
    ios.run();
}

* Note that adio::io_service is simply an alias to asio::io_service or boost::asio::io_service, depending on the Asio backend selected.

Important note:

Adio is very much in early developement. Feedback would be much appreciated!

About

Asynchronous Database Library based on Asio

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published