SQLite PRAGMA access functions.
Get and set the SQLite foreign keys PRAGMA value:
character(:), allocatable :: value
integer :: rc
rc = dm_db_pragma_get(db, 'foreign_keys', value)
rc = dm_db_pragma_set(db, 'foreign_keys', 'ON')
Generic PRAGMA get function.
Returns PRAGMA value as 4-byte integer.
The function returns the following error codes:
E_DB_PREPARE if statement preparation failed.E_DB_STEP if step execution failed.E_DB_TYPE if query result is of unexpected type.| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| character(len=*), | intent(in) | :: | name |
PRAGMA name. |
||
| integer(kind=i4), | intent(out) | :: | value |
PRAGMA value. |
Returns PRAGMA value as 8-byte integer.
The function returns the following error codes:
E_DB_PREPARE if statement preparation failed.E_DB_STEP if step execution failed.E_DB_TYPE if query result is of unexpected type.| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| character(len=*), | intent(in) | :: | name |
PRAGMA name. |
||
| integer(kind=i8), | intent(out) | :: | value |
PRAGMA value. |
Returns PRAGMA value as allocatable string. On error, the string is allocated but empty.
The function returns the following error codes:
E_DB_PREPARE if statement preparation failed.E_DB_STEP if step execution failed.E_DB_TYPE if query result is of unexpected type.| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| character(len=*), | intent(in) | :: | name |
PRAGMA name. |
||
| character(len=:), | intent(out), | allocatable | :: | value |
PRAGMA value. |
Generic PRAGMA set function.
Executes PRAGMA of name.
The function returns the following error codes:
E_DB_PREPARE if statement preparation failed.E_DB_STEP if step execution failed or no write permission.E_READ_ONLY if database is opened read-only.| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| character(len=*), | intent(in) | :: | name |
PRAGMA name. |
Sets PRAGMA of name to 4-byte integer value.
The function returns the following error codes:
E_DB_PREPARE if statement preparation failed.E_DB_STEP if step execution failed or no write permission.E_READ_ONLY if database is opened read-only.| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| character(len=*), | intent(in) | :: | name |
PRAGMA name. |
||
| integer(kind=i4), | intent(in) | :: | value |
PRAGMA value. |
Sets PRAGMA of name to 8-byte integer value.
The function returns the following error codes:
E_DB_PREPARE if statement preparation failed.E_DB_STEP if step execution failed or no write permission.E_READ_ONLY if database is opened read-only.| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| character(len=*), | intent(in) | :: | name |
PRAGMA name. |
||
| integer(kind=i8), | intent(in) | :: | value |
PRAGMA value. |
Sets PRAGMA of name to string value.
The function returns the following error codes:
E_DB_PREPARE if statement preparation failed.E_DB_STEP if step execution failed or no write permission.| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(db_type), | intent(inout) | :: | db |
Database type. |
||
| character(len=*), | intent(in) | :: | name |
PRAGMA name. |
||
| character(len=*), | intent(in) | :: | value |
PRAGMA value. |