Aion-Query

 view release on metacpan or  search on metacpan

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

msgid "Квотирует скаляр для SQL-запроса."
msgstr "Quotes a scalar for an SQL query."

msgid "## query_prepare ($query, %param)"
msgstr "## query_prepare ($query, %param)"

msgid "Заменяет параметры (`%param`) в запросе (`$query`) и возвращает его. Параметры заключаются в кавычки через подпрограмму `quote`."
msgstr "Replaces the parameters (`%param`) in a query (`$query`) and returns it. Parameters are enclosed in quotes via the `quote` routine."

msgid "Параметры вида `:x` будут квотироваться с учётом флагов скаляра, которые укажут, что в нём находится: строка, целое или число с плавающÐ...
msgstr "Parameters of the form `:x` will be quoted taking into account the scalar flags, which indicate whether it contains a string, an integer or a floating point number."

msgid "Чтобы явно указать тип скаляра используйте префиксы: `:^x` – целое, `:.x` – строка, `:~x` – плавающее."
msgstr "To explicitly indicate the type of a scalar, use the prefixes: `:^x` – integer, `:.x` – string, `:~x` – floating."

msgid "## query_do ($query)"
msgstr "## query_do ($query)"

msgid "Выполняет запрос и возвращает его результат."
msgstr "Executes a request and returns its result."

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

	# use for UPDATE SET :x or INSERT SET :x
	quote {name => 'A.S.', id => 12}   # => id = 12, name = 'A.S.'
	
	[map quote, -6, "-6", 1.5, "1.5"] # --> [-6, "'-6'", 1.5, "'1.5'"]
	

=head2 query_prepare ($query, %param)

Replaces the parameters (C<%param>) in a query (C<$query>) and returns it. Parameters are enclosed in quotes via the C<quote> routine.

Parameters of the form C<:x> will be quoted taking into account the scalar flags, which indicate whether it contains a string, an integer or a floating point number.

To explicitly indicate the type of a scalar, use the prefixes: C<:^x> – integer, C<:.x> – string, C<:~x> – floating.

	query_prepare "INSERT author SET name IN (:name)", name => ["Alice", 1, 1.0]  # => INSERT author SET name IN ('Alice', 1, 1.0)
	
	query_prepare ":x :^x :.x :~x", x => "10"  # => '10' 10 10.0 '10'
	
	my $query = query_prepare "SELECT *
	FROM author
	    words*>> JOIN word:_



( run in 1.758 second using v1.01-cache-2.11-cpan-94b05bcf43c )