How to return an empty result? #2038
-
Hey I wondered how I can return an empty result in tests? let db = MockDatabase::new(DatabaseBackend::Postgres)
.append_query_results([vec![] as Vec<apikey::Model>]) // Append an empty SELECT result
.append_exec_results([
MockExecResult {
last_insert_id: 1,
rows_affected: 1,
},
])
.into_connection(); But this resulted in this error: Query(Internal("`query_results` buffer is empty.")) |
Beta Was this translation helpful? Give feedback.
Answered by
DenuxPlays
Dec 30, 2023
Replies: 1 comment
-
Nvm I execute more then one select so this will never work. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
DenuxPlays
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nvm I execute more then one select so this will never work.
Had to append more returns.