Introduced in SQLPage 0.42.0.
Returns the configuration directory where SQLPage looks for sqlpage.json, templates, and migrations.
Example
SELECT 'text' AS component;
SELECT 'Configuration files are in ' AS contents;
SELECT sqlpage.configuration_directory() as contents, true as code;
Result
Configuration files are in /home/user/my_sqlpage_website/sqlpage
Notes
The configuration directory is where SQLPage looks for:
sqlpage.json(the configuration file)templates/(custom component templates)migrations/(database migration files)
By default, it is ./sqlpage relative to the current working directory, but it can be changed using:
- the
--config-dircommand line argument - the
SQLPAGE_CONFIGURATION_DIRECTORYorCONFIGURATION_DIRECTORYenvironment variable
This function is useful when you need to reference configuration-related files in your SQL code.
basic_auth_password
basic_auth_username
client_ip
configuration_directory
cookie
current_working_directory
environment_variable
exec
fetch
fetch_with_meta
hash_password
header
headers
hmac
link
oidc_logout_url
path
persist_uploaded_file
protocol
random_string
read_file_as_data_url
read_file_as_text
request_body
request_body_base64
request_method
run_sql
set_variable
uploaded_file_mime_type
uploaded_file_name
uploaded_file_path
url_encode
user_info
user_info_token
variables
version
web_root