Date: Wed, 13 May 2026 20:18:29 +0000 From: Po-Chuan Hsieh <sunpoet@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 17ccc863e3e8 - main - databases/p5-Mojo-SQL: Add p5-Mojo-SQL 0.02 Message-ID: <6a04dc95.34987.261653f4@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=17ccc863e3e876a6c575bcebf7ab5437d26ee84b commit 17ccc863e3e876a6c575bcebf7ab5437d26ee84b Author: Po-Chuan Hsieh <sunpoet@FreeBSD.org> AuthorDate: 2026-05-13 20:17:49 +0000 Commit: Po-Chuan Hsieh <sunpoet@FreeBSD.org> CommitDate: 2026-05-13 20:17:49 +0000 databases/p5-Mojo-SQL: Add p5-Mojo-SQL 0.02 Mojo::SQL safely generates and composes SQL statements. To prevent SQL injection attacks, every ? in the input becomes a placeholder in the generated query, with the corresponding value bound to it. Partial statements can be composed recursively to build more complex queries. Literal question marks can be escaped with ??. Make partial statements optional to dynamically generate WHERE clauses. If you need a little more control over the generated SQL query, you can also bypass safety features with "sql_unsafe". But make sure to handle unsafe values yourself with appropriate escaping functions for your database. For PostgreSQL there are "escape_literal" and "escape_identifier" functions included with this module. For databases that do not support numbered placeholders like $1 and $2, you can set a custom character with the placeholder option. --- databases/Makefile | 1 + databases/p5-Mojo-SQL/Makefile | 23 +++++++++++++++++++++++ databases/p5-Mojo-SQL/distinfo | 3 +++ databases/p5-Mojo-SQL/pkg-descr | 17 +++++++++++++++++ databases/p5-Mojo-SQL/pkg-plist | 4 ++++ 5 files changed, 48 insertions(+) diff --git a/databases/Makefile b/databases/Makefile index c384e80fe54c..3753add8b27f 100644 --- a/databases/Makefile +++ b/databases/Makefile @@ -435,6 +435,7 @@ SUBDIR += p5-Memcached-libmemcached SUBDIR += p5-Metadata SUBDIR += p5-Mojo-Pg + SUBDIR += p5-Mojo-SQL SUBDIR += p5-MongoDB SUBDIR += p5-Mongoose SUBDIR += p5-MySQL-Diff diff --git a/databases/p5-Mojo-SQL/Makefile b/databases/p5-Mojo-SQL/Makefile new file mode 100644 index 000000000000..3947ddba4a29 --- /dev/null +++ b/databases/p5-Mojo-SQL/Makefile @@ -0,0 +1,23 @@ +PORTNAME= Mojo-SQL +PORTVERSION= 0.02 +CATEGORIES= databases perl5 +MASTER_SITES= CPAN +MASTER_SITE_SUBDIR= CPAN:SRI +PKGNAMEPREFIX= p5- + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= Safely generate and compose SQL statements +WWW= https://metacpan.org/dist/Mojo-SQL + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${RUN_DEPENDS} +RUN_DEPENDS= p5-Mojolicious>=9.41:www/p5-Mojolicious + +USES= perl5 +USE_PERL5= configure + +NO_ARCH= yes + +.include <bsd.port.mk> diff --git a/databases/p5-Mojo-SQL/distinfo b/databases/p5-Mojo-SQL/distinfo new file mode 100644 index 000000000000..92add1851774 --- /dev/null +++ b/databases/p5-Mojo-SQL/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1778677890 +SHA256 (Mojo-SQL-0.02.tar.gz) = 17a5312f0731ff8866f24415020a52e6763ebad84088ec906c0d62147ef3ae00 +SIZE (Mojo-SQL-0.02.tar.gz) = 7378 diff --git a/databases/p5-Mojo-SQL/pkg-descr b/databases/p5-Mojo-SQL/pkg-descr new file mode 100644 index 000000000000..374a6948767d --- /dev/null +++ b/databases/p5-Mojo-SQL/pkg-descr @@ -0,0 +1,17 @@ +Mojo::SQL safely generates and composes SQL statements. To prevent SQL injection +attacks, every ? in the input becomes a placeholder in the generated query, with +the corresponding value bound to it. Partial statements can be composed +recursively to build more complex queries. + +Literal question marks can be escaped with ??. + +Make partial statements optional to dynamically generate WHERE clauses. + +If you need a little more control over the generated SQL query, you can also +bypass safety features with "sql_unsafe". But make sure to handle unsafe values +yourself with appropriate escaping functions for your database. For PostgreSQL +there are "escape_literal" and "escape_identifier" functions included with this +module. + +For databases that do not support numbered placeholders like $1 and $2, you can +set a custom character with the placeholder option. diff --git a/databases/p5-Mojo-SQL/pkg-plist b/databases/p5-Mojo-SQL/pkg-plist new file mode 100644 index 000000000000..b9d544e27d64 --- /dev/null +++ b/databases/p5-Mojo-SQL/pkg-plist @@ -0,0 +1,4 @@ +%%SITE_PERL%%/Mojo/SQL.pm +%%SITE_PERL%%/Mojo/SQL/Statement.pm +%%PERL5_MAN3%%/Mojo::SQL.3.gz +%%PERL5_MAN3%%/Mojo::SQL::Statement.3.gzhome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a04dc95.34987.261653f4>
