title: SQLite singleton class in Swift ( FMDB wrapper )
body: <p>I am working on <code>Swift</code> singleton class to integrate <code>SQLite</code> easily ( Using FMDB wrapper class )</p>
  
  <p>Simple methods to create database in directory, insert and fetch data.</p>
  
  <p>Bridging support for FMDB Objective C usage in Swift.</p>
  
  <pre><code>let contactDB = FMDatabase(path: String(methodToCreateDatabase()!.absoluteString) )
  
  if contactDB.open() {
  
      let insertSQL = strQuery
  
      let result = contactDB.executeUpdate(insertSQL,
                  withArgumentsInArray: nil)
  
      if !result {
                  print("Failed to add contact")
                  print("Error: \(contactDB.lastErrorMessage())")
          return false
      } else {
          print("Contact Added")
                  return true
      }
  } else {
       print("Error: \(contactDB.lastErrorMessage())")
       return false
  }
  </code></pre>