added database connection comment

This commit is contained in:
Remy Marquis 2019-01-02 22:47:15 +01:00
parent 72dffc1aad
commit 48626e4837

View file

@ -58,13 +58,15 @@ env:connect(sourcename[,username[,password]])
--------------------------------------------- ---------------------------------------------
Connects to a data source specified in sourcename using username and password if they are supplied. Connects to a data source specified in sourcename using username and password if they are supplied.
The sourcename may vary according to each driver. SQLite3 uses a simple database name. The sourcename may vary according to each driver. SQLite3 uses a simple database name::
-- get database path
local dbpath = string.gsub(et.trap_Cvar_Get("fs_homepath"), "\\", "/").."/"..et.trap_Cvar_Get("fs_game").."/"
-- connection
conn = assert(env:connect(dbpath .. "etl.db"))
.. Some use a simple database name, like PostgreSQL, MySQL and SQLite; the ODBC driver expects the name of the DSN; the Oracle driver expects the service name; See also: PostgreSQL, and MySQL extensions. .. Some use a simple database name, like PostgreSQL, MySQL and SQLite; the ODBC driver expects the name of the DSN; the Oracle driver expects the service name; See also: PostgreSQL, and MySQL extensions.
local dbpath = string.gsub(et.trap_Cvar_Get("fs_homepath"), "\\", "/").."/"..et.trap_Cvar_Get("fs_game").."/"
conn = assert(env:connect(dbpath .. "etl.db"))
Returns a `connection object <database.html#connection-objects>`__. Returns a `connection object <database.html#connection-objects>`__.
If desired, Lua scripts can also connect to the engine memory database by the following Lua command:: If desired, Lua scripts can also connect to the engine memory database by the following Lua command::