dm_db_open Function

public function dm_db_open(db, path, create, foreign_keys, read_only, threaded, timeout, validate, wal) result(rc)

Uses

  • proc~~dm_db_open~~UsesGraph proc~dm_db_open dm_db_open module~dm_file dm_file proc~dm_db_open->module~dm_file module~dm_error dm_error module~dm_file->module~dm_error module~dm_kind dm_kind module~dm_file->module~dm_kind module~dm_error->module~dm_kind module~dm_ascii dm_ascii module~dm_error->module~dm_ascii iso_fortran_env iso_fortran_env module~dm_kind->iso_fortran_env

Opens connection to the SQLite database at path, or creates a new database with given file path if create is passed and .true.. The foreign key constraint is enabled unless foreign_keys is .false..

The databases is opened in read-only mode if read_only is .true.. Threaded access to the database is disabled by default. The busy timeout is 0 mseconds unless argument timeout is passed.

If argument validate is passed and .true., the application id of the database is validated. The function returns E_DB_ID if the id is missing or invalid.

Write-Ahead Logging is enabled if wal is .true..

The function returns the following error codes:

  • E_DB if opening the database failed.
  • E_DB_ID if the database has a wrong application id.
  • E_DB_PREPARE if statement preparation failed.
  • E_DB_STEP if step execution failed or no write permission.
  • E_DB_VERSION if the user version is incompatible.
  • E_INVALID if database is already opened.
  • E_NOT_FOUND if database has not been found.

Arguments

Type IntentOptional Attributes Name
type(db_type), intent(inout) :: db

Database type.

character(len=*), intent(in) :: path

File path of database.

logical, intent(in), optional :: create

Create flag (off by default).

logical, intent(in), optional :: foreign_keys

Foreign keys contraint flag (on by default).

logical, intent(in), optional :: read_only

Read-only mode (off by default).

logical, intent(in), optional :: threaded

Threaded access flag (off by default).

integer, intent(in), optional :: timeout

Busy timeout in mseconds (0 by default).

logical, intent(in), optional :: validate

Validate application id (off by default).

logical, intent(in), optional :: wal

WAL journal mode flag (off by default).

Return Value integer


Calls

proc~~dm_db_open~~CallsGraph proc~dm_db_open dm_db_open proc~dm_db_is_connected dm_db_is_connected proc~dm_db_open->proc~dm_db_is_connected proc~dm_db_set_application_id dm_db_set_application_id proc~dm_db_open->proc~dm_db_set_application_id proc~dm_db_set_busy_timeout dm_db_set_busy_timeout proc~dm_db_open->proc~dm_db_set_busy_timeout proc~dm_db_set_foreign_keys dm_db_set_foreign_keys proc~dm_db_open->proc~dm_db_set_foreign_keys proc~dm_db_set_journal_mode dm_db_set_journal_mode proc~dm_db_open->proc~dm_db_set_journal_mode proc~dm_db_set_user_version dm_db_set_user_version proc~dm_db_open->proc~dm_db_set_user_version proc~dm_db_validate dm_db_validate proc~dm_db_open->proc~dm_db_validate proc~dm_file_exists dm_file_exists proc~dm_db_open->proc~dm_file_exists proc~dm_is_error dm_is_error proc~dm_db_open->proc~dm_is_error sqlite3_initialize sqlite3_initialize proc~dm_db_open->sqlite3_initialize sqlite3_open_v2 sqlite3_open_v2 proc~dm_db_open->sqlite3_open_v2 interface~dm_itoa dm_itoa proc~dm_db_set_application_id->interface~dm_itoa sqlite3_finalize sqlite3_finalize proc~dm_db_set_application_id->sqlite3_finalize sqlite3_prepare_v2 sqlite3_prepare_v2 proc~dm_db_set_application_id->sqlite3_prepare_v2 sqlite3_step sqlite3_step proc~dm_db_set_application_id->sqlite3_step sqlite3_busy_timeout sqlite3_busy_timeout proc~dm_db_set_busy_timeout->sqlite3_busy_timeout proc~dm_db_set_foreign_keys->sqlite3_finalize proc~dm_db_set_foreign_keys->sqlite3_prepare_v2 proc~dm_db_set_foreign_keys->sqlite3_step proc~dm_db_set_journal_mode->sqlite3_finalize proc~dm_db_set_journal_mode->sqlite3_prepare_v2 proc~dm_db_set_journal_mode->sqlite3_step proc~dm_db_set_user_version->interface~dm_itoa proc~dm_db_set_user_version->sqlite3_finalize proc~dm_db_set_user_version->sqlite3_prepare_v2 proc~dm_db_set_user_version->sqlite3_step proc~dm_db_validate->proc~dm_is_error proc~dm_db_get_application_id dm_db_get_application_id proc~dm_db_validate->proc~dm_db_get_application_id proc~dm_db_get_user_version dm_db_get_user_version proc~dm_db_validate->proc~dm_db_get_user_version proc~dm_db_get_application_id->sqlite3_finalize proc~dm_db_get_application_id->sqlite3_prepare_v2 proc~dm_db_get_application_id->sqlite3_step sqlite3_column_int sqlite3_column_int proc~dm_db_get_application_id->sqlite3_column_int sqlite3_column_type sqlite3_column_type proc~dm_db_get_application_id->sqlite3_column_type proc~dm_db_get_user_version->sqlite3_finalize proc~dm_db_get_user_version->sqlite3_prepare_v2 proc~dm_db_get_user_version->sqlite3_step proc~dm_db_get_user_version->sqlite3_column_int proc~dm_db_get_user_version->sqlite3_column_type

Called by

proc~~dm_db_open~~CalledByGraph proc~dm_db_open dm_db_open proc~dm_db_backup dm_db_backup proc~dm_db_backup->proc~dm_db_open