diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2024-02-29 10:29:53 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2024-02-29 10:29:53 +0200 |
commit | 015e92cecf875e6f77958e781dffca379b30d873 (patch) | |
tree | 047bdf81058a29a918d38ad35e98d34b4701e9e5 /odb-tests/README.md | |
parent | 7590a21cc9e69a116bcc1284038e5b9ab17c4d4f (diff) |
Add README.md, remove README-GIT, update odb-tests/README.md
Diffstat (limited to 'odb-tests/README.md')
-rw-r--r-- | odb-tests/README.md | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/odb-tests/README.md b/odb-tests/README.md index 24d3bf7..dd540d8 100644 --- a/odb-tests/README.md +++ b/odb-tests/README.md @@ -2,3 +2,81 @@ This package contains tests for `odb`, object-relational mapping (ORM) compiler for C++. + +## Setting up PostgreSQL for running tests + +1. Install the PostgreSQL server. On Linux this is normally done using + distribution packages. + +2. In `/etc/postgresql/N/main/pg_hba.conf` add the following line after the + `local all postgres ...` line: + + ``` + local odb_test odb_test trust + ``` + + If you want to be able to run tests on a different host and access + PostgreSQL via TCP/IP, also add the following line (adjusting the IP + network to match your setup -- never specify a public IP network here since + the access is unauthenticated): + + ``` + host odb_test odb_test 192.168.0.0/24 trust + ``` + + You will also need to edit `/etc/postgresql/N/main/postgresql.conf` and + change `listen_address` to `*`. You may also need to open port `5432` in + your firewall. + + Restart the PostgreSQL server. + +3. Add the `odb_test` user and the `odb_test` database. + + First login: + + ``` + sudo -u postgres psql + ``` + + Then execute the following statements: + + ``` + CREATE USER odb_test; + CREATE DATABASE odb_test; + GRANT ALL PRIVILEGES ON DATABASE odb_test TO odb_test; + \c odb_test + GRANT ALL PRIVILEGES ON SCHEMA public TO odb_test; + ``` + +## Setting up MySQL for running tests + +1. Install the MySQL server. On Linux this is normally done using distribution + packages. + +2. Setup remote access (optional). + + If you want to be able to run tests on a different host and access MySQL + via TCP/IP (never do this on a public server since the access is + unauthenticated), then edit `/etc/mysql/.../mysqld.cnf`, the `[mysqld]` + section, and change `bind-address` to `0.0.0.0`. You may also need to open + port `3306` in your firewall. + + Restart the MySQL server. + +3. Add the `odb_test` user and the `odb_test` database. + + First login: + + ``` + sudo mysql + ``` + + Then execute the following statements: + + ``` + CREATE USER odb_test@'%'; + CREATE USER odb_test@'localhost'; + CREATE DATABASE odb_test; + GRANT ALL PRIVILEGES ON odb_test.* to odb_test@'%'; + FLUSH PRIVILEGES; + ``` |