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

WHERE Clause not working on enum type #1662

Open
ihsanmohamad opened this issue Sep 10, 2024 · 6 comments
Open

WHERE Clause not working on enum type #1662

ihsanmohamad opened this issue Sep 10, 2024 · 6 comments
Assignees
Labels

Comments

@ihsanmohamad
Copy link

ihsanmohamad commented Sep 10, 2024

Hey there, I'm running into an issue with the Electric-sql, and I've put together a minimal reproduction using Next.js to help illustrate the problem. I've included the schema for reference.

For some context, my main project is built with SvelteKit, and I initially thought the issue might be related to my Svelte implementation of the electric-sql TypeScript client. However, after creating this Next.js example, it seems the problem might be on enum columns.

Basically, any column defined as an enum in the schema is causing issues, while other column types are working just fine. I'm not entirely sure what's going on, but I wanted to provide this reproduction to see if anyone has encountered a similar problem or has any insights to share.

https://github.com/ihsanmohamad/react-electric-repro

@KyleAMathews
Copy link
Contributor

Hey, sorry you're running into issues. Could you modify your README with instructions on how to run the reproduction? Ideally a single command can e.g. start a docker compose file and run the migration. I don't know how to run your app as is.

@ihsanmohamad
Copy link
Author

ok, will do tomorrow.

@ihsanmohamad
Copy link
Author

hi I updated the repo. I also add the README with instructions. I'm sorry I am unable to make fully docker compose as I'm not familiar with docker and nextjs. I'll try to work on docker compose again if you have issues with the steps.

@KyleAMathews
Copy link
Contributor

Hey thanks for creating the nice reproduction! I followed the steps and did see the bug. It does seem indeed that we're for some reason not handling enums correctly. I'll mark this as a bug and raise it internally.

I'll note too that our error for a where clause to a missing column isn't great. It'd be nice if the error directly says something along the lines of "the where clause is referencing an unknown column event_id" or something along those lines.

Screenshot 2024-09-11 at 7 27 09 AM

@kevin-dp
Copy link
Contributor

We got a similar bug report on Discord yesterday. Could this be related?

@ihsanmohamad
Copy link
Author

We got a similar bug report on Discord yesterday. Could this be related?

that was me 😁

@alco alco self-assigned this Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants