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

Logging for Postgres queries #34

Closed
mainrs opened this issue Jun 12, 2023 · 4 comments
Closed

Logging for Postgres queries #34

mainrs opened this issue Jun 12, 2023 · 4 comments

Comments

@mainrs
Copy link

mainrs commented Jun 12, 2023

Hello!

Is it somehow possible to print the queries that the CLI does when segmenting a sentence? I wrote a Rust implementation based on Sqlite and want to verify that I properly query my underlying database.

I have no Lisp experience and reading the source code is really hard for be to be honest...

@tshatrov
Copy link
Owner

I believe (setf cl-postgres:*query-log* *standard-output*) will do it. There's also a macro with-log which can be used to wrap a code that performs queries (with-log ("path/to/logfile") ...)

@mainrs
Copy link
Author

mainrs commented Jun 14, 2023

Ah, so I would have to somehow load the code into a Lisp CLI and run the function, am I right? The CLI does not offer a verbose flag or anything similar to log the queries.

@krackers
Copy link

@mainrs Are you planning to share the rust implementation somewhere? I'd love to use it, mainly since it uses sqlite instead of needing postgres.

@mainrs
Copy link
Author

mainrs commented Jul 8, 2023

At some point, yes. But it is currently a large patchwork and more of a proof of concept. Especially the database conversion from Postgres to Sqlite is super hacky and a lot of manual work. I think porting the parsing logic from LISP to Rust and having some tests to check that the databases actually are the same would be a really good starting point.

@tshatrov tshatrov closed this as completed Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants