mysql docs

This commit is contained in:
udo
2022-01-20 22:42:51 +00:00
parent 20faabc43d
commit 5f3ae65b17
13 changed files with 120 additions and 11 deletions
+5
View File
@@ -0,0 +1,5 @@
Sessions
make_session_id
session_destroy
session_start
+1 -1
View File
@@ -8,4 +8,4 @@ return value : a new session ID
Creates a session ID
:see
>uri
>session
+14 -1
View File
@@ -1 +1,14 @@
(not documented yet)
:sig
MySQL* mysql_connect(String host = "localhost", String username = "root", String password = "")
:params
host : host name of the MySQL server
username : user name
password : password
return value : pointer to the MySQL connection struct
:desc
Establishes a connection to a MySQL server.
:see
>mysql
+11 -1
View File
@@ -1 +1,11 @@
(not documented yet)
:sig
void mysql_disconnect(MySQL* m)
:params
m : pointer to an existing MySQL connection struct
:desc
Closes a connection to a MySQL server.
:see
>mysql
+12 -1
View File
@@ -1 +1,12 @@
(not documented yet)
:sig
String mysql_error(MySQL* m)
:params
m : pointer to a MySQL connection struct
return value : MySQL error message (if present, otherwise empty string)
:desc
Returns the last error message from a connection to a MySQL server.
:see
>mysql
+13 -1
View File
@@ -1 +1,13 @@
(not documented yet)
:sig
String mysql_escape(String raw, char quote_char)
:params
raw : the string to be escaped
quote_char : the character that should be used to wrap the string (pass NULL for no wrapping)
return value : the safe version of the 'raw' string
:desc
Escapes a string such that it can be passed as a safe value into an SQL expression.
:see
>mysql
+12 -1
View File
@@ -1 +1,12 @@
(not documented yet)
:sig
u64 mysql_insert_id(MySQL* m)
:params
m : pointer to an active MySQL connection
return value : the last used automatic row ID
:desc
This retrieves the last row ID that was used for a column with an AUTO_INCREMENT row key.
:see
>mysql
+17 -1
View File
@@ -1 +1,17 @@
(not documented yet)
:sig
DTree mysql_query(MySQL* m, String q, StringMap params)
:params
m : pointer to an active MySQL connection struct
q : a string containing a MySQL query
params : optional, a list of query parameter keys and values
return value : a list of rows returned from executing the query
:desc
Executes a MySQL query and returns the resulting data (if any).
:Examples
(tbd)
:see
>mysql
+11
View File
@@ -0,0 +1,11 @@
:sig
void session_destroy(String session_name)
:params
session_name : the name of the session
:desc
Deletes the cookie specified by 'session_name' and clears the data stored under the session ID. This empties the 'context->session_id' and 'context->session' variables.
:see
>session
+17
View File
@@ -0,0 +1,17 @@
:sig
String session_start(String session_name)
:params
return value : the session ID, defaults to "uce-session"
:desc
Starts session or connects to existing session. This function sets a cookie with the name contained in 'session_name' if it does not exist and fills that cookie with a new unique session ID. It then loads the session data for that session ID. Afterwards, the following fields are populated in the 'context' variable:
context->session_id : the current session ID
context->session_name : the current session cookie name
context->session : the current session data. The session data is automatically saved after a request completes.
:see
>session