Code Monkey home page Code Monkey logo

Comments (9)

jmealo avatar jmealo commented on May 4, 2024 1

@smilliken I'd like to see PostgreSQL schema to capnproto and protobuf conversion in general, even if it's in an external package. @begriffs maybe once logical decoding and streaming are a thing this could be used for that depending on whatever haskell supports best.

from postgrest.

begriffs avatar begriffs commented on May 4, 2024

Perhaps send raml if client requests application/raml+yaml

from postgrest.

smilliken avatar smilliken commented on May 4, 2024

There's a lot of fragmentation for schema description and serialization formats, and everyone's going to have a different favorite. I'd recommend designing this feature so it's easy to support other formats. Here's a few others:

https://capnproto.org/
https://github.com/google/protobuf/
https://thrift.apache.org/
https://github.com/Microsoft/bond
http://msgpack.org/

from postgrest.

affogato avatar affogato commented on May 4, 2024

I'm very interested in this feature, and considering forking to implement it.
Has there been any progress, is anyone planning to or in the middle of working on it?

from postgrest.

begriffs avatar begriffs commented on May 4, 2024

Go right ahead, I'd love your help!

from postgrest.

diogob avatar diogob commented on May 4, 2024

@affogato @begriffs I'm considering starting some work on this feature. I agree (as mentioned above) that we should be able to change the output format. This should not be hard as src/PostgREST/PgStructure.hs already works with intermediary data types. Here's how I'm planning to implement:

  1. Move TableOptions data type from App to PgStructure since it deals with intermediary data types.
  2. Create a StructureConverters (name suggestions are welcome) and move the current ToJSON instances in there. Use this module for all output converters.
  3. Create a second encoder (possibly RAML).
  4. Create a function that choses the encoder based on Accept headers (similar to contentTypeForAccept).

Ideas? Feedbacks? If anyone is willing to discuss in finer details on gitter that would be great :D

from postgrest.

affogato avatar affogato commented on May 4, 2024

@diogob That would be great. I don't know Haskell, so it was a bit ambitious. If I do get to it, I'd be using a script to convert from the current response to RAML or YAML.

from postgrest.

diogob avatar diogob commented on May 4, 2024

@affogato if you implement any conversion script in this fashion please let us know here, it would be useful to implement the feature ;)

from postgrest.

begriffs avatar begriffs commented on May 4, 2024

Issue #144 is technically a duplicate of this one but that other issue has more recent momentum, so I'm closing this one. Let's move discussion over to 144.

from postgrest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.