Giter Site home page Giter Site logo

Comments (33)

okbob avatar okbob commented on July 17, 2024

from pspg.

muhmud avatar muhmud commented on July 17, 2024

sqlcl has some of the most advanced scripting functionality I've ever seen in a command line SQL client. I'm able to write JavaScript that uses the Java libraries and control everything, even getting it to output to a pager, which I've just tested successfully.

I'm doing this for my qsh project.

Thanks for the pipe, I'll give that a go for now!

from pspg.

muhmud avatar muhmud commented on July 17, 2024

I came up with this in the end:

sed '1d; 2s/\x1b\[[0-9;]*[mG]//g; 3s/_/-/g' oracle-sqlcl.output.txt | pspg         

I think is probably good enough for what I need to do, can close this one also if you want.

from pspg.

okbob avatar okbob commented on July 17, 2024

from pspg.

muhmud avatar muhmud commented on July 17, 2024

Any ideas why this file would be weird in pspg? If you scroll the first row, the second row doesn't scroll.

strange.txt

from pspg.

okbob avatar okbob commented on July 17, 2024

from pspg.

muhmud avatar muhmud commented on July 17, 2024

OK, understand, will try & figure out where that line went, thanks

from pspg.

okbob avatar okbob commented on July 17, 2024

from pspg.

okbob avatar okbob commented on July 17, 2024

I checked more documentation, and I think so ANSICONSOLE format cannot be supported. SQLcl mix lines with column names with line with underscore together, and I cannot to emulate this effect in pspg. And printing the line with underscores on separate line doesn't look well (I'll implemented, but the it will not be officially supported). I think so DEFAULT format can be supported. Just the problem with missing footer line should be fixed. I checked documentation, and sometimes number of rows was printed, sometimes not.

from pspg.

okbob avatar okbob commented on July 17, 2024

with last commit I can read all files that you sent. Please, can you check it?

from pspg.

muhmud avatar muhmud commented on July 17, 2024

Hey, that's great! Will take & look tomorrow and let you know

from pspg.

muhmud avatar muhmud commented on July 17, 2024

Just tried it out & everything is working great :)

I saw that when the column headers are repeated it kind of works, but I think this will be fine. There is a sqlcl (and sqlplus) setting called pagesize, however, the maximum value you can set it to is only 50000. I decompiled the Java code for sqlcl and found that this is used to actually populate a sqlcl context property called script.runner.setpagesize, which you can set directly to any value, so I update this to 1000000, which I think should work for most cases.

Having the footer not be a problem is great, and it's also really cool that it works with ansiconsole format. I wanted people to able to use a different pager if they didn't have pspg installed, so this will mean it works in less.

Top job!

from pspg.

okbob avatar okbob commented on July 17, 2024

from pspg.

muhmud avatar muhmud commented on July 17, 2024

Yes, absolutely, will do a pull request; this will reference qsh, as I currently haven't seen anybody else make paging work for it.

I thinking I could also do a very cutdown single script you could use just for the paging functionality, will include that also

from pspg.

okbob avatar okbob commented on July 17, 2024

from pspg.

muhmud avatar muhmud commented on July 17, 2024

Hey, got a slight issue with the attached file, the column name gets repeated.

sqlcl.output.txt

from pspg.

okbob avatar okbob commented on July 17, 2024

Can me send a screenshots? I see correct output. What options do you use for pspg?

from pspg.

muhmud avatar muhmud commented on July 17, 2024

I've got $PSPG set to -XFb --no-bars --no-mouse --no-scrollbar --bold-labels -s 17.

This is what I'm seeing:

image

from pspg.

okbob avatar okbob commented on July 17, 2024

from pspg.

okbob avatar okbob commented on July 17, 2024

last commit should to fix it. Please, check it.

from pspg.

muhmud avatar muhmud commented on July 17, 2024

I'm using the latest commit on master, but something is definitely wrong; I don't seem to get any output for all types of different files that normally work fine.

I tried with the current pspg release and they work, but with the build from master I get nothing. Try the sqlcl.output.txt file from before

from pspg.

okbob avatar okbob commented on July 17, 2024

There is something strange - I cannot to reproduce it. It is working on my comp without any problem.

Can you recheck compilation? Can you send me a log file? run pspg with parameter --log

from pspg.

muhmud avatar muhmud commented on July 17, 2024

Yep, not sure what is going on. I've recloned the repo and did a new build, but I'm getting the same thing.

I attached the configure and make logs for the build and the log files for both the original and new versions. The new version thinks there are no rows in the file for some reason.

pspg-new.log
pspg-orig.log
make.log
configure.log

from pspg.

okbob avatar okbob commented on July 17, 2024

from pspg.

muhmud avatar muhmud commented on July 17, 2024

Actually, I think I've found the issue: if I pipe into pspg I get the problem, but if I use the file as a parameter it's fine :)

from pspg.

okbob avatar okbob commented on July 17, 2024

from pspg.

muhmud avatar muhmud commented on July 17, 2024

Yep, I'm using a pipe, but this has always worked for me before. I've tried in xterm and I'm getting the same issue.

I'm running Manjaro linux, and I don't think my setup is crazy.

from pspg.

okbob avatar okbob commented on July 17, 2024

from pspg.

okbob avatar okbob commented on July 17, 2024

from pspg.

muhmud avatar muhmud commented on July 17, 2024

👍 👍

from pspg.

okbob avatar okbob commented on July 17, 2024

please. can you check last commit?

from pspg.

muhmud avatar muhmud commented on July 17, 2024

Looks good!

from pspg.

okbob avatar okbob commented on July 17, 2024

from pspg.

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.