Wednesday, February 25, 2009

sqlpython 1.5.3, with version control

There are several barriers to use of version control tools for Oracle DDL (Data Definition Language: table structures, etc.)
  • Tools from Oracle, Quest, etc. may have VC capabilities, but you never know whether you'll have the tool available in any particular situation, and you never know when the workings of the tools will change beyond recognition. (I'm looking at you, Oracle.)
  • The tools are separate from the mainstream of version control in software development - you're learning quirky specialty tools instead of widely-known industry standards.
  • They lack some of the modern capabilities of distributed version control.

We're better off using standard software development VC.

But, of course, those tools are meant for text files, so there needs to be a handy way to get this stuff from DDL inside the database to version-controlled text files.

It's easy with sqlpython 1.5.3


The new sqlpython commands svn, bzr, and hg all do the following:
  1. Create or update a directory tree, beginning at your current working directory, containing text files with the DDL for all the objects in your schema
  2. Put these files under version control and commit
If you don't want all the DDL, you can limit the dump using the same arguments the ls command takes.

For example,

testschema@orcl> !pwd
/home/catherine/oracle_vc
testschema@orcl> ls

NAME
--------------
INDEX/XPK_PLAY
TABLE/PLAY

2 rows selected.

testschema@orcl> bzr
added testschema
added testschema/index
added testschema/index/xpk_play.sql
added testschema/table
added testschema/table/play.sql
Committing to: /home/catherine/oracle_vc/
added testschema
added testschema/index
added testschema/table
added testschema/index/xpk_play.sql
added testschema/table/play.sql
Committed revision 1.
testschema@orcl> alter table play add (opening_night DATE);

Executed

testschema@orcl> bzr
bzr: ERROR: Already a branch: ".".
Committing to: /home/catherine/oracle_vc/
modified testschema/table/play.sql
Committed revision 2.

testschema@orcl> alter table play add (performances NUMBER(5,0));

Executed

testschema@orcl> create index xif1_play on play (opening_night);

Executed

testschema@orcl> bzr index/
bzr: ERROR: Already a branch: ".".
added testschema/index/xif1_play.sql
Committing to: /home/catherine/oracle_vc/
added testschema/index/xif1_play.sql
Committed revision 3.

Friday, February 20, 2009

"Writing about Python" at PyCon

PyCon early-bird registration deadline is TOMORROW (Saturday)! No time to lose - go register!

Most Open Spaces are not scheduled until the very day they are held, and that's good. Some are done with some advance planning, though, and that's good too. Doug Hellman is already preparing a "Writing about Python" open-space session at PyCon; I'm eager to take part.

If you're not familiar with conferences like PyCon, you may not realize that the formal schedule, goodie-packed though it is, is not the whole story by a long shot. People use the Open Spaces for a huge variety of things; last year, for instance, I got a lot out of a group organizers' freeform open space discussion, and even more out of the now-famous "Teach Me Twisted" session. If you think the published schedule leaves you in fits of indecision, wait until you see the Open Space board. There's a sort of joyful despair in seeing that you would need three months of PyCon to take part in all the PyCon you want.

Tuesday, February 17, 2009

Open Source wrecked the economy

Well, not really, but it did get your attention.

This is a really interesting New York Times article about VaR ("Value at Risk"), a mathematical tool. Over-reliance on this tool was arguably the reason the world's financial experts and geniuses spent the last several years acting like morons. This paragraph jumped out at me.
What caused VaR to catapult above the risk systems being developed by JPMorgan competitors was what the firm did next: it gave VaR away. In 1993, Guldimann made risk the theme of the firm’s annual client conference. Many of the clients were so impressed with the JPMorgan approach that they asked if they could purchase the underlying system. JPMorgan decided it didn’t want to get into that business, but proceeded instead to form a small group, RiskMetrics, that would teach the concept to anyone who wanted to learn it, while also posting it on the Internet so that other risk experts could make suggestions to improve it. As Guldimann wrote years later, “Many wondered what the bank was trying to accomplish by giving away ‘proprietary’ methodologies and lots of data, but not selling any products or services.” He continued, “It popularized a methodology and made it a market standard, and it enhanced the image of JPMorgan.”
I thought this was a fascinating summary of open-source advantages: prestige, benefiting from community-contributed enhancements, creating a standard, all without the effort and expense of attempting to market a proprietary technology.

OK, so it's not really a feather in Open Source's cap, seeing as the economy did end up wrecking over it 'n all, but it does demonstrate the power of openness to popularize a tool. Open-sourcing a tool can make it very popular, but it's up to us not to make a tool into a god.

(Of course, when it's applied outside the software world, we really ought to point out that the principle never came from software at all. It's simply openness, the same ancient innovation that happened in the move from alchemists guarding their secrets to scientists publishing their work.)

Sunday, February 01, 2009

PyCon talks

PyCon 2009: Chicago

You want an awesome badge like this for your blog, right? You can choose from a variety of badges at the publicizing PyCon site. PyCon depends on the user community (that's you) to spread the word. Bringing in a bigger and broader community is how PyCon keeps getting more exciting.

Anyway, even if you are certain you can't attend PyCon, it's worth it to browse the list of accepted PyCon talks - it's a great window into some of the exciting things going on in Python-land. It's already helped me learn about several useful packages and ideas.

Hope to see you in Chicago!