title: Adding / Query / Parse SQLite using Anko
body: <p><strong>tl;dr:</strong> I'm having issues trying to get my code to work, now I can create the database using Anko and insert the columns but when I try to insert the data and when I open the database on sqliteman my columns are empty I also don't know how to retrieve the data in strings/Int to send to a <code>View</code></p>
  
  <p><strong>This apparently works fine</strong> I can see my database created with all the columns with the right name</p>
  
  <pre><code>class MySqlHelper(ctx: Context) : ManagedSQLiteOpenHelper(ctx, "db_main") {
  
  companion object {
      private var instance: MySqlHelper? = null
  
      @Synchronized
      fun getInstance(ctx: Context): MySqlHelper {
          if (instance == null) {
              instance = MySqlHelper(ctx.applicationContext)
          }
          return instance!!
      }
  }
  
  
  override fun onCreate(db: SQLiteDatabase) {
      db.createTable("db_main", true,
              "_id" to INTEGER + PRIMARY_KEY + AUTOINCREMENT + NOT_NULL,
              "name" to TEXT,
              "day" to INTEGER)
  
  }
  
  override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
         }
  
  // Access property for Context
  val Context.database: MySqlHelper
      get() = getInstance(applicationContext)
  
  }
  </code></pre>
  
  <p><strong>This should work but it doesn't</strong> Although I have all the columns in the database and I don't get any error messages they're not being added</p>
  
  <p>The code below is called in <code>MainActivity</code></p>
  
  <pre><code>val db = MySqlHelper(this)
  
  
  fun addtosqllite(title: String, datepicker: DatePicker) {
  
  db.use {
          insert("db_main",
                  "_id" to 1,
                  "name" to title,
                  "day" to  datepicker.dayOfMonth)
       }
  }
  </code></pre>
  
  <p><strong>I have no idea how to do this</strong> 
  I need to retrieve the data from the database. I've been Reading the documentation but I don't know how to implement <a href="https://github.com/Kotlin/anko/wiki/Anko-SQLite#querying-data" rel="nofollow noreferrer">this</a></p>
  
  <p>Let's say that I have three columns <code>_id</code>, <code>name</code> and <code>day</code>
  I was doing something like</p>
  
  <pre><code>db.select("main_db","_id","name","day").exec {
  parseSingle //something goes here to send the data to String/Int
  }
  </code></pre>