mendevi.database.complete.add_environment

mendevi.database.complete.add_environment(database: Cursor | str | bytes | Path) int[source]

Complete the environment table with the current environment.

Parameters

databasepathlike

The path of the existing database to be updated.

Returns

idint

The primary key of the freshly updated environment table.

Examples

>>> import os, tempfile
>>> from mendevi.database.complete import add_environment
>>> from mendevi.database.create import create_database
>>> create_database(database := tempfile.mktemp(suffix=".sqlite"))
>>> add_environment(database)
1
>>> os.remove(database)
>>>