My personal highlight of this new MySQL version? The fact that it is released by Oracle.
Since version 0.3.0 is still a development release, or ‘alpha’,
it is not
recommended to run this in production.
MySQL Connector/Python 0.3.0 adds following features:
This blog post shows how to create a cursor class for MySQL Connector/Python which will allow you to cache queries. It will hold the query itself and the result in a global variable.
Note: this is a proof of concept and is only meant as a demonstration on how to extend MySQL Connector/Python.
Why query caching?
You are doing lots of queries that have the same result. It would be expensive to always run the same exact query. MySQL has already a query cache, and there is also …[Read more...]
MySQL Connector/Python doesn’t buffer results by default. This means you have to fetch the rows when you issued a SELECT. This post describes how you can change this behavior.
Why buffering result sets?
Buffering or storing the result set on the client side is handy when you, for example, would like to use multiple cursors per connection and you’de like to traverse each one interleaved.
Keep in mind that with bigger result sets, the client side will use more memory. You just need to find out for yourself what’s best. When you know result sets are mostly small, you might opt to buffer.
Six months ago, right around the O'Reilly MySQL Conference, my
previous employer, Gear6, suffered from "unfortunate cash flow
event". That is, they ran out of money faster than their sales
grew. Which is too bad, it was a good company with good and
useful products, and it was staffed with good people. I
appreciate the honest and ethical dealings of the board and the
executive staff, who kept the we the staff "in the light" as the
situation developed, and did things like paying out the
accumulated vacation time and such. No bounced paychecks, unpaid
expense reports, or surprise locked doors.
I spent the time working on …
Problem: you want to fetch rows from the database and return them as a dictionary with keys being the column names.
First, lets check how you would do it without any custom cursor.
cnx = mysql.connector.connect(host='localhost',database='test') cur = cnx.cursor() cur.execute("SELECT c1, c2 FROM t1") result =  columns = tuple( [d.decode('utf8') for d in cur.description] ) for …[Read more...]
Bug reports and feature requests are welcome through the Launchpad bug tracking tool.
Scribd is a top 100 site on the web and one of the largest sites built using Ruby on Rails. As one of the first rails sites to reach scale, we’ve built a lot of infrastructure and solved a lot of challenges to get Scribd to where it is today. We actively try to push the envelope and have contributed substantial work back to the open source community.
Scribd has an agile, startup culture and an unusually close working relationship between engineering and ops. You’ll regularly find cross-over work at Scribd, with ops people writing …[Read more...]
My wife – a good web designer with 6 years of experience with web design, HTML and CSS is looking for a job. Here is some information about her:
We’re physically located in Toronto, Canada, but she has a …[Read more...]