https://github.com/astj/p6-sql-namedplaceholder
Perl6 port of https://github.com/cho45/SQL-NamedPlaceholder
https://github.com/astj/p6-sql-namedplaceholder
perl6 query-builder sql
Last synced: 12 months ago
JSON representation
Perl6 port of https://github.com/cho45/SQL-NamedPlaceholder
- Host: GitHub
- URL: https://github.com/astj/p6-sql-namedplaceholder
- Owner: astj
- License: artistic-2.0
- Created: 2016-12-07T15:07:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-06-15T03:15:50.000Z (almost 8 years ago)
- Last Synced: 2025-02-16T09:41:50.675Z (about 1 year ago)
- Topics: perl6, query-builder, sql
- Language: Perl 6
- Size: 18.6 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/astj/p6-SQL-NamedPlaceholder)
NAME
====
SQL::NamedPlaceholder - extension of placeholder
SYNOPSIS
========
use SQL::NamedPlaceholder;
my ($sql, $bind) = bind-named(q[
SELECT *
FROM entry
WHERE
user_id = :user_id
], {
user_id => $user_id
});
$dbh.prepare($sql).execute(|$bind);
DESCRIPTION
===========
SQL::NamedPlaceholder is extension of placeholder. This enable more readable and robust code.
FUNCTION
========
* [$sql, $bind] = bind-named($sql, $hash);
The $sql parameter is SQL string which contains named placeholders. The $hash parameter is map of bind parameters.
The returned $sql is new SQL string which contains normal placeholders ('?'), and $bind is List of bind parameters.
SYNTAX
======
* :foobar
Replace as placeholder which uses value from $hash{foobar}.
* foobar = ?, foobar > ?, foobar < ?, foobar <> ?, etc.
This is same as 'foobar (op.) :foobar'.
AUTHOR
======
astj
ORIGINAL AUTHOR
===============
This module is port of [SQL::NamedPlaceholder in Perl5](https://github.com/cho45/SQL-NamedPlaceholder).
Author of original SQL::NamedPlaceholder in Perl5 is cho45 .
SEE ALSO
========
[SQL::NamedPlaceholder in Perl5](https://github.com/cho45/SQL-NamedPlaceholder)
LICENSE
=======
This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.
Original Perl5's SQL::NamedPlaceholder is licensed under following terms:
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.