1 # SPDX-License-Identifier: GPL-2.0-only
3 # This file is part of Nominatim. (https://nominatim.org)
5 # Copyright (C) 2022 by the Nominatim developer community.
6 # For a full list of authors see the git log.
8 Implementation of the 'freeze' subcommand.
11 from nominatim.db.connection import connect
13 # Do not repeat documentation of subcommand classes.
14 # pylint: disable=C0111
15 # Using non-top-level imports to avoid eventually unused imports.
16 # pylint: disable=E0012,C0415
20 Make database read-only.
22 About half of data in the Nominatim database is kept only to be able to
23 keep the data up-to-date with new changes made in OpenStreetMap. This
24 command drops all this data and only keeps the part needed for geocoding
27 This command has the same effect as the `--no-updates` option for imports.
36 from ..tools import freeze
38 with connect(args.config.get_libpq_dsn()) as conn:
39 freeze.drop_update_tables(conn)
40 freeze.drop_flatnode_file(args.config.get_path('FLATNODE_FILE'))