mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-16 03:50:43 +08:00
Rip out _mysql.field_*() methods, as MySQL recommends using SQL
instead. See C API docs.
This commit is contained in:
@ -103,10 +103,6 @@ class Connection:
|
||||
def get_server_info(self): return self._db.get_server_info()
|
||||
def info(self): return self._db.info()
|
||||
def kill(self, p): return self._db.kill(p)
|
||||
def list_dbs(self): return self._db.list_dbs().fetch_row(0)
|
||||
def list_fields(self, table): return self._db.list_fields(table).fetch_row(0)
|
||||
def list_processes(self): return self._db.list_processes().fetch_row(0)
|
||||
def list_tables(self, db): return self._db.list_tables(db).fetch_row(0)
|
||||
def field_count(self): return self._db.field_count()
|
||||
num_fields = field_count # used prior to MySQL-3.22.24
|
||||
def ping(self): return self._db.ping()
|
||||
|
@ -976,77 +976,6 @@ _mysql_ConnectionObject_kill(
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
_mysql_ConnectionObject_list_dbs(
|
||||
_mysql_ConnectionObject *self,
|
||||
PyObject *args)
|
||||
{
|
||||
MYSQL_RES *result;
|
||||
char *wild = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|s:list_dbs", &wild)) return NULL;
|
||||
check_connection(self);
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
result = mysql_list_dbs(&(self->connection), wild);
|
||||
Py_END_ALLOW_THREADS
|
||||
if (!result) return _mysql_Exception(self);
|
||||
return (PyObject *) _mysql_ResultObject_New(self, result, 0,
|
||||
self->converter);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
_mysql_ConnectionObject_list_fields(
|
||||
_mysql_ConnectionObject *self,
|
||||
PyObject *args)
|
||||
{
|
||||
MYSQL_RES *result;
|
||||
char *wild = NULL, *table;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "s|s:list_fields", &table, &wild)) return NULL;
|
||||
check_connection(self);
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
result = mysql_list_fields(&(self->connection), table, wild);
|
||||
Py_END_ALLOW_THREADS
|
||||
if (!result) return _mysql_Exception(self);
|
||||
return (PyObject *) _mysql_ResultObject_New(self, result, 0,
|
||||
self->converter);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
_mysql_ConnectionObject_list_processes(
|
||||
_mysql_ConnectionObject *self,
|
||||
PyObject *args)
|
||||
{
|
||||
MYSQL_RES *result;
|
||||
|
||||
if (!PyArg_NoArgs(args)) return NULL;
|
||||
check_connection(self);
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
result = mysql_list_processes(&(self->connection));
|
||||
Py_END_ALLOW_THREADS
|
||||
if (!result) return _mysql_Exception(self);
|
||||
return (PyObject *) _mysql_ResultObject_New(self, result, 0,
|
||||
self->converter);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
_mysql_ConnectionObject_list_tables(
|
||||
_mysql_ConnectionObject *self,
|
||||
PyObject *args)
|
||||
{
|
||||
MYSQL_RES *result;
|
||||
char *wild = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|s:list_tables", &wild)) return NULL;
|
||||
check_connection(self);
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
result = mysql_list_tables(&(self->connection), wild);
|
||||
Py_END_ALLOW_THREADS
|
||||
if (!result) return _mysql_Exception(self);
|
||||
return (PyObject *) _mysql_ResultObject_New(self, result, 0,
|
||||
self->converter);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
_mysql_ConnectionObject_field_count(
|
||||
_mysql_ConnectionObject *self,
|
||||
@ -1332,10 +1261,6 @@ static PyMethodDef _mysql_ConnectionObject_methods[] = {
|
||||
{"info", (PyCFunction)_mysql_ConnectionObject_info, 0},
|
||||
{"insert_id", (PyCFunction)_mysql_ConnectionObject_insert_id, 0},
|
||||
{"kill", (PyCFunction)_mysql_ConnectionObject_kill, 1},
|
||||
{"list_dbs", (PyCFunction)_mysql_ConnectionObject_list_dbs, 1},
|
||||
{"list_fields", (PyCFunction)_mysql_ConnectionObject_list_fields, 1},
|
||||
{"list_processes", (PyCFunction)_mysql_ConnectionObject_list_processes, 0},
|
||||
{"list_tables", (PyCFunction)_mysql_ConnectionObject_list_tables, 1},
|
||||
{"ping", (PyCFunction)_mysql_ConnectionObject_ping, 0},
|
||||
{"query", (PyCFunction)_mysql_ConnectionObject_query, 1},
|
||||
{"select_db", (PyCFunction)_mysql_ConnectionObject_select_db, 1},
|
||||
|
@ -170,10 +170,6 @@ object methods. Their use is non-portable.
|
||||
@ <tt>mysql_get_server_info()</tt> | <tt>conn.get_server_info()</tt>
|
||||
@ <tt>mysql_info()</tt> | <tt>conn.info()</tt>
|
||||
@ <tt>mysql_insert_id()</tt> | <tt>conn.insert_id()</tt>
|
||||
@ <tt>mysql_list_dbs()</tt> | <tt>conn.list_dbs()</tt>
|
||||
@ <tt>mysql_list_fields()</tt> | <tt>conn.list_fields()</tt>
|
||||
@ <tt>mysql_list_processes()</tt> | <tt>conn.list_processes()</tt>
|
||||
@ <tt>mysql_list_tables()</tt> | <tt>conn.list_tables()</tt>
|
||||
@ <tt>mysql_num_fields()</tt> | <tt>result.num_fields()</tt>
|
||||
@ <tt>mysql_num_rows()</tt> | <tt>result.num_rows()</tt>
|
||||
@ <tt>mysql_options()</tt> | <tt>_mysql.connect()</tt>
|
||||
|
@ -75,7 +75,7 @@ MySQLdb. MySQLdb is free software.
|
||||
|
||||
setup (# Distribution meta-data
|
||||
name = "MySQL-python",
|
||||
version = "0.9.0c1",
|
||||
version = "0.9.0c2",
|
||||
description = "An interface to MySQL",
|
||||
long_description=long_description,
|
||||
author = "Andy Dustman",
|
||||
|
Reference in New Issue
Block a user