       #{lines.join(',\n  ')};
     """
 
+
 isEmpty = (str) -> str == ''
 nonEmpty = (str) -> str != ''
 dropEmptyLine = (xs) -> _.dropWhile(xs, isEmpty)


Changer = React.createClass
  getInitialState: ->
    csv: ''
    sql: ''
    now: ''


    </form>


convertCell = (cell) ->
  cell = cell.trim()
  if cell.length > 0 and (cell[0] not in ['"', "'"]) and isNaN(cell)
    '"' + cell + '"'
  else
    cell

class Table
  constructor: (@lines) ->
    @name = @lines[0]
    @columns = @lines[1].split(',')
    @records = @lines.slice(2).map (l) ->
       l.split(',').map(convertCell)

  # nullable
  toSQL: (mani) ->
    switch mani
      when 'INSERT' then @createInsert()
      when 'DELETE' then @createDelete()
      when 'UPSERT' then @createUpsert()
      else null
