diff options
Diffstat (limited to 'odb-examples/prepared/README')
-rw-r--r-- | odb-examples/prepared/README | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/odb-examples/prepared/README b/odb-examples/prepared/README index 644e11a..49ae377 100644 --- a/odb-examples/prepared/README +++ b/odb-examples/prepared/README @@ -22,7 +22,7 @@ person.sql --generate-schema person.hxx Where <database> stands for the database system we are using, for example, - 'mysql'. + 'pgsql'. The --generate-prepared option requests the generation of the prepared query support code. @@ -41,25 +41,25 @@ driver.cxx instance and creates a number of persistent objects. It then prepares and executes a number of queries to illustrate various usage scenarios. -To compile and link the example manually from the command line we can use -the following commands (using MySQL as an example; replace 'c++' with your +To compile and link the example manually from the command line we can use the +following commands (using PostgreSQL as an example; replace 'c++' with your C++ compiler name): c++ -c person-odb.cxx -c++ -DDATABASE_MYSQL -c driver.cxx -c++ -o driver driver.o person-odb.o -lodb-mysql -lodb +c++ -DDATABASE_PGSQL -c driver.cxx +c++ -o driver driver.o person-odb.o -lodb-pgsql -lodb 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 +code which makes this step unnecessary). Using PostgreSQL as an example, this can be achieved with the following command: -mysql --user=odb_test --database=odb_test < person.sql +psql --username=odb_test --dbname=odb_test -f person.sql Here we use 'odb_test' as the database login and also 'odb_test' as the database name. -Once the database schema is ready, we can run the example (using MySQL as +Once the database schema is ready, we can run the example (using PostgreSQL as the database): ./driver --user odb_test --database odb_test |