Search code examples
androidcoding-stylesqlbritesqldelight

Prefix getter and setter with sqldelight


Is it possible to configure sqldelight to prefix all the getters and setters?

CREATE TABLE foo {
  bar TEXT 
}

bar() -> getBar()


Solution

  • At this time no, and it's unlikely we'd add it in since its a style choice we made early on. You can do it from the SQLite side by naming your column getBar instead of bar but thats probably not better.

    If this is a requirement from some other library I would recommend either changing the column name like mentioned above or creating new methods with the name you want in the implementation that just return the normal method result.