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

Add support for serializing java arrays #102

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
4 participants
@gfredericks
Copy link

commented Dec 28, 2012

Is there a way I could have accomplished this (the curly-brace syntax) without editing Korma? Is there a more general way to provide for extensibility instead of just solving my particular problem (postgres arrays)?

@AlexBaranosky

This comment has been minimized.

Copy link
Member

commented Jan 3, 2013

Hi Gary, could you give unit test(s) along with your pull request?

It will server two purposes:

  • show me a typical use case for the feature
  • show me it works
@AlexBaranosky

This comment has been minimized.

Copy link
Member

commented Jan 10, 2013

@fredericksgary I think this is fine to merge in, but it needs an appropriate unit test first. Do you think you could supply one?

@gfredericks

This comment has been minimized.

Copy link
Author

commented Jan 10, 2013

Is it appropriate to merge in? I don't know of any other database it applies to besides postgres. I was more hoping that extensibility could be improved such that I can make this change in my own code without patching Korma. I created the pull request so we could discuss that.

@AlexBaranosky

This comment has been minimized.

Copy link
Member

commented Jan 10, 2013

hey @fredericksgary. You're right. It's not. I wasn't thinking when I said that. For one, I don't think the Korma interface should care about Java arrays. You shouldn't have to think about arrays in Clojure unless you are performance optimizing.

The problem with thinking about some generalized way to hook into Korma and customize/extend it is that there are so many points of entry that one might want to extend.

If you have thoughts on good ways to approach this, I'd love to hear them.

@gfredericks

This comment has been minimized.

Copy link
Author

commented Jan 11, 2013

I was trying to figure out if the str-value function could be a multimethod or a protocol. I thought there was some fundamental reason why that wouldn't work, but at the moment it's not coming to me. Do you know any reason there couldn't be a protocol for it?

@gfredericks

This comment has been minimized.

Copy link
Author

commented Jan 14, 2013

I don't know how well tested this stuff is, but I tried out the protocol idea with gfredericks@87c8be0 and the tests still passed. I think that version is basically equivalent. I don't know how messy extending a protocol to arrays is, but at worst I could just do the postgres-array stuff with a custom deftype, which would be fine I think.

Should I make a separate pull request for the defprotocol?

@eigenhombre

This comment has been minimized.

Copy link

commented Mar 17, 2014

@fredericksgary @AlexBaranosky We had a use for this today and adopted Gary's solution. It would be nice to have a more "official" solution, however, in Korma. What's the current thinking on what the best approach should be?

@immoh

This comment has been minimized.

Copy link
Member

commented Jun 8, 2015

I don't think this PR is needed, this can be done with raw.

@immoh immoh closed this Jun 8, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.