Introduced in SQLPage 0.42.0.
Returns the web root directory where SQLPage serves .sql files from.
Example
SELECT 'text' AS component;
SELECT 'SQL files are served from ' AS contents;
SELECT sqlpage.web_root() as contents, true as code;
Result
SQL files are served from /home/user/my_sqlpage_website
Notes
The web root is the directory from which .sql files are loaded and served.
By default, it is the current working directory, but it can be changed using:
- the
--web-rootcommand line argument - the
web_rootconfiguration option insqlpage.json - the
WEB_ROOTenvironment variable
This is more reliable than sqlpage.current_working_directory() when you need to reference the location of your SQL files.
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