
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
mysql-relation-query
Advanced tools
###resolves mysql relations create a TableRelationManager, add internal and external columns and have it generate mysql queries, complete with joins and everything
###Imagine the following setup Table posts
Table users
###Then you'd create a relation like this
var TableRelationManager = require('mysql-relation-query');
// base table
var Post = new TableRelationManager('posts')
// columns I want given when querying
Post.addInternalColumn('id');
Post.addInternalColumn('title');
Post.addInternalColumn('text');
/*
* external column relations
* @param sourceColumn the column in the baseTable where a reference column_value (usually id) is stored
* @param targetTable table that I want referenced by the sourceColumn's value
* @param targetReferenceColumn the column (usually id) that is used as reference value
* @param interestingColumns the columns you'll want returned when querying the foreign table
*/
Post.addExternalColumn('user_id', 'users', 'id', ['id', 'username', 'email']);
// or
Post.addForeignKey(
Post.foreignKey(user_id)
.references({table: users, column: id})
.returns(['id', 'username', 'email'])
);
// or simply generate the whole thing using a json config file
// check demoConfig.json for a demo that would result in the same Relation as the two examples above
var Configurer = require('../RelationsConfigurer');
var Post = new Configurer(require('../demoConfig.json'));
console.log(Post.generateQuery('select'));
would generate the following sql statement select posts.id, posts.title, posts.text, users.username as usersusername, users.id as usersid from posts join users on (posts.user_id = users.id)
FAQs
module modelling mysql relations
We found that mysql-relation-query demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.