mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-15 19:31:54 +08:00
Documentation updates.
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
prune CVS
|
prune CVS
|
||||||
recursive-include doc *.txt *.html
|
recursive-include doc *.txt *.html *.css
|
||||||
include MANIFEST.in
|
include MANIFEST.in
|
||||||
include MANIFEST
|
include MANIFEST
|
||||||
include ChangeLog
|
include ChangeLog
|
||||||
|
@ -46,33 +46,65 @@ class Connection(_mysql.connection):
|
|||||||
that you only use keyword parameters. Consult the MySQL C API
|
that you only use keyword parameters. Consult the MySQL C API
|
||||||
documentation for more information.
|
documentation for more information.
|
||||||
|
|
||||||
host -- string, host to connect
|
host
|
||||||
user -- string, user to connect as
|
string, host to connect
|
||||||
passwd -- string, password to use
|
|
||||||
db -- string, database to use
|
user
|
||||||
port -- integer, TCP/IP port to connect to
|
string, user to connect as
|
||||||
unix_socket -- string, location of unix_socket to use
|
|
||||||
conv -- conversion dictionary, see MySQLdb.converters
|
passwd
|
||||||
connect_time -- number of seconds to wait before the connection
|
string, password to use
|
||||||
attempt fails.
|
|
||||||
compress -- if set, compression is enabled
|
db
|
||||||
named_pipe -- if set, a named pipe is used to connect (Windows only)
|
string, database to use
|
||||||
init_command -- command which is run once the connection is created
|
|
||||||
read_default_file -- file from which default client values are read
|
port
|
||||||
read_default_group -- configuration group to use from the default file
|
integer, TCP/IP port to connect to
|
||||||
cursorclass -- class object, used to create cursors (keyword only)
|
|
||||||
use_unicode -- If True, text-like columns are returned as
|
unix_socket
|
||||||
unicode objects using the connection's character set.
|
string, location of unix_socket to use
|
||||||
Otherwise, text-like columns are returned as strings.
|
|
||||||
columns are returned as normal strings. Unicode objects
|
conv
|
||||||
will always be encoded to the connection's character set
|
conversion dictionary, see MySQLdb.converters
|
||||||
regardless of this setting.
|
|
||||||
client_flag -- integer, flags to use or 0
|
connect_time
|
||||||
(see MySQL docs or constants/CLIENTS.py)
|
number of seconds to wait before the connection attempt
|
||||||
ssl -- dictionary or mapping, contains SSL connection parameters; see
|
fails.
|
||||||
the MySQL documentation for more details (mysql_ssl_set()).
|
|
||||||
If this is set, and the client does not support SSL,
|
compress
|
||||||
UnsupportedError will be raised.
|
if set, compression is enabled
|
||||||
|
|
||||||
|
named_pipe
|
||||||
|
if set, a named pipe is used to connect (Windows only)
|
||||||
|
|
||||||
|
init_command
|
||||||
|
command which is run once the connection is created
|
||||||
|
|
||||||
|
read_default_file
|
||||||
|
file from which default client values are read
|
||||||
|
|
||||||
|
read_default_group
|
||||||
|
configuration group to use from the default file
|
||||||
|
|
||||||
|
cursorclass
|
||||||
|
class object, used to create cursors (keyword only)
|
||||||
|
|
||||||
|
use_unicode
|
||||||
|
If True, text-like columns are returned as unicode objects
|
||||||
|
using the connection's character set. Otherwise, text-like
|
||||||
|
columns are returned as strings. columns are returned as
|
||||||
|
normal strings. Unicode objects will always be encoded to
|
||||||
|
the connection's character set regardless of this setting.
|
||||||
|
|
||||||
|
client_flag
|
||||||
|
integer, flags to use or 0
|
||||||
|
(see MySQL docs or constants/CLIENTS.py)
|
||||||
|
|
||||||
|
ssl
|
||||||
|
dictionary or mapping, contains SSL connection parameters;
|
||||||
|
see the MySQL documentation for more details
|
||||||
|
(mysql_ssl_set()). If this is set, and the client does not
|
||||||
|
support SSL, UnsupportedError will be raised.
|
||||||
|
|
||||||
There are a number of undocumented, non-standard methods. See the
|
There are a number of undocumented, non-standard methods. See the
|
||||||
documentation for the MySQL C API for some hints on what they do.
|
documentation for the MySQL C API for some hints on what they do.
|
||||||
|
@ -6,18 +6,25 @@ dictionary conversions maps some kind of type to a conversion function
|
|||||||
which returns the corresponding value:
|
which returns the corresponding value:
|
||||||
|
|
||||||
Key: FIELD_TYPE.* (from MySQLdb.constants)
|
Key: FIELD_TYPE.* (from MySQLdb.constants)
|
||||||
|
|
||||||
Conversion function:
|
Conversion function:
|
||||||
Arguments: string
|
|
||||||
Returns: Python object
|
Arguments: string
|
||||||
|
|
||||||
|
Returns: Python object
|
||||||
|
|
||||||
Key: Python type object (from types) or class
|
Key: Python type object (from types) or class
|
||||||
|
|
||||||
Conversion function:
|
Conversion function:
|
||||||
Arguments: Python object of indicated type or class AND
|
|
||||||
conversion dictionary
|
Arguments: Python object of indicated type or class AND
|
||||||
Returns: SQL literal value
|
conversion dictionary
|
||||||
Notes: Most conversion functions can ignore the dictionary, but
|
|
||||||
it is a required parameter. It is necessary for converting
|
Returns: SQL literal value
|
||||||
things like sequences and instances.
|
|
||||||
|
Notes: Most conversion functions can ignore the dictionary, but
|
||||||
|
it is a required parameter. It is necessary for converting
|
||||||
|
things like sequences and instances.
|
||||||
|
|
||||||
Don't modify conversions if you can avoid it. Instead, make copies
|
Don't modify conversions if you can avoid it. Instead, make copies
|
||||||
(with the copy() method), modify the copies, and then pass them to
|
(with the copy() method), modify the copies, and then pass them to
|
||||||
|
@ -540,21 +540,46 @@ static char _mysql_connect__doc__[] =
|
|||||||
keyword parameters strongly recommended. Consult the\n\
|
keyword parameters strongly recommended. Consult the\n\
|
||||||
MySQL C API documentation for more details.\n\
|
MySQL C API documentation for more details.\n\
|
||||||
\n\
|
\n\
|
||||||
host -- string, host to connect\n\
|
host\n\
|
||||||
user -- string, user to connect as\n\
|
string, host to connect\n\
|
||||||
passwd -- string, password to use\n\
|
\n\
|
||||||
db -- string, database to use\n\
|
user\n\
|
||||||
port -- integer, TCP/IP port to connect to\n\
|
string, user to connect as\n\
|
||||||
unix_socket -- string, location of unix_socket (UNIX-ish only)\n\
|
\n\
|
||||||
conv -- mapping, maps MySQL FIELD_TYPE.* to Python functions which\n\
|
passwd\n\
|
||||||
convert a string to the appropriate Python type\n\
|
string, password to use\n\
|
||||||
connect_timeout -- number of seconds to wait before the connection\n\
|
\n\
|
||||||
attempt fails.\n\
|
db\n\
|
||||||
compress -- if set, gzip compression is enabled\n\
|
string, database to use\n\
|
||||||
named_pipe -- if set, connect to server via named pipe (Windows only)\n\
|
\n\
|
||||||
init_command -- command which is run once the connection is created\n\
|
port\n\
|
||||||
read_default_file -- see the MySQL documentation for mysql_options()\n\
|
integer, TCP/IP port to connect to\n\
|
||||||
read_default_group -- see the MySQL documentation for mysql_options()\n\
|
\n\
|
||||||
|
unix_socket\n\
|
||||||
|
string, location of unix_socket (UNIX-ish only)\n\
|
||||||
|
\n\
|
||||||
|
conv\n\
|
||||||
|
mapping, maps MySQL FIELD_TYPE.* to Python functions which\n\
|
||||||
|
convert a string to the appropriate Python type\n\
|
||||||
|
\n\
|
||||||
|
connect_timeout\n\
|
||||||
|
number of seconds to wait before the connection\n\
|
||||||
|
attempt fails.\n\
|
||||||
|
\n\
|
||||||
|
compress\n\
|
||||||
|
if set, gzip compression is enabled\n\
|
||||||
|
\n\
|
||||||
|
named_pipe\n\
|
||||||
|
if set, connect to server via named pipe (Windows only)\n\
|
||||||
|
\n\
|
||||||
|
init_command\n\
|
||||||
|
command which is run once the connection is created\n\
|
||||||
|
\n\
|
||||||
|
read_default_file\n\
|
||||||
|
see the MySQL documentation for mysql_options()\n\
|
||||||
|
\n\
|
||||||
|
read_default_group\n\
|
||||||
|
see the MySQL documentation for mysql_options()\n\
|
||||||
";
|
";
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
@ -801,7 +826,7 @@ _mysql_ConnectionObject_set_server_option(
|
|||||||
static char _mysql_ConnectionObject_sqlstate__doc__[] =
|
static char _mysql_ConnectionObject_sqlstate__doc__[] =
|
||||||
"Returns a string containing the SQLSTATE error code\n\
|
"Returns a string containing the SQLSTATE error code\n\
|
||||||
for the last error. The error code consists of five characters.\n\
|
for the last error. The error code consists of five characters.\n\
|
||||||
'00000' means ``no error.'' The values are specified by ANSI SQL\n\
|
'00000' means \"no error.\" The values are specified by ANSI SQL\n\
|
||||||
and ODBC. For a list of possible values, see section 23\n\
|
and ODBC. For a list of possible values, see section 23\n\
|
||||||
Error Handling in MySQL in the MySQL Manual.\n\
|
Error Handling in MySQL in the MySQL Manual.\n\
|
||||||
\n\
|
\n\
|
||||||
|
Reference in New Issue
Block a user