aboutsummaryrefslogtreecommitdiff
path: root/hello/README
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-04-26 09:17:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-04-26 09:17:15 +0200
commit6ae5df8a85cd0344cc12effe788f7e09d06df372 (patch)
treefef101ef0ab4c83dff84370e12640f900101e806 /hello/README
parente159da71e25aa50fc73479f9aa7aef7185c28a1c (diff)
Add note on embedded schemas
Diffstat (limited to 'hello/README')
-rw-r--r--hello/README13
1 files changed, 7 insertions, 6 deletions
diff --git a/hello/README b/hello/README
index 1eb36be..5929f52 100644
--- a/hello/README
+++ b/hello/README
@@ -10,7 +10,7 @@ person.hxx
person-odb.hxx
person-odb.ixx
-person-odb.cxx
+person-odb.cxx
person.sql
The first three files contain the database support code and the last file
contains the database schema for the person.hxx header.
@@ -19,7 +19,7 @@ person.sql
following command line:
odb -d <database> --generate-query --generate-schema person.hxx
-
+
Where <database> stands for the database system we are using, for example,
'mysql'.
@@ -32,13 +32,15 @@ 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. Then it executes a number of database transactions on persistent
objects.
-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 < person.sql
@@ -49,4 +51,3 @@ Once the database schema is ready, we can run the example (using MySQL as
the database):
./driver --user odb_test --database odb_test
-