Giter VIP home page Giter VIP logo

Comments (4)

kbrock avatar kbrock commented on May 29, 2024

closing. Think this would incur too much overhead as initialize(OPTIONS) is called for every query. Most (all?) of the time the ruby will not want to dynamically change.

OPTIONS can be used to pass extra parameters as needed.

from holycorn.

franckverrot avatar franckverrot commented on May 29, 2024

This is actually a very good question, and I've been asked many times so here's an "official" answer 😄

PG provides IMPORT FOREIGN SCHEMA that is essentially a way for it to "ask" foreign servers for their table definitions.

Most holycorn-pro users felt the need to get it, and also wanted to encapsulate more information in user mappings. I got both IMPORT FOREIGN SCHEMA and USER MAPPINGs supported there.

Any cool usage of holycorn on your side? 😉

from holycorn.

kbrock avatar kbrock commented on May 29, 2024

Thanks Frank.

I keep running into yaml in a text column and wanting a way to parse in Postgres. So something like pl/ruby (or lua or js - but ruby would be the best) to allow queries to extract a column, change it or join.

Your video on the three possible options was great. I do wonder what pl/mruby would be like. But the fdw bridge seems to buy a lot in its own right.

Didn't get the chance to even get holycorn up and running yet. Little intimidated.
Also, not sure it would help us without where or joins.

Thanks for the great video, project, and I'll share what I find.

from holycorn.

franckverrot avatar franckverrot commented on May 29, 2024

Long overdue but finally decided to open source IMPORT FOREIGN SCHEMA (code) (hacktoberfest is great ahah).

Anyways, you can do something like this now:

IMPORT FOREIGN SCHEMA holycorn_schema
FROM SERVER holycorn_server
INTO holycorn_tables
OPTIONS ( wrapper_class '...'
        , foo 'bar'
        , baz 'bat'
        );

and you'll end up with foo and baz passed within a hash to the #import_schema method of your wrapper class.

If you were dynamically generating mappings before, then you could pass some information from that SQL statement to the wrapper, and decide what to do in Ruby-land code.

Hope this helps.

from holycorn.

Related Issues (2)

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.