| Projects on Google Code | Results 1 - 5 of 5 |
===把拼接sql语句条件当作模板替换. 用于MySQLdb. *非orm*.===
===例子:===
{{{
>>> from dynsql import DySql
>>>
>>> s = DynSql(""" c1= $c1 { AND c2 IN $$c2 { AND c3=$c3}} { AND c4 > $c4 }""")
>>>
>>> print s({"c1": 1, "c2": (1, 2), "c3": "somecond"})
('c1= %s AND c2 IN (%s, %s) AND c3=%s ', [1, 1, 2, 'somecond...
"""A class to access MySQLdb's table.
used:
from mySQL import MyTable
s = MyTable( _host='192.168.1.10', _user='test', _table='test.test', age=30 ) # this will execute "select * from test.test where age=30;"
or define a new class to use simple:
class test(MyTable):
def __init__( *...
使用python+MySQLdb,通过命令行操作不同数据库。
= 优点 =
* 简单地在不同机器不同数据库之间切换;
* 通过配置文件来设定各个数据库连接,一次更新,次次使用;
* 提供的多种查询计算模式,可在一个命令行中访问mysql或kdb+,或使用python命令。
= 缺点 =
* 原程序不支持方向键,可使用rlwrap来运行程序,可解决这个问题;
* 不能使用tab自动补全。
使用及配置方式:见wiki
== Description ==
gSqlClient is a Python plugin for Gedit that turns it into a lightweight MySQL client, it allows to query MySQL databases from Gedit, you can examine queries resultsets on a grid, run any SQL file as a script or export resultsets as XML or CSV formats taking advantage of Gedit as ...
PySQLPool is at the heart a MySQL Connection Pooling library for use with the MySQLDB Python bindings.
Part of the PySQLPool is the MySQL Query class that handles all the thread safe connection locking, connection management in association with the Connection Manager, and cursor management. Leav...