{

I've been quiet but still working on Twining.  Unfortunately lots of distractions at work have slowed me down. Most of what I've done of late is adding unit tests for the functionality that already exists.  I twittered that adding unit tests a posteriori is not fun and tends to have the effect of one simply verifying what they've done with pasted code.   Now that most of that is done I'd like to add a few things:

1. Operating on queries like tables for export and copy.  Everywhere that you see "table" below, I'd like to have "query":

database(cn).table("MyTable").transform(mytrans).copyto.database(cn2)
database(cn).table("MyTable").transform(mytrans).copyto.xmlFieldsAsAttributes("c:\\here.xml")
database(cn).table("MyTable").transform(mytrans).copyto.xmlFieldsAsElements("c:\\there.xml")
database(cn).table("MyTable").transform(mytrans).copyto.delimited("\t", "c:\\foaf.tsv")
database(cn).table("MyTable").copyto.delimited("\t", "c:\\foaf_no_trans.tsv")
database(cn).table("MyTable").transform(mytrans).copyto.csv("c:\\foo.csv")
database(cn).table("MyTable").copyto.xmlFieldsAsAttributes("c:\\here.xml")
database(cn).table("MyTable").copyto.xmlFieldsAsElements("c:\\there.xml")
how about: 
database(cn).query("select this, that, [the other] from foo").copyto.csv("c:\\querydata.csv")





2. Support for SqlBulkCopy - as far as I know this is only available between Sql Servers (or, more specifically SqlConnection instances).


3. Cloning of tables - if you use sql server, this is quite simple with the following TSQL:

SELECT * INTO MYCOPYTABLE FROM MYORIGINALTABLE WHERE 1 = 2



4. Database "ping" - just a simple way to test connection strings.

cn = "my connection string"
database(cn).ping()

5. Inspired by ConfigObj I'm wondering what a JSON like table definition would look like. In ConfigObj, you can define things like:

section2 = {
'keyword5': 'value5',
'keyword6': 'value6',
'sub-section': {
'keyword7': 'value7'
}
}

I wonder if one could have the following for a table:

tableDef = {
'personid': {
'datatype':'int',
'identity':'true',
'seed':1
},
'firstname':['varchar',50, 'null']
}


Just something to gnaw on...

 


I'll hopefully get a chance to work on this stuff soon.


}