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

Skunk with CockroachDB and UNLISTEN command #593

Open
erangaeb opened this issue Dec 18, 2021 · 0 comments
Open

Skunk with CockroachDB and UNLISTEN command #593

erangaeb opened this issue Dec 18, 2021 · 0 comments

Comments

@erangaeb
Copy link

I have been working with integrating Skunk with CockroachDB. I have discussed about this integration in a blog post here.

Everything is working fine with CockroachDB integration, But I have got one issue with UNLISTEN on Postgres. Seems CockroachDB does not supports these commands yet. Due to this reason when running queries it gives following error at the end(the queries are successful, but end it raised the error for UNLISTEN * command).

Exception in thread "main" skunk.exception.PostgresErrorException: 
🔥  
🔥  Postgres ERROR 42601 raised in Error (lexer.go:246)
🔥  
🔥    Problem: At or near "unlisten": syntax error.
🔥     Detail: source SQL:
🔥  UNLISTEN *
🔥  ^
🔥  
🔥  The statement under consideration was defined
🔥    at «skunk internal»:0
🔥  
🔥    UNLISTEN *
🔥  
🔥  If this is an error you wish to trap and handle in your application, you can do
🔥  so with a SqlState extractor. For example:
🔥  
🔥    doSomething.recoverWith { case SqlState.SyntaxError(ex) =>  ...}
🔥  

skunk.exception.PostgresErrorException: At or near "unlisten": syntax error.
	at skunk.net.protocol.Query$$anon$1$$anonfun$apply$2.$anonfun$applyOrElse$12(Query.scala:179)
	at map @ skunk.net.protocol.Query$$anon$1$$anonfun$apply$2.$anonfun$applyOrElse$12(Query.scala:179)
	at modify @ skunk.util.Pool$.$anonfun$of$2(Pool.scala:91)
	at flatten$extension @ skunk.util.Pool$.$anonfun$of$2(Pool.scala:95)
	at flatMap @ skunk.net.MessageSocket$$anon$1.pump$1(MessageSocket.scala:80)
	at modify @ skunk.util.Pool$.$anonfun$of$2(Pool.scala:91)
	at flatten$extension @ skunk.util.Pool$.$anonfun$of$2(Pool.scala:95)
	at flatMap @ skunk.net.MessageSocket$$anon$1.pump$1(MessageSocket.scala:80)
	at modify @ skunk.util.Pool$.$anonfun$of$2(Pool.scala:91)
	at flatten$extension @ skunk.util.Pool$.$anonfun$of$2(Pool.scala:95)
	at flatMap @ skunk.net.MessageSocket$$anon$1.pump$1(MessageSocket.scala:80)
	at modify @ skunk.util.Pool$.$anonfun$of$2(Pool.scala:91)
	at flatten$extension @ skunk.util.Pool$.$anonfun$of$2(Pool.scala:95)

Process finished with exit code 1

Do you have any suggestion or workaround for this? As the error suggested, manually handling it with .recoverWith would be a workaround?

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant