   var request = Google_Datastore_V1_RunQueryRequest()
   request.projectID = projectID
   var query = Google_Datastore_V1_GqlQuery()
-  query.queryString = "select *"
+  query.queryString = "select * from Thing"
   request.gqlQuery = query
   let result = try service.runquery(request)
-  print("\(result)")
+  var entities : [Thing] = []
+  for entityResult in result.batch.entityResults {
+    var properties : [String:Any] = [:]
+    for property in entityResult.entity.properties {
+      let key = property.key
+      switch property.value.valueType! {
+      case .integerValue(let v):
+        properties[key] = v
+      case .stringValue(let v):
+        properties[key] = v
+      default:
+        print("?")
+      }
+    }
+    let entity = try PropertiesDecoder.decode(Thing.self, from:properties)
+    entities.append(entity)
+  }
+  print("\(entities)")
 }
 
 func runInsert(service: Google_Datastore_V1_DatastoreService,

  request.mutations.append(mutation)
  
  let result = try service.commit(request)
  print("\(result)")
}

func prepareService() throws -> Google_Datastore_V1_DatastoreService? {

  return service
}

Group {
  $0.command("insert") { (number:Int) in
    if let service = try prepareService() {
      try runInsert(service:service, number:number)
    }
  }

  $0.command("delete") { (id:Int) in
    if let service = try prepareService() {
      try runDelete(service:service, kind:"Thing", id:Int64(id))
    }
  }
  
  $0.command("query") {
    if let service = try prepareService() {
      try runSelectQuery(service:service)
    }
  }
  
  }.run()
