Skip to content

Instantly share code, notes, and snippets.

@AkshayChordiya
Created December 9, 2017 06:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AkshayChordiya/7b57877e11038226c4b54c919e511ab2 to your computer and use it in GitHub Desktop.
Save AkshayChordiya/7b57877e11038226c4b54c919e511ab2 to your computer and use it in GitHub Desktop.
User entity with single index
@Entity(tableName = "users", indices = arrayOf(Index("full_name")))
data class User(
@PrimaryKey(autoGenerate = true)
var id: Int = 0,
@ColumnInfo(name = "full_name")
var name: String = ""
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment