Giter VIP home page Giter VIP logo

pgec's Issues

Feature idea: PostgreSQL API

I am very impressed by the idea behind this product.

How realistic is the idea of implementing a PostgreSQL API?

The PostgreSQL API should behave like a real PostgreSQL Server.
Read operations are served from the in memory cache.
Write operations are proxyed to the PostgreSQL server.
Like the current REDIS API.

The biggest advantage of a PostgreSQL API would be the integration of PGEC without code changes for applications.

PostGIS support

Hi @shortishly,

I learned about this project from Scaling Postgres#254 - very interesting work!

I tried to replace the test data with my own data and encountered an issue. I'm using PostGIS (geometry and raster) data, which basically worked in the REST API, but unfortunately was encoded binary in the output:

image

Maybe this is how pgec handles all non-simple UDTs.

It would be great to add ST_AsBinary(), ST_AsText() or ST_AsGEOJSON() for the output PostGIS vector geometries of pgec (REST, Memcached and Redis API) and maybe ST_AsBinary() for PostGIS raster objects.

I'm happy to contribute if you point me to the code - although I don't have any knowledge in Erlang.

Best regards,
Johannes

JSONB Support

Hi Peter,

I encountered an issue when dealing with JSONB columns in a publication. When I add the test data like this:

CREATE TABLE public.json_sample (id serial PRIMARY KEY, keyval jsonb);
INSERT INTO public.json_sample (keyval) VALUES ('{"foo": "bar", "baz": 1}');

When I change the publication to this dataset, pgec seem to crash and the REST API is not available anymore:

=CRASH REPORT==== 3-Mar-2023::19:10:32.062821 === <0.6203.0> proc_lib:crash_report/4:539
  crasher:
    initial call: cowboy_stream_h:request_process/3
    pid: <0.6203.0>
    registered_name: []
    exception error: bad argument
      in function  ets:safe_fixtable/2
         called as ets:safe_fixtable(osm_rivers_sample,true)
         *** argument 1: the table identifier does not refer to an existing ETS table
      in call from ets:foldl/3 (ets.erl, line 632)
      in call from pgec_h:init/3 (src/pgec_h.erl, line 51)
      in call from cowboy_handler:execute/2 (src/cowboy_handler.erl, line 37)
      in call from cowboy_stream_h:execute/3 (src/cowboy_stream_h.erl, line 306)
      in call from cowboy_stream_h:request_process/3 (src/cowboy_stream_h.erl, line 295)
    ancestors: [<0.6201.0>,<0.217.0>,<0.216.0>,ranch_sup,<0.116.0>]
    message_queue_len: 0
    messages: []
    links: [<0.6201.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 376
    stack_size: 28
    reductions: 323
  neighbours:

=ERROR REPORT==== 3-Mar-2023::19:10:32.064281 === <0.6201.0>
Ranch listener pgec, connection process <0.6201.0>, stream 1 had its request process <0.6203.0> exit with reason badarg and stacktrace [{ets,safe_fixtable,[osm_rivers_sample,true],[{error_info,#{cause => id,module => erl_stdlib_errors}}]},{ets,foldl,3,[{file,"ets.erl"},{line,632}]},{pgec_h,init,3,[{file,"src/pgec_h.erl"},{line,51}]},{cowboy_handler,execute,2,[{file,"src/cowboy_handler.erl"},{line,37}]},{cowboy_stream_h,execute,3,[{file,"src/cowboy_stream_h.erl"},{line,306}]},{cowboy_stream_h,request_process,3,[{file,"src/cowboy_stream_h.erl"},{line,295}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]

Could look into this?

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.