-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Client driver for Crystal Language #18933
Comments
Hi @ansarizafar, have you tried using an established Postgres driver for Crystal? CockroachDB is wire compatible with Postgres, so you should be able to just use one if it already exists. We don't currently have sufficient bandwidth to create custom client drivers. |
CockroachDB is not fully compatible with Postgresql that's why Postgresql driver for Crystal https://github.com/will/crystal-pg don't work with CockroachDB. |
Do you have any information on what doesn't work? There should be an error message somewhere if you've tried it out and it didn't work, and that will help us understand what's missing from CockroachDB. |
Here is the error when I try to connect to latest 1.1 beta version of CockroachDB with Cryatal via Postgresql driver for Crystal https://github.com/will/crystal-pg.
|
The fact that it's a "ConnectionRefused" error means that the issue probably isn't any sort of missing functionality, but an incorrect configuration. To figure out what's misconfigured, would you mind sharing the command-line parameters that you started your CockroachDB cluster with and the connection string/options that you're passing to the driver? |
Here is how, I have started CockroackDB server
Here is the connection string passed to Crystal PG driver
|
Thanks @ansarizafar. I don't see anything obviously wrong. The two threads I'd pull on next would be:
|
Yes home domain is resolving locally. This connection string "postgres://root@home:26257?application_name=cockroach&sslmode=disable" also giving connection refused error in Crystal. |
Is there a reason you deleted your previous message? The fact that |
I forgot to start CockroachDB cluster before executing ./cockroach sql --url "postgresql://root@home:26257?application_name=cockroach&sslmode=disable" but then I started the cluster and executes the ./cockroach sql command. There was no issue, home domain was resolved successfully. |
Thanks for the clarification. In that case, I'm not sure what may be going on, and we may need to investigate manually to understand what's happening. Do you have easy repro steps for trying out the driver locally? If not, the logs from the Cockroach process and more verbose logs from the Crystal process might contain something to go off of. |
Crystal is a very exciting up coming general purpose language which is faster than Go lang. It has low memory/CPU usage and a simply syntax. Here are the step.
|
@a-robinson Is ther any progress on this issue. I am waiting for crystal support (The fastest language https://github.com/tbrand/which_is_the_fastest) |
It doesn't look like there's an easy way to get more info out of the crystal process, and I'm not seeing anything on the cockroach side. If this is blocking you, the fastest way to get a resolution will be for you to try investigating where the issue is happening. Someone from our team who's a little more familiar with the pg wire protocol may be able to take a look eventually, but no promises on it happening anytime soon since we have no familiarity with Crystal and have a lot of other work going on. cc @asubiotto as one possible person. I can provide you with a Docker image with all the installation steps done if you'd like. |
I can't even get this to work with a stock postgres database, so I'm not convinced this is a cockroach problem:
|
Postgresql works perfectly with Crystal language. I am using it from last three months without any issue. |
Fantastic. Can you look at my code and tell me what I'm doing wrong? I started up a stock postgres server that I was able to connect to with other clients, but I couldn't get this crystal driver to work. I need some help before I can make progress on the cockroach issue. |
Why require "db"??? Here is my code
|
I don't know what to tell you, but I can't get this working, and we don't have the resources now to have someone learn crystal and figure out what's going on. Here's what I tried:
This shows that psql is able to connect at root@localhost:26257.
|
I have decided to stick with PostgreSQL. |
Thanks for checking us out! |
For the record, the problem was partly exception detail being lost ( |
Please provide a client driver for Crystal language http://crystal-lang.org/
The text was updated successfully, but these errors were encountered: