
Research
Shai-Hulud Descends to Hades: Miasma Worm Campaign Spreads with New PyPI Wave
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.
graphile-sql-expression-validator
Advanced tools
Graphile plugin for SQL expression validation and AST normalization
A Graphile plugin for SQL expression validation and AST normalization. This plugin validates SQL expressions at the GraphQL layer before they reach the database, preventing SQL injection and ensuring only safe expressions are executed.
npm install graphile-sql-expression-validator
Tag columns that contain SQL expressions with @sqlExpression:
COMMENT ON COLUMN metaschema_public.field.default_value IS E'@sqlExpression';
The plugin will automatically look for a companion *_ast column (e.g., default_value_ast) to store the parsed AST.
By default, the plugin looks for a companion column named <column>_ast. You can override this with @rawSqlAstField:
-- Use a custom AST column name
COMMENT ON COLUMN metaschema_public.field.default_value IS E'@sqlExpression\n@rawSqlAstField my_custom_ast_column';
If @rawSqlAstField points to a non-existent column, the plugin will throw an error. If not specified, it falls back to the <column>_ast convention (and silently skips AST storage if that column doesn't exist).
import SqlExpressionValidatorPlugin from 'graphile-sql-expression-validator';
const postgraphileOptions = {
appendPlugins: [SqlExpressionValidatorPlugin],
graphileBuildOptions: {
sqlExpressionValidator: {
// Optional: Additional allowed functions beyond defaults
allowedFunctions: ['my_custom_function'],
// Optional: Allowed schema names for schema-qualified functions
allowedSchemas: ['my_schema'],
// Optional: Maximum expression length (default: 10000)
maxExpressionLength: 5000,
// Optional: Auto-allow schemas owned by the current database
// Queries: SELECT schema_name FROM metaschema_public.schema
// WHERE database_id = jwt_private.current_database_id()
allowOwnedSchemas: true,
// Optional: Custom hook for dynamic schema resolution
getAdditionalAllowedSchemas: async (context) => {
// Return additional allowed schemas based on request context
return ['dynamic_schema'];
},
},
},
};
@sqlExpressionuuid_generate_v4gen_random_uuidnowcurrent_timestampcurrent_datecurrent_timelocaltimelocaltimestampclock_timestampstatement_timestamptransaction_timestamptimeofdayrandomsetseedparseAndValidateSqlExpression(expression, options)Parse and validate a SQL expression string.
import { parseAndValidateSqlExpression } from 'graphile-sql-expression-validator';
const result = parseAndValidateSqlExpression('uuid_generate_v4()');
// { valid: true, ast: {...}, canonicalText: 'uuid_generate_v4()' }
const invalid = parseAndValidateSqlExpression('SELECT * FROM users');
// { valid: false, error: 'Forbidden node type "SelectStmt"...' }
validateAst(ast, options)Validate an existing AST and get canonical text.
import { validateAst } from 'graphile-sql-expression-validator';
const result = validateAst(myAst);
// { valid: true, canonicalText: 'uuid_generate_v4()' }
🚀 Quickstart: Getting Up and Running Get started with modular databases in minutes. Install prerequisites and deploy your first module.
📦 Modular PostgreSQL Development with Database Packages Learn to organize PostgreSQL projects with pgpm workspaces and reusable database modules.
✏️ Authoring Database Changes Master the workflow for adding, organizing, and managing database changes with pgpm.
🧪 End-to-End PostgreSQL Testing with TypeScript Master end-to-end PostgreSQL testing with ephemeral databases, RLS testing, and CI/CD automation.
⚡ Supabase Testing Use TypeScript-first tools to test Supabase projects with realistic RLS, policies, and auth contexts.
💧 Drizzle ORM Testing Run full-stack tests with Drizzle ORM, including database setup, teardown, and RLS enforcement.
🔧 Troubleshooting Common issues and solutions for pgpm, PostgreSQL, and testing.
SET LOCAL) into queries—ideal for setting role, jwt.claims, and other session settings.libpg_query, converting SQL into parse trees.🛠 Built by the Constructive team — creators of modular Postgres tooling for secure, composable backends. If you like our work, contribute on GitHub.
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
FAQs
SQL expression validation for PostGraphile v5
The npm package graphile-sql-expression-validator receives a total of 310 weekly downloads. As such, graphile-sql-expression-validator popularity was classified as not popular.
We found that graphile-sql-expression-validator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.

Security News
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.