Showing entries 61 to 69
« 10 Newer Entries
Displaying posts with tag: myconnpy (reset)
FOSDEM: 'Connecting MySQL and Python', handout & wrap-up

Apparently, my talk at FOSDEM 2010 about Connecting MySQL and Python was the only one about Python? There should be more, or?

I have a hand-out ready in PDF. The slides are not usable without my chatter. It contains a few examples and links. Any comments, corrections, criticism.. are welcome!

The longer version of this talk will be given at the O'Reilly MySQL Conference&Expo 2010 in Santa Clara, California (USA).

MySQL Connector/Python 0.1.3-devel available

MySQL Connector/Python v0.1.3-devel is now available for download from Launchpad.org. Please note that this is a development (i.e. alpha, unstable, ..) release and we welcome everyone to test and report problems.

Highlights for this v0.1.3-devel:

  • Important memory leak fixed when closing cursors.
  • Warnings can now be raised as exceptions.
  • Fixing unicode usage and broken error message when MySQL chops them
  • Client flags can now be set correctly when connecting
  • Conversion fixes for BIT/YEARSET and Python to DATE/DATETIME
  • Adding MySQL Client Errors and raising better exceptions based on errno.

Enjoy!

Small status on SQLAlchemy and MySQL Connector/Python

Using SQLAlchemy unit test cases to further develop MySQL Connector/Python. It's probably debatable whether that's a good method or just lame. But it sure helps lots!

We've been pushing some code past days that makes Connector/Python almost pass all tests. Well, 4% is still failing, but I'm confident that in a few most problems will be dealt with. I had to make some changes to the SQLAlchemy v0.6 dialect as well, and some test cases had to be corrected. Hopefully those corrections will also go in the SQLAlchemy trunk later on.


shell> nosetests --dburi=mysql+mysqlconnector://root:@localhost/sqlalchemy
..
----------------------------------------------------------------------
Ran 2092 tests in 314.656s

FAILED …
[Read more]
A chessboard in MySQL

Something to keep you warm during cold winter nights, or cool during hot summer days: a chessboard in MySQL!

Note: You should see chess pieces here below. If not, you're not watching it using UTF-8, or get yourself a good browser!


CREATE TABLE `chessboard` (
`x` tinyint unsigned NOT NULL,
`a` enum('','♔','♕','♖','♗','♘','♙','♚','♛','♜','♝','♞','♟'),
`b` enum('','♔','♕','♖','♗','♘','♙','♚','♛','♜','♝','♞','♟'),
`c` enum('','♔','♕','♖','♗','♘','♙','♚','♛','♜','♝','♞','♟'),
`d` enum('','♔','♕','♖','♗','♘','♙','♚','♛','♜','♝','♞','♟'),
`e` enum('','♔','♕','♖','♗','♘','♙','♚','♛','♜','♝','♞','♟'),
`f` enum('','♔','♕','♖','♗','♘','♙','♚','♛','♜','♝','♞','♟'),
`g` …
[Read more]
Using character sets with MySQL Connector/Python

Here is two small examples showing the wonderful world of character sets and unicode using MySQL Connector/Python (using 0.1.2-devel and up) in both Python v2.x and v3.1.

The following table will be used with default character set latin7, i.e. ISO-8859-13. Just setting it to UTF-8 would be bit boring!


CREATE TABLE `latin7test` (
`c1` varchar(60) DEFAULT NULL
) DEFAULT CHARSET=latin7

Things to note for the code listed below are:

  • We're using charset='latin7' as connection option. This is important!
  • We set use_unicode=True so the results coming from MySQL are encoded to unicode. For testing, we disable this later.
[Read more]
MySQL Connector/Python 0.1.2-devel available!

MySQL Connector/Python 0.1.2-devel is a quick follow-up release for 0.1.1 fixing a few problems around character sets and unicode.

You can download Connector/Python from LaunchPad.

Release notes for MySQL Connector/Python 0.1.2-devel


o Fixing unicode usage for both Python 2.4+ and 3.1
* Setting 'use_unicode' at connection time is now
working.
* conversion.py: removing regular expression for
quoting backslashes.
* Adding test case for bug lp:499410

Py3k specific:
* Strings from MySQL are decoded to the given character
when use_unicode is false
* The statement is encoded just before sending it to the
MySQL server. Internally, all is done in unicode. …
[Read more]
MySQL with Python v3.1 now also possible using MySQL Connector/Python

The second development release of MySQL Connector/Python comes with support for Python v3.1!

I thought of making two distributions of MySQL Connector/Python, but then it would have been messy with versions and packaging. So what you get now is 2-in-1 and the installation script should be smart enough to figure it out.

Please, if you find any issues, bugs or have suggestions: report them here https://bugs.launchpad.net/myconnpy

Download

From LaunchPad!

Release notes


Added Python v3.1 support
* The subdirectory/module py3k/ contains Connector/Python compatible
with Python v3.1.1.
* setup.py will install the correct Connector/Python distribution
depending on …
[Read more]
MySQL Connector/Python 0.1.0-devel: first development snapshot

Today we're releasing MySQL Connector/Python 0.1.0-devel. This is the first in a serie of development snapshots aimed to get more people trying it out and reporting problems. This is not a production-ready release, but it should work on all Unices and Windows which has Python 2.4 or later installed. (No, no Py3K, yet!)

You can download it from Launchpad: there is a .tar.gz and .zip

There will be documentation and tutorial, but installation is as easy as pie (pun intended):


shell> tar xzf mysql-connector-python-0.1.0-devel.tar.gz
shell> cd mysql-connector-python-0.1.0-devel
shell> python ./setup.py install

If you …

[Read more]
Readying first alpha release, but where to install MySQL Connector/Python?

I'm currently planning a first 'alpha' release of MySQL Connector/Python, but I'm now doubting whether the naming and installation of the module is actually good.

Currently, the module lives, in site-packages/mysql/connector/, or import mysql.connector. Since this is an official MySQL, sorry, Sun Microsystems, project, I thought that the 'parent' module mysql would be good enough.

But is it? Would it break your modules with the same name?

The idea was to make more tools for Python and have them all under the mysql module, but maybe we need a smarter name for this? Maybe sunmysql/connector?

Comments are welcome! You can also email me directly (if you can figure out the cryptic anti-spam): geert_dot_vanderkelen_APETAIL_sun_dot_com.

Showing entries 61 to 69
« 10 Newer Entries