Code Monkey home page Code Monkey logo

Comments (7)

pawurb avatar pawurb commented on August 17, 2024

Hi, thanks for an idea. But I'm not sure what's the use case? If you need output string to work with, why won't you use the JSON format?

Also this approach seems a bit complex. Maybe instead setting ENV["RUBY_PG_EXTRAS_NO_COLORS"] = true would disable the colorize method?

from ruby-pg-extras.

pawurb avatar pawurb commented on August 17, 2024

Also, in addition to disabling colors with an ENV variable you could add a new in_format option e.g. ascii.

from ruby-pg-extras.

matti avatar matti commented on August 17, 2024

I just want the table output as strings to be stored in files etc and not to spend time parsing json etc.

and my monkeypatch is not proposed implementation, just something I did fast.

from ruby-pg-extras.

matti avatar matti commented on August 17, 2024

and another usecase is to for example have a sinatra etc route like

get "/table_info" do
PgExtras.table_info
end

again, much easier to output text instead of json+parse

from ruby-pg-extras.

matti avatar matti commented on August 17, 2024

and, my monkeypatch is "that complex" because the pgextras code doesnt already have that ":ascii" format which would then be used by :table.

from ruby-pg-extras.

matti avatar matti commented on August 17, 2024

like, instead, :table is formatting+puts in a one go, then it could be composer of :ascii+puts

anyway, just saying that pgextras could be refactored. I'm already good with my monkeypatch.

from ruby-pg-extras.

pawurb avatar pawurb commented on August 17, 2024

Ok. I don't really see an urgent need for this feature, so if you don't feel like implementing it I'll close the issues for now.

from ruby-pg-extras.

Related Issues (11)

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.