1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-02 01:20:54 +00:00

New port: databases/pgsanity

PgSanity checks the syntax of PostgreSQL SQL files.

It does this by leveraging the ecpg command which is traditionally
used for preparing C files with embedded SQL for compilation.
However, as part of that preparation, ecpg checks the embedded SQL
statements for syntax errors using the exact same parser that is in
PostgreSQL.

So the approach that PgSanity takes is to take a file that has a list
of bare SQL in it, make that file look like a C file with embedded
SQL, run it through ecpg and let ecpg report on the syntax errors of
the SQL.

WWW: https://github.com/markdrago/pgsanity

PR:		226689
Submitted by:	0mp
This commit is contained in:
Tobias Kortkamp 2018-03-18 12:31:13 +00:00
parent 7ab227424d
commit 43c4f5172b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=464904
4 changed files with 53 additions and 0 deletions

View File

@ -601,6 +601,7 @@
SUBDIR += pgreplay
SUBDIR += pgroonga
SUBDIR += pgrouting
SUBDIR += pgsanity
SUBDIR += pgsphere
SUBDIR += pgtcl
SUBDIR += pgtop

View File

@ -0,0 +1,35 @@
# $FreeBSD$
PORTNAME= pgsanity
DISTVERSIONPREFIX= v
DISTVERSION= 0.2.8-16
DISTVERSIONSUFFIX= -gd82a5be
CATEGORIES= databases python
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= 0mp@FreeBSD.org
COMMENT= Check syntax of PostgreSQL SQL files
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= pgsql python
USE_PYTHON= autoplist concurrent distutils
USE_GITHUB= yes
GH_ACCOUNT= markdrago
NO_ARCH= yes
OPTIONS_DEFINE= DOCS
PORTDOCS= README.md
do-test:
@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${PYDISTUTILS_SETUP} test)
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
TIMESTAMP = 1521374534
SHA256 (markdrago-pgsanity-v0.2.8-16-gd82a5be_GH0.tar.gz) = 6f08f723f08d2eee201fff8f0fdb855d7c7bb0b7e9063cff428c03b4b37f7eee
SIZE (markdrago-pgsanity-v0.2.8-16-gd82a5be_GH0.tar.gz) = 7673

View File

@ -0,0 +1,14 @@
PgSanity checks the syntax of PostgreSQL SQL files.
It does this by leveraging the ecpg command which is traditionally
used for preparing C files with embedded SQL for compilation.
However, as part of that preparation, ecpg checks the embedded SQL
statements for syntax errors using the exact same parser that is in
PostgreSQL.
So the approach that PgSanity takes is to take a file that has a list
of bare SQL in it, make that file look like a C file with embedded
SQL, run it through ecpg and let ecpg report on the syntax errors of
the SQL.
WWW: https://github.com/markdrago/pgsanity