From 6ae5df8a85cd0344cc12effe788f7e09d06df372 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 26 Apr 2011 09:17:15 +0200 Subject: Add note on embedded schemas --- boost/README | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'boost') diff --git a/boost/README b/boost/README index c731bad..021d601 100644 --- a/boost/README +++ b/boost/README @@ -15,7 +15,7 @@ employee.hxx employee-odb.hxx employee-odb.ixx -employee-odb.cxx +employee-odb.cxx employee.sql The first three files contain the database support code and the last file contains the database schema for the employee.hxx header. @@ -40,16 +40,18 @@ driver.cxx headers to gain access to the persistent classes and their database support code. It also includes database.hxx for the create_database() function declaration. - + In main() the driver first calls create_database() to obtain the database instance. It then creates a number of 'employee' and 'employer' objects and persists them in the database. The next transaction loads all the employees of a particular employer using the employee-employer relationship. Finally, - the driver performs a database query which uses a data member of the Boost + the driver performs a database query which uses a data member of the Boost gregorian::date type in its criterion. -To run the example we first need to create the database schema. Using MySQL -as an example, this can be achieved with the following command: +To run the example we may first need to create the database schema (for some +database systems, such as SQLite, the schema is embedded into the generated +code which makes this step unnecessary). Using MySQL as an example, this +can be achieved with the following command: mysql --user=odb_test --database=odb_test < employee.sql -- cgit v1.1