diff options
Diffstat (limited to 'odb-examples/inverse/README')
-rw-r--r-- | odb-examples/inverse/README | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/odb-examples/inverse/README b/odb-examples/inverse/README index 57fcdd0..493b0d1 100644 --- a/odb-examples/inverse/README +++ b/odb-examples/inverse/README @@ -26,7 +26,7 @@ employee.sql --generate-session --default-pointer std::shared_ptr employee.hxx Where <database> stands for the database system we are using, for example, - 'mysql'. + 'pgsql'. The --generate-session option is used to enable session support for all the persistent classes in employee.hxx. The --default-pointer option is @@ -50,25 +50,25 @@ driver.cxx the driver performs a database query which uses a data member from a related object in its criterion. -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 employee-odb.cxx -c++ -DDATABASE_MYSQL -c driver.cxx -c++ -o driver driver.o employee-odb.o -lodb-mysql -lodb +c++ -DDATABASE_PGSQL -c driver.cxx +c++ -o driver driver.o employee-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 < employee.sql +psql --username=odb_test --dbname=odb_test -f employee.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 |