Skip to content

Added a simple test executable#34

Merged
dutow merged 1 commit intoPercona-Lab:mainfrom
dutow:testexecutable
Mar 9, 2026
Merged

Added a simple test executable#34
dutow merged 1 commit intoPercona-Lab:mainfrom
dutow:testexecutable

Conversation

@dutow
Copy link
Collaborator

@dutow dutow commented Feb 19, 2026

Compared to psql, which completes the device flow this test executable simply receives a token on the command line, and executes a query.

We can also showcase this for the open issue #27 how using pre obtained tokens is possible.

Copy link
Collaborator

@jeltz jeltz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good but I think we need to add something somewhere to explain why this tool exists.

int ncols = PQnfields(res);
for (int i = 0; i < ncols; i++) {
if (i > 0) printf("\t");
printf("%s", PQgetvalue(res, 0, i));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not matter really but why not use fputs()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simply used printf/fprintf everywhere, no specific reason. I can change it to more specific functions or iostream if you want to, this was just one way to do it.

Compared to psql, which completes the device flow this test executable
simply receives a token on the command line, and executes a query.

We can also showcase this for the open issue Percona-Lab#27 how using pre obtained
tokens is possible.
@dutow dutow requested a review from jeltz February 25, 2026 18:46
@dutow dutow merged commit 5d991a4 into Percona-Lab:main Mar 9, 2026
9 checks passed
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

Successfully merging this pull request may close these issues.

2 participants