diff options
Diffstat (limited to 'odb-examples/c++11/README')
-rw-r--r-- | odb-examples/c++11/README | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/odb-examples/c++11/README b/odb-examples/c++11/README index 638b9a2..0cf15ac 100644 --- a/odb-examples/c++11/README +++ b/odb-examples/c++11/README @@ -31,7 +31,7 @@ employee.sql employee.hxx Where <database> stands for the database system we are using, for example, - 'mysql'. + 'pgsql'. database.hxx Contains the create_database() function which instantiates the concrete @@ -50,25 +50,25 @@ driver.cxx relationships. Finally, the driver performs a database query and iterates over the result printing basic information about the returned objects. -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 |