pyiron_base.database.manager.DatabaseManager#

class pyiron_base.database.manager.DatabaseManager(*args, **kwargs)[source]#

Bases: object

__init__()[source]#

Methods

__init__()

close_connection()

Internal function to close the connection to the database.

open_connection()

Internal function to open the connection to the database.

open_local_sqlite_connection(connection_string)

switch_to_central_database()

Switch to central database

switch_to_local_database([file_name, cwd])

Swtich to an local SQLite based database.

switch_to_user_mode()

Switch from viewer mode to user mode - if view_mode is enable pyiron has read only access to the database.

switch_to_viewer_mode()

Switch from user mode to viewer mode - if view_mode is enable pyiron has read only access to the database.

top_path(full_path)

Validated that the full_path is a sub directory of one of the pyrion environments loaded.

update()

Warning: Database interaction does not have written spec. This method does a thing. It might not be the thing

Attributes

connection_timeout

Get the connection timeout in seconds.

database

database_is_disabled

project_check_enabled

sql_connection_string

sql_table_name

sql_view_connection_string

using_local_database

close_connection() None[source]#

Internal function to close the connection to the database.

property connection_timeout: int#

Get the connection timeout in seconds. Zero means close the database after every connection.

Returns:

timeout in seconds

Return type:

int

open_connection() None[source]#

Internal function to open the connection to the database. Only after this function is called the database is accessable.

switch_to_central_database() None[source]#

Switch to central database

switch_to_local_database(file_name: str = 'pyiron.db', cwd: str | None = None) None[source]#

Swtich to an local SQLite based database.

Parameters:
  • file_name (str) – SQLite database file name

  • cwd (str/None) – directory where the SQLite database file is located in

switch_to_user_mode() None[source]#

Switch from viewer mode to user mode - if view_mode is enable pyiron has read only access to the database.

switch_to_viewer_mode() None[source]#

Switch from user mode to viewer mode - if view_mode is enable pyiron has read only access to the database.

top_path(full_path: str) str | None[source]#

Validated that the full_path is a sub directory of one of the pyrion environments loaded.

Parameters:

full_path (str) – path

Returns:

path

Return type:

str

update() None[source]#
Warning: Database interaction does not have written spec. This method does a thing. It might not be the thing

you want.