Skip to content
A C++ Implementation of the Active Record Pattern
C C++ Shell Ruby
Find file
New pull request
Latest commit b510081 @joeyates Set up Travis CI
Failed to load latest commit information.
doc Updated docs to reflect API changes
examples Postgresql support
include Include postgresql server headers in project
profiling Profile ActiveRecord or straight SQLite according to a define
src Postgresql support
test Access test env directly
.gitignore Postgresql support
.travis.yml Set up Travis CI
AUTHORS Using Rake::Cpp
COPYING Using Rake::Cpp
ChangeLog Using Rake::Cpp Improve autoconf maintenance
Gemfile Improve autoconf maintenance
INSTALL Improve autoconf maintenance Install makedepend Access test env directly Access test env directly
NEWS Using Rake::Cpp
README Include configure requirements Set up Travis CI
Rakefile Set up Travis CI
VERSION Missing files for autoconf process
aclocal.m4 Improve autoconf maintenance
compile Improve autoconf maintenance Include configure requirements
configure Improve autoconf maintenance Include configure-based build files
depcomp Include configure requirements
install-sh Include configure requirements
missing Set up Travis CI

Build Status

ActiveRecord - a C++ implementation of the Active Record pattern.

Databases supported:

  • PostgreSQL
  • SQLite


See the file

Quick Start Guide

Here's a Hello World! example, that saves a record to the database, and retrieves it:

#include <active_record/type.h>
#include <active_record/base.h>
#include <active_record/connection.h>
#include <active_record/query.h>
#include <iostream>

using namespace ActiveRecord;

class Greeting: public ActiveRecord::Base< Greeting > {
  static Table table( Connection * connection ) {
    Table td( connection, "greetings" );
    td.fields() = fields
                  ( "salute",   ActiveRecord::text )
                  ( "thing",    ActiveRecord::text )
                  ( "language", ActiveRecord::text );
    return td;

AR_DECLARE( Greeting )

int main( int argc, const char *argv[] ) {
  Connection connection;
  connection.connect( options
                      ( "adapter", "sqlite" )
                      ( "database", "greetings.sqlite3" ) );
  Greeting::setup( &connection );
  Greeting greeting( attributes
                  ( "salute", "Hello" )
                  ( "thing", "World" )
                  ( "language", "English" ) );;

  Greeting greeting1( 1 );
  cout << "In " << greeting1[ "language" ] << " you say:" << endl;
  cout << "'" << greeting1[ "salute" ] << " " << greeting1[ "thing" ] << "!'" << endl;

  return 0;

Development and Tests

See the file

Other information

  • Usage
    • See the examples directory
  • Documentation
    • See the doc directory
Something went wrong with that request. Please try again.