diff --git a/README.md b/README.md index 9b830c1..4d56aca 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ and provides helpers to run (and replay) migrations until it works. * [Command ``upgrade`` (BETA)](#command-upgrade) * [Command ``generate-module-analysis`` (BETA)](#command-generate-module-analysis) * [Command ``estimate-workload`` (BETA)](#command-estimate-workload) + * [Command ``psql``](#command-psql) @@ -365,3 +366,72 @@ the work to do for the migration. renaming or merging of modules) - check that the analysis and migration have been done for the official modules present in odoo/odoo + + + +## Command: ``psql`` + +**Prerequites:** init + +``` +odoo-openupgrade-wizard psql + --database DB_NAME + --command "SQL_REQUEST" +``` + +Execute an SQL Request on the target database. + +**Optional arguments** + +* If no ``database`` is provided, default ``postgres`` database will be used. exemple: + +``` +odoo-openupgrade-wizard psql --command "\l"; +``` +Result: +``` + List of databases + Name | Owner | Encoding | Collate | Ctype | Access privileges +------------+-------+----------+------------+------------+------------------- + postgres | odoo | UTF8 | en_US.utf8 | en_US.utf8 | + template0 | odoo | UTF8 | en_US.utf8 | en_US.utf8 | =c/odoo + + | | | | | odoo=CTc/odoo + template1 | odoo | UTF8 | en_US.utf8 | en_US.utf8 | =c/odoo + + | | | | | odoo=CTc/odoo + test_psql | odoo | UTF8 | en_US.utf8 | en_US.utf8 | + +``` + +* if you execute request that return long result, you can choose to select ``pager`` or ``-no-pager`` + option to display the result via the click function ``echo_via_pager``. + (see : https://click.palletsprojects.com/en/8.1.x/utils/#pager-support) + +Note : Pager is enabled by default. + + +* you can pass extra psql arguments inline. + +``` +odoo-openupgrade-wizard psql + --database=test_psql + --command "select id, name from res_partner where name ilike '%admin%';" + -H +``` +Result: +``` + + + + + + + + + +
idname
3Administrator
+

(1 row)
+

+ +``` + +See all the options here https://www.postgresql.org/docs/current/app-psql.html