aboutsummaryrefslogtreecommitdiff
path: root/query/README
diff options
context:
space:
mode:
Diffstat (limited to 'query/README')
-rw-r--r--query/README13
1 files changed, 7 insertions, 6 deletions
diff --git a/query/README b/query/README
index c7d8d7a..98b38f1 100644
--- a/query/README
+++ b/query/README
@@ -8,7 +8,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.
@@ -17,7 +17,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'.
@@ -30,13 +30,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. It then persists a number of 'person' objects in the database
and executes a number of queries to find objects matching various criteria.
-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
@@ -47,4 +49,3 @@ Once the database schema is ready, we can run the example (using MySQL as
the database):
./driver --user odb_test --database odb_test
-