comparison env/lib/python3.9/site-packages/planemo/commands/cmd_database_delete.py @ 0:4f3585e2f14b draft default tip

"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author shellac
date Mon, 22 Mar 2021 18:12:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4f3585e2f14b
1 """Module describing the planemo ``database_create`` command."""
2
3 import click
4
5 from planemo import options
6 from planemo.cli import command_function
7 from planemo.database import create_database_source
8
9
10 @click.command('database_delete')
11 @options.database_identifier_argument()
12 @options.profile_database_options()
13 @options.docker_config_options()
14 @command_function
15 def cli(ctx, identifier, **kwds):
16 """Delete a *development* database.
17
18 Currently the only implementation is postgres which will be managed with
19 ``psql``.
20
21 Planemo ``database_`` commands make it very easy to create and destroy
22 databases, therefore it should not be used for production data - and it
23 should not even be connnected to a production database server. Planemo
24 is intended for development purposes only.
25
26 Planemo will assume that it can manage and access postgres databases
27 without specifying a password. This can be accomplished by configuring
28 postgres to not required a password for the planemo user or by specifying
29 a password in a ``.pgpass`` file.
30
31 Planemo can be configured to not require a password for the planemo user in
32 the postgres configuration file ``pg_hba.conf`` (on Ubuntu/Debian linux
33 distros this file is in /etc/postgresql/<postgres_version>/main/ directory).
34 Adding the following lines to that file will allow planemo and Galaxy to
35 access the databases without a password.
36
37 \b
38 # "local" is for Unix domain socket connections only
39 local all all trust
40 # IPv4 local connections:
41 host all all 127.0.0.1/32 trust
42 # IPv6 local connections:
43 host all all ::1/128 trust
44
45 More information on the ``pg_hda.conf`` configuration file can be found at
46 http://www.postgresql.org/docs/9.3/static/auth-pg-hba-conf.html.
47
48 Information on ``.pgpass`` files can be found at at the following location:
49 http://www.postgresql.org/docs/9.4/static/libpq-pgpass.html. In Ubuntu and
50 Debian distros - a postgres user likely already exists and its password can
51 be set by setting up a file ``~/.pgpass`` file with the following contents.
52
53 \b
54 *:*:*:postgres:<postgres_password>
55 """
56 create_database_source(**kwds).delete_database(identifier)