textbrowser / biblioteq

Archive and catalog the world for today's and tomorrow's generations! Awesome and everyware. Archiving since a long time.
https://textbrowser.github.io/biblioteq/
Other
219 stars 46 forks source link

Allow access to recent query string. Copy and / or visible. #340

Closed meteos77 closed 12 months ago

meteos77 commented 1 year ago

Is it possible to use BiblioteQ's search power to create a list of documents and then provide this list to tools launched by External Applications?

Via a style variable: BIBLIOTEQ_BOOK_MYOID_SELECT

textbrowser commented 1 year ago

Don't know.

textbrowser commented 1 year ago

Sounds like a lot of work curated for your need.

Say: 1000 entries are returned and say all columns are visible. Say, 10 * 1000 = 10,000 items passed to another process. Most processes interpret spaces as delimiters. So, BiblioteQ has to prepare such fields. All, some, which ones? Process dies anyway. What does BQ do? Inform you that your request is flawed. Which entries? Selected ones? All of them? All operating systems do not have an infinite containers for environment values. On Unix, say it's 8 MiB. exec() will certainly fail. This request supposes, say, normal selections. I would rethink my ways of doing things if I intend to pass thousands of arguments to a process. That's not normal.

textbrowser commented 1 year ago

xargs --show-limits Your environment variables take up 2407 bytes POSIX upper limit on argument length (this system): 2092697 POSIX smallest allowable upper limit on argument length (all systems): 4096 Maximum length of command we could actually use: 2090290 Size of command buffer we are actually using: 131072 Maximum parallelism (--max-procs must be no greater): 2147483647

textbrowser commented 1 year ago

Then you say, I pass five. And I say, OK, BQ is not necessary. Just do it from a terminal. Then you say, OK, I pass 100. I say, not normal and utilize your own query outside of BQ. I would suggest allowing BQ to produce the query string after a query is executed so that you can utilize the query elsewhere. Remember, BQ is a catalog. Not a process launcher, hand-me-off tool, etc.

meteos77 commented 1 year ago

I see you always have a better idea for solving my problems :-)

meteos77 commented 1 year ago

The advantage of BQ being linked to the outside world is that people like me can develop small tools in python (much more accessible than c++).

it provides a service without making a huge number of requests. exemple : https://github.com/meteos77/BQDiffunews

Thanks for xargs' explanation.

textbrowser commented 1 year ago

Nature is basic. Everything in nature, like a log, gets together a bunch of critters just because the log is there. Without the log, the critters don't get together. In cities or big towns, if a school is present, it attracts a bunch of businesses. The school's the thing. Without it, no critters.

BQ isn't meant to attract a bunch of things. It's like out there on it's own. Like it or don't. The idea of bringing everything together when some things just need to be happy on their own is too natural. Think differently.

meteos77 commented 1 year ago

Okay, I'll think differently, but

BQ is all alone in his corner, but he's the one who has information for others.

In nature, the tree can live on its own, but it bears the fruit that is necessary for other living beings to live.

textbrowser commented 1 year ago

It doesn't have to be in corners. :P It's an example.

meteos77 commented 1 year ago

What do you want BiblioteQ like a beautiful flower, it is beautiful, attractive so bees and butterflies are attracted :-)

textbrowser commented 1 year ago

And hornets, and diseases, and fungus, and rabbits, and pests. Bees are outnumbered. :)

meteos77 commented 1 year ago

Every living thing has the right to live.

Are there any friendly hornets?

textbrowser commented 12 months ago

Completed.

Clipboard copy provided. Executable option will not be available because Qt does not provide complete text of a query.

meteos77 commented 12 months ago

Thank you for creating this feature The requests are so huge (book,cd,dvd ...) that we can't see the end of it. Too bad Qt is limited (maybe they will improve this in the future).

textbrowser commented 12 months ago

Most unlikely. I may have a slight improvement.

textbrowser commented 12 months ago

We need to replace the question marks with the bound values. It will work for many of the queries.

textbrowser commented 12 months ago

We'll see.

textbrowser commented 12 months ago

However, some direct executions may not work in BQ because of pagination. Query History is just that, a history of your queries. Some may be executed externally or internally via the super wizard. Some may not be.

meteos77 commented 12 months ago

it's great because we can see what BiblioteQ is doing through our actions on the interface. it's SQL training.

My initial request was to have the result of the query in a variable to select the filtered documents to create a newletter. I was especially interested in the "book search" queries via the magnifying glass.

Now I have the impression that I'm getting the entire query in the clipboard but without the filter parameters.

textbrowser commented 11 months ago

Yes, the query string is there now. BQ will attempt to recreate the original query by refilling bound values with the original bound values. It cannot populate the clipboard with the results of the query. However, you can execute the query by copying it and pasting it in SQLite or another program. Of course, you can also export the results. There isn't a good means of exporting results such that they can be used everywhere. You can create specific search queries either in BQ or by manipulating the queries created by BQ separately.

meteos77 commented 11 months ago

Super ! Thank you very much, I'll test and let you know.

meteos77 commented 11 months ago

I can now retrieve the contents of the clipboard and extract the isbn13 from the query result.

Can we please have automatic access to the last query executed in the clipboard when opening an external application (without going through "Query History..." + Clipboard button. or a variable with the same content. I don't know which is more efficient (the variable or the clipboard)?

I've also seen that you can re-execute the query by double-clicking on it in the history :-)

Suggestion for improvement if it's not too much work of course. (if it's a saved custom query, can we have the name of the query given between "Execution Time" and "Qurey"). -> "Execution Time" "Name" "Qurey").

Thank you very much for this great new feature.

textbrowser commented 11 months ago

No, because the text overrides the entire Desktop's clipboard buffer. BQ will not exhibit hidden behavior. And there is the more import problem of clearing your clipboard buffer which may contain important information.

As for the second, I don't know. A new column and transformation of signals and slots. I'm satisfied with it and so I'll leave it at that.

textbrowser commented 11 months ago

There is only one clipboard buffer.

meteos77 commented 11 months ago

I understand about the more important things in the paper press.

It will require an extra handling but we won't do it every shift.

I'm very happy with the functionality. BiblioteQ's super-filtering is now accessible to the outside world and this allows us to see some interesting perspectives.

textbrowser commented 11 months ago

Like I recognize a query by reading it. And if I see a DELETE or an UPDATE, I'm more hesitant to execute it. I'll add a confirmation for destructive queries. But they're difficult to determine if their destructive because of their complexity. Anything to DELETE or UPDATE or whatever BQ considers destructive right now.

textbrowser commented 11 months ago

But aliases in queries that you've considered a favorite don't enhance it. Like a column showing that this is a favorite. But then BQ doesn't know their origins. So if you execute a query as a favorite once, the second time you execute it by clicking on QH, BQ has lost that information. It would have to determine if the query is one of your favorite queries. So, it's a lot of thinking for an alias.

textbrowser commented 11 months ago

Anyway, the why you did something is important to you and not to BQ. Like in a terminal, there is a history of commands. But that history doesn't tell you why you did something. Recording everything about a query in BQ is nonsense.

meteos77 commented 11 months ago

Forget it, it was a suggestion because since QH, we can re-execute a request and since it doesn't display in full, the name would have made it possible to know which one it was.

we'll go to BA and that's it.

textbrowser commented 11 months ago

You can execute it again and again and again. A query name doesn't make sense. There is no name associated with a query. You're asking for a hint or a reminder or a thing that helps you know where a query came from. I'm saying that that's silly. Someone executes a query because it creates results. If they want to execute a favorite, they go execute it. QH doesn't have enough information nor should it retain information about where a query came from. BQ doesn't catalog queries.