
Security News
Socket Security Analysis Is Now One Click Away on npm
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.
The idea I'm kicking around is this...
Start by defining your schema with JSON structures:
Please note this is a MAJOR not finished not even released project.
var Relational = require('relational');
var schema = new Relational().schema;
schema.addTable({
name: 'user',
columns: [{
name: 'id',
type: 'serial',
primaryKey: true
}, {
name: 'email',
type: 'text',
allowNull: false
}]
});
schema.addTable({
name: 'photo',
columns: [{
name: 'id',
type: 'serial',
primaryKey: true
}, {
name: 'description',
type: 'text'
}, {
name: 'userId',
type: 'int',
foreignKey: {
table: 'user',
column: 'id'
}
}]
});
The schema contains information about the relationships between the tables as well as the individual tables via the foreign key property on a column. What this will allow is something like this:
//continuing the last example...
// Find me users
schema.find('user');
//SELECT * FROM "user"
// Find me users, include photos, let relational figure out how to join
schema.find('user').join('photo');
//SELECT "user"."id", "user.email", "photo.id", "photo.userId",
//"photo.description" FROM "user" INNER JOIN "photo" ON "user.id" EQUALS "photo.userId"
Basically...I really fancy query builder. Something kinda like AREL maybe for ruby.
I'm not sure where I will go after that, but this at least will be really for me. This uses [node-sql] internally so it should be portable between databases with little work.
Other ideas:
FAQs
ERROR: No README.md file found!
We found that relational 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
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.

Security News
A compromised npm publish token was used to push a malicious postinstall script in cline@2.3.0, affecting the popular AI coding agent CLI with 90k weekly downloads.

Product
Socket is now scanning AI agent skills across multiple languages and ecosystems, detecting malicious behavior before developers install, starting with skills.sh's 60,000+ skills.