sqlite3x::table_generator Class Reference

EXPERIMENTAL. More...

#include <sqlite3x.hpp>

List of all members.

Classes

class  table_generator_impl
 An internal implementation detail of table_generator. More...

Public Member Functions

 table_generator (sqlite3_connection &con, std::string const &name)
 Initializes the table generation process.
 ~table_generator () throw ()
 Frees up internal resources.
table_generatoroperator() (std::string const &field_name)
 Adds field_name as a field of this table.
void create ()
 Executes the 'create table' statements.


Detailed Description

EXPERIMENTAL.

A helper type for storing information on functions to register with sqlite. EXPERIMENTAL. EXPERIMENTAL. A helper class to generate db tables.

It is used like so:

table_generator( connection, "table_name" )( "field1" )( "field2" )("field3").create();

That creates the named table with the given fields. It throws if table_name already exists in the db or if creation of the table fails.

An arbitrary number of fields can be added using operator()(string), up to the internal limits set by sqlite3.

Definition at line 886 of file sqlite3x.hpp.


Constructor & Destructor Documentation

sqlite3x::table_generator::table_generator ( sqlite3_connection con,
std::string const &  name 
) [explicit]

Initializes the table generation process.

Throws if con contains a table with the same name.

Definition at line 372 of file sqlite3x_connection.cpp.

References sqlite3x::table_generator::table_generator::table_generator_impl::db, sqlite3x::sqlite3_connection::executeint(), and sqlite3x::table_generator::table_generator::table_generator_impl::name.

sqlite3x::table_generator::~table_generator (  )  throw ()

Frees up internal resources.

Definition at line 385 of file sqlite3x_connection.cpp.


Member Function Documentation

void sqlite3x::table_generator::create (  ) 

table_generator & sqlite3x::table_generator::operator() ( std::string const &  field_name  ) 

Adds field_name as a field of this table.

Checks for duplicate field names are deferred until create() is called.

Definition at line 390 of file sqlite3x_connection.cpp.

References sqlite3x::table_generator::table_generator::table_generator_impl::list.


The documentation for this class was generated from the following files:

Generated on Wed Feb 25 15:05:11 2009 for libsqlite3x by  doxygen 1.5.8