Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix column filter error #8

Closed
kcajmagic opened this issue Oct 3, 2019 · 4 comments
Closed

Fix column filter error #8

kcajmagic opened this issue Oct 3, 2019 · 4 comments
Assignees
Labels
good first issue Good for newcomers hacktoberfest good issue for hacktoberfest

Comments

@kcajmagic
Copy link
Member

The table is defined in the README.md. type is not a column in the database. In fact it is a keyword for cassandra. (It is not reserved, which is why we didn't see the problem)
This need to be fixed here:

deviceInfo, err := c.finder.findRecords(limit, "WHERE device_id = ? AND type = ?", deviceID, eventType)

suggestion:

 deviceInfo, err := c.finder.findRecords(limit, "WHERE device_id = ? AND record_type = ?", deviceID, eventType) 

If anywhere else the type column should be changed to record_type.

@kcajmagic kcajmagic added the hacktoberfest good issue for hacktoberfest label Oct 3, 2019
@iDevoid
Copy link
Contributor

iDevoid commented Oct 3, 2019

Hi @kcajmagic
I am first timer to code on open-source, can i try to do this?
I also found another line that has type = ?. is this related?

err := c.finder.findRecords(&deviceInfo, limit, "device_id = ? AND type = ?", deviceID, eventType)

@kcajmagic kcajmagic added the good first issue Good for newcomers label Oct 3, 2019
@kcajmagic
Copy link
Member Author

@iDevoid this is a perfect issue for new timers.

Yes it is related as type is also a keyword for Postgres. There will probably be more spots in that folder.

@iDevoid
Copy link
Contributor

iDevoid commented Oct 4, 2019

Hi @kcajmagic
would you mind to take a look to my PR #10 ?
please tell me your opinion and advice. Thank you 🙏

@kcajmagic
Copy link
Member Author

Fixed in PR #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers hacktoberfest good issue for hacktoberfest
Projects
None yet
Development

No branches or pull requests

2 participants