2026-04-22 16:03:51 +02:00
|
|
|
from __future__ import annotations
|
2026-04-21 17:42:37 +02:00
|
|
|
|
2026-04-22 16:03:51 +02:00
|
|
|
from chromy.command_inputs import QueryInput
|
2026-04-22 15:47:46 +02:00
|
|
|
from chromy.utilities import format_query_result, print_lines, run_query
|
2026-04-21 17:42:37 +02:00
|
|
|
|
|
|
|
|
|
2026-04-22 16:03:51 +02:00
|
|
|
def handle_query(command: QueryInput) -> int:
|
|
|
|
|
result = run_query(command.collection, command.query_text)
|
2026-04-21 17:42:37 +02:00
|
|
|
print_lines(format_query_result(result))
|
|
|
|
|
return 0
|