Merge into a database

Added by iNTERFACEWARE

Use conn:merge{} to merge data into a database

Source Code
   -- connect to a SQLite database
   conn = db.connect{
      api = db.SQLITE,
      name = 'test',
      live = true
   }   
   
   -- Create the database tables target node tree
   local Out       = db.tables{vmd = 'example/demo.vmd', name = 'ADT'}
   
   -- use test data (normally mapped from HL7 or other source)
   Out.patient[1].Id        = 1
   Out.patient[1].LastName  = 'Smith'
   Out.patient[1].GivenName = 'Fred'
      
   -- merge data into a database table
   conn:merge{data=Out, live = true}