“Have you ever found it tedious to mix SQL and other languages,
or been reluctant to write the same four lines of code again to do
a simple database query? This article can help you eliminate the
drudgery involved in database access, and make your programming
time more efficient, by wrapping simple transactions in friendly
native Python syntax. By making the database emulate regular Python
objects, you can remove a source of friction and frustration from
your development process. Your time spent programming will be more
efficient and productive when you can focus on the task at hand,
without being constantly sidetracked by unimportant details like
where the cursor object is, or whether you need to escape-protect
the data in the next query.“Another benefit of using native syntax is better portability.
This approach makes it easy for you to change databases without
having to rewrite any of your application code. Simply modify a few
lines in the database wrapper, and you can support an entirely new
database. Though this article focuses on MySQL, the code should
work easily with PostgreSQL or even SQLite with only minor
modifications…”
DevX: Fast, Easy Database Access with Python
By
Get the Free Newsletter!
Subscribe to Developer Insider for top news, trends, & analysis