Command-line interface#
Database initialization utilities#
swh db init#
Initialize a database for the Software Heritage <module>.
The database connection string comes from the configuration file (see
option --config-file
in swh db --help
) in the section named after
the MODULE argument.
Example:
$ cat conf.yml
storage:
cls: postgresql
db: postgresql://user:passwd@pghost:5433/swh-storage
objstorage:
cls: memory
$ swh db -C conf.yml init storage # or
$ SWH_CONFIG_FILENAME=conf.yml swh db init storage
Note that the connection string can also be passed directly using the ‘–db-name’ option, but this usage is about to be deprecated.
swh db init [OPTIONS] MODULE
Options
- -d, --dbname, --db-name <dbname>#
Database name or connection URI.
- --flavor <flavor>#
Database flavor.
- --initial-version <initial_version>#
Database initial version.
- Default:
1
Arguments
- MODULE#
Required argument
swh db-init#
Initialize a database for the Software Heritage <module>.
The database connection string comes from the configuration file (see
option --config-file
in swh db --help
) in the section named after
the MODULE argument.
Example:
$ cat conf.yml
storage:
cls: postgresql
db: postgresql://user:passwd@pghost:5433/swh-storage
objstorage:
cls: memory
$ swh db -C conf.yml init storage # or
$ SWH_CONFIG_FILENAME=conf.yml swh db init storage
Note that the connection string can also be passed directly using the ‘–db-name’ option, but this usage is about to be deprecated.
swh db-init [OPTIONS] MODULE
Options
- -d, --dbname, --db-name <dbname>#
Database name or connection URI.
- --flavor <flavor>#
Database flavor.
- --initial-version <initial_version>#
Database initial version.
- Default:
1
Arguments
- MODULE#
Required argument