3

I have simple query in kotlin multiplatform project with SqlDelight database: getLast: SELECT * FROM history ORDER BY id DESC LIMIT ?; But when I try to build the app, I get such error ".....DatabaseImpl.kt: (207, 72): Unresolved reference: value_".

DatabaseImpl.kt is generated class and I can't modify it. This is the code from this class with compilation error:

 public override fun getLast(`value`: Long): Query<History> = getLast(value_) { id, time, spo2,
  pulse_rate, status ->
History(
  id,
  time,
  spo2,
  pulse_rate,
  status
) }

Why does it generate "value" as function parameter, but then use "value_" with underscore? It causes an error.

Alexander
  • 31
  • 2

1 Answers1

1

Try to use the named parameter:

getLast:
SELECT * FROM history 
ORDER BY id DESC LIMIT :rowNumbers;