aboutsummaryrefslogtreecommitdiff
path: root/composite
diff options
context:
space:
mode:
Diffstat (limited to 'composite')
-rw-r--r--composite/README14
1 files changed, 8 insertions, 6 deletions
diff --git a/composite/README b/composite/README
index b73fa15..bf9e745 100644
--- a/composite/README
+++ b/composite/README
@@ -12,7 +12,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.
@@ -21,7 +21,7 @@ person.sql
following command line:
odb -d <database> --generate-schema --generate-query person.hxx
-
+
Where <database> stands for the database system we are using, for example,
'mysql'.
@@ -34,16 +34,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 persists a 'person' object, loads it and updates its
nickname and aliases which reside in a composite value type, then re-loads
the object and prints its name to verify that the changes have been made
persistent. Finally, the driver performs a database query which uses a
- data member from the composite value type in its criterion.
+ data member from the composite value 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 < person.sql