From 949eded3bf0f71f38ec00597a2b51dedd4f49d01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alja=C5=BE=20Mur=20Er=C5=BEen?= Date: Tue, 17 Dec 2024 13:32:47 +0100 Subject: [PATCH] fix --- docs/reference/sql_adapter.rst | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/docs/reference/sql_adapter.rst b/docs/reference/sql_adapter.rst index 6a9ae65e805..a73fac2721c 100644 --- a/docs/reference/sql_adapter.rst +++ b/docs/reference/sql_adapter.rst @@ -366,17 +366,29 @@ SQL adapter supports most of PostgreSQL connection settings In addition, there are the following EdgeDB-specific settings: - settings prefixed with ``"global "`` set the values of globals. + Because SQL syntax allows only string, integer and float constants in ``SET`` command, globals of other types such as ``datetime`` cannot be set - this way. Special handling is in place to enable setting UUID globals via - hex-encoded strings. To set globals of other types via SQL, it is - recommended to change the global to use one of the simple types instead, - and use appropriate casts where the global is used. - + this way. + + .. code-block:: sql + + SET "global my_module::hello" TO 'world'; + + Special handling is in place to enable setting: + - ``bool`` types via integers 0 or 1), + - ``uuid`` types via hex-encoded strings. + .. code-block:: sql SET "global my_module::current_user_id" TO "592c62c6-73dd-4b7b-87ba-46e6d34ec171"; + SET "global my_module::is_admin" TO 1; + + To set globals of other types via SQL, it is recommended to change the + global to use one of the simple types instead, and use appropriate casts + where the global is used. + - ``allow_user_specified_id`` (default ``false``),