question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

db.getById returns list

See original GitHub issue

Describe the bug Title says it all

How to reproduce Call someDb.getById(123)

Expected behavior I expect a maximum of 1 item to be returned when calling getById, or a DuplicateIdError to be raised if multiple rows with the same id exist

Workaround This is probably unsafe…

row = someDb.getById(123)[0]

Edit: It appears that this is more of an issue with type-hinting rather than an actual problem with the type actually returned by the function

Screen Shot 2022-02-16 at 11 33 58 AM

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
aekochcommented, Feb 17, 2022

Thanks, I just tried to stand up a development environment and hit a roadblock with pytest. Totally solvable, but easier if I don’t have to.

Thanks for taking care of it. 😃

0reactions
Adwaith-Rajeshcommented, May 20, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

JPA Repository.findById() returns null but the value is exist on db
What I wanna know is repository.findById(id) method returns null, whereas data is available in the DB. Functions save() and findAll() are ...
Read more >
JpaRepository (Spring Data JPA Parent 3.0.0 API)
Flushes all pending changes to the database. T. getById(ID id). Deprecated. ... Returns a reference to the entity with the given identifier. <S...
Read more >
findById returns no results even with correct ObjectId #3079
Configuration: Mongoose 4.0.5, MongoDb 3.0.4, Node 0.12.4 Issue does not appear on Mongoose 3.8.30 My database has the following data: ...
Read more >
Derived Query Methods in Spring Data JPA Repositories
Oh, and it actually generates JPA entities from an existing database and gradually update the data ... List<User> findByName(String name)
Read more >
Controller action return types in ASP.NET Core web API
[HttpGet] public Task<List<Product>> Get() => _productContext.Products. ... return new CreatedAtActionResult(nameof(GetById), "Products", ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found