Closed ShaishavGandhi closed 6 years ago
While I understand the desire for such a thing, I don't want to get too into customizations at this layer beyond the APIs already provided by the wrapped API.
This currently isn't too hard to do with a transaction and a loop:
db.newTransaction().use {
posts.forEach { db.insert("posts", it) }
}
We're likely going to move quite a bit of the functionality of this library into SQL Delight's runtime, and we won't have a way to offer bulk insertion at that layer. Because of these two facts, I'm going to resist adding something like this.
Also it looks like you are using Kotlin. I would encourage you to add such a thing as an extension function yourself for now.
Something along the lines of
db.bulkInsert(tableName = "posts", contentValues = posts)
would be nice to have. I realize that BriteDatabase is a lightweight wrapper around SQLiteOpenHelper but it might be a useful API.