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.

Incorrect type of cursor value

See original GitHub issue

I have an IDB scheme https://github.com/translate-tools/linguist/blob/4da90de9e406442ab78df591bad04d7e6b93cdf3/src/requests/backend/translations/idb/schema/v2.ts#L8-L16

Here i use cursor value https://github.com/translate-tools/linguist/blob/4da90de9e406442ab78df591bad04d7e6b93cdf3/src/requests/backend/translations/data.ts#L135

And i found that type of cursor value incorrect, when my test failed. The type is not contains a “keyPath” that i defined here https://github.com/translate-tools/linguist/blob/4da90de9e406442ab78df591bad04d7e6b93cdf3/src/requests/backend/translations/idb/schema/v2.ts#L59-L62

So cursor value contains not only properties of type ITranslationEntry but also property id that is auto incremented number.

It’s my temporary fix for test https://github.com/translate-tools/linguist/blob/4da90de9e406442ab78df591bad04d7e6b93cdf3/src/requests/backend/translations/data.test.ts#L40-L42 and i have to refactor a lot of code to remove this unnecessary property.

Let’s improve types. We can add a keyPath to a IDB scheme and merge it to a cursor value type and in another places when we get values from IDB

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jakearchibaldcommented, Nov 14, 2022

I’ll find some time to take a close look at that. Sorry I haven’t so far.

0reactions
dumbmattercommented, Nov 12, 2022

I think my PR #252 solves this issue - add and put accept an object with or without the auto incrementing keyPath being present, but any object returned from the database has the keyPath value defined. Example

Read more comments on GitHub >

github_iconTop Results From Across the Web

sqlite cursor returning wrong value for a column - Stack Overflow
why I am getting from the database null from column url ? I am adding data in sqlite like this void addObjects(Objects object)...
Read more >
cursor - CSS: Cascading Style Sheets - MDN Web Docs
The cursor CSS property sets the mouse cursor, if any, to show when the mouse pointer is over an element.
Read more >
Cursor Attributes
A cursor attribute that can be appended to the name of a cursor or cursor variable. Before the first fetch from an open...
Read more >
ORA-01001: invalid cursor tips - Burleson Consulting
Cause: Either a host language program call specified an invalid cursor or the value of the MAXOPENCURSORS option in the precompiler command were...
Read more >
Cursor attributes (PL/SQL) - IBM
This attribute is used to determine whether a cursor contains rows after the execution of a FETCH statement. If FETCH statement execution was...
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