Aion-Query

 view release on metacpan or  search on metacpan

i18n/Aion/Query.ru-en.po  view on Meta::CPAN

msgid "## query_scalar ($query, %params)"
msgstr "## query_scalar ($query, %params)"

msgid "Возвращает первое значение. Запрос должен возвращать одну строку, иначе – выбрасывает исключение."
msgstr "Returns the first value. The query must return one row, otherwise it throws an exception."

msgid "## make_query_for_order ($order, $next)"
msgstr "## make_query_for_order ($order, $next)"

msgid "Создает условие запроса страницы не по смещению, а по **пагинации курсора**."
msgstr "Creates a page request condition not by offset, but by **cursor pagination**."

msgid "Для этого он получает `$order` SQL-запроса и `$next` — ссылку на следующую страницу."
msgstr "To do this, it receives `$order` of the SQL query and `$next` - a link to the next page."

msgid "Смотрите также:"
msgstr "See also:"

msgid ""
"1. Article [Paging pages on social networks\n"
"](https://habr.com/ru/articles/674714/).\n"

lib/Aion/Query.pm  view on Meta::CPAN

	eval {query_row_ref "SELECT name FROM author"}; $@  # ~> A few lines!

=head2 query_scalar ($query, %params)

Returns the first value. The query must return one row, otherwise it throws an exception.

	query_scalar "SELECT name FROM author WHERE id=2" # => Pushkin A.

=head2 make_query_for_order ($order, $next)

Creates a page request condition not by offset, but by B<cursor pagination>.

To do this, it receives C<$order> of the SQL query and C<$next> - a link to the next page.

	my ($select, $where, $order_sel) = make_query_for_order "name DESC, id ASC", undef;
	
	$select     # => name || ',' || id
	$where      # -> 1
	$order_sel  # -> undef
	
	my @rows = query "SELECT $select as next FROM author WHERE $where LIMIT 2";



( run in 0.275 second using v1.01-cache-2.11-cpan-4d50c553e7e )