Comments (4)
The ideal solution is to implement the postgres protocol using Crystal's IO classes (like Socket) which are non-blocking by default. It's a lot of work, but it's the best solution (many other languages implement it this way too, for example Go)
from crystal-pg.
Is there any workaround until that day comes?
from crystal-pg.
Currently, while postgres is working on the query, that is async. It's only while sending and receiving data that is sync due to libpq. There is no workaround for that.
Going native does have both that upside, and would fix the linking problems (#13 and crystal-lang/crystal#1269). However we'd no longer get new authentication schemes for free (it's looking like SCRAM will make it in soon), and small nice things like the default socket location being known will be lost or have to be reimplemented. At least the protocol isn't too complicated, especially compared to others.
from crystal-pg.
The driver is now native
from crystal-pg.
Related Issues (20)
- shards update/install/build failing at the crystal-pg step HOT 2
- What versions are supported? HOT 2
- Unhandled exception: cannot insert multiple commands into a prepared statement (PQ::PQError) HOT 3
- getting OverflowError:Arithmetic overflow HOT 6
- Error: no overload matches 'PG::Decoders.array_decoder' with type UUID.class HOT 1
- Connecting to unix socket with url HOT 3
- Shards update broken on Crystal 1.0 HOT 2
- Too many successive queries result in DB::ConnectionLost HOT 4
- Unable to connect to Cockroachdb HOT 2
- New Release 0.23.3? HOT 2
- cockroach db HOT 2
- Proper implementation of `sslmode=verify-full` HOT 2
- Unhandled exception: column "foo" does not exist (PQ::PQError) - How to insert into table without specifying all the columns HOT 1
- Time seems to drop precision when passed in as an arg using at_end_of_day HOT 5
- Tables with upcase symbols not readed HOT 2
- Error: can't cast to JSON::Any
- Add ability to automatically return `TIMESTAMPTZ`->`Time` in the Postgres session's time zone
- Exception sending query with bytea[] binary array type? HOT 2
- Support inserting `PG::Interval` instances HOT 3
- Support for fetching results in the text format
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crystal-pg.