Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
meteos77 opened this issue Nov 2, 2023 · 30 comments
Closed

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

meteos77 opened this issue Nov 2, 2023 · 30 comments

Comments

@meteos77
Copy link
Contributor

meteos77 commented Nov 2, 2023

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
Copy link
Owner

Don't know.

@textbrowser
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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
Copy link
Contributor Author

meteos77 commented Nov 2, 2023

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

@meteos77
Copy link
Contributor Author

meteos77 commented Nov 2, 2023

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
Copy link
Owner

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.

@textbrowser textbrowser changed the title External and variable application of selected documents. Allow access to recent query string. Copy and / or visible. Nov 2, 2023
@textbrowser textbrowser reopened this Nov 2, 2023
@meteos77
Copy link
Contributor Author

meteos77 commented Nov 2, 2023

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
Copy link
Owner

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

@meteos77
Copy link
Contributor Author

meteos77 commented Nov 2, 2023

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

@textbrowser
Copy link
Owner

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

@meteos77
Copy link
Contributor Author

meteos77 commented Nov 2, 2023

Every living thing has the right to live.

Are there any friendly hornets?

textbrowser added a commit that referenced this issue Dec 3, 2023
@textbrowser
Copy link
Owner

Completed.

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

@meteos77
Copy link
Contributor Author

meteos77 commented Dec 3, 2023

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
Copy link
Owner

Most unlikely. I may have a slight improvement.

@textbrowser
Copy link
Owner

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

@textbrowser
Copy link
Owner

We'll see.

@textbrowser
Copy link
Owner

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
Copy link
Contributor Author

meteos77 commented Dec 4, 2023

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
Copy link
Owner

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
Copy link
Contributor Author

meteos77 commented Dec 7, 2023

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

@meteos77
Copy link
Contributor Author

meteos77 commented Dec 7, 2023

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
Copy link
Owner

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
Copy link
Owner

There is only one clipboard buffer.

@meteos77
Copy link
Contributor Author

meteos77 commented Dec 7, 2023

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
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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
Copy link
Contributor Author

meteos77 commented Dec 7, 2023

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants