-
Notifications
You must be signed in to change notification settings - Fork 56
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
Support the COPY command #1
Comments
Thank you. Nice to hear. It's actually the first time I had to read the docs on the H.unit $ [H.q| COPY table FROM filename |] |
Well in my case the data will be coming in as a post to my web server and the database lives on another computer which does not have access to the web server filesystem. I'll need to send the data through the hasql connection. If you're using libpq internally it has some functions for doing this: http://www.postgresql.org/docs/9.3/static/libpq-copy.html |
A problem with this thing is that it only concerns Postgres, while Hasql is a general API. I have some ideas concerning this feature though. One of them requires a major revision of the whole infrastructure of Hasql libraries and implementing this feature in the API of "hasql-postgres". Alternative idea is to introduce another class in "hasql-backend", which deals with this functionality in a general way, then drivers will optionally provide instances for that class depending on whether they support such functionality. I like the first idea better, but I'll let it age for now. I will get back to this problem though when some other issues requiring a revision of the backend API will appear. |
@nikita-volkov I'd love to help implementing this feature. Any thoughts on how to do it? |
I think it should be done in the "hasql-postgres" library, since it is a
|
You may wish to change the label of this repository then, which is currently "An efficient PostgreSQL driver and a flexible mapping API" (emphasis mine) |
@ocharles Hasql is no longer general. It's now specialised to Postgres only, hence the label. |
Ok, I thought that may be the case, but just wanted to check wrt the above comment. |
If I were to implement this, in which way would I need to worry about the current dev branch? |
@rightfold The dev branch represents the ongoing development of the next major release. It already is a complete reimplementation compared to "master" and probably will get more drastic changes applied. So if you want to contribute, you probably should just branch off from "master" and we'll figure something out about merging that into the new version, once it's stabilised. |
My app needs to bulk-load data and postgres' copy mode is the fastest way to do it. Postgresql-simple supports it with this. Would be great if this library did too.
Thanks for making hasql! I'll actually be switching over to it anyway, and the copy command would be the icing on the cake.
The text was updated successfully, but these errors were encountered: