
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
adminjs-sql
Advanced tools
This is an inofficial AdminJS adapter which integrates SQL-based database into AdminJS.
Installation: yarn add adminjs-sql
The plugin can be registered using standard AdminJS.registerAdapter
method.
import { Adapter } from 'adminjs-sql';
import AdminJS from 'adminjs';
AdminJS.registerAdapter(Adapter);
After registration, you should call Adapter.database(client, connectionOptions)
to parse table information from running database.
// import { Adapter } from 'adminjs-sql';
// ...
const db = await Adapter.database('mysql2', {
host: DB_HOST,
port: DB_PORT,
user: DB_USER,
password: DB_PASSWORD,
database: DB_NAME,
});
After initialization, you can register resources. db.tables()
to register ALL tables in database. Or you can db.table(tableName)
to register specific table.
const adminJs = new AdminJS({
databases: [database],
resources: db.tables(),
// or
resources: [db.table('users'), db.table('posts'), db.table('comments')],
});
You can run example app with docker.
git clone https://github.com/wirekang/adminjs-sql
yarn install
yarn build
cd example/
yarn install
yarn up
yarn start
# Generating samples...
# Inserting samples...
# adminjs-sql example app is under http://localhost:33300
yarn down
adminjs-sql
collects information about tables and columns from INFORMATION_SCHEMA and converts to adminjs
. This project uses Knex Query Builder to generate SQL string.
Support Postgres.
Add unit testing.
Add more complex example app.
Contributions are welcome!!
FAQs
Raw SQL adapter for AdminJS without ORM
The npm package adminjs-sql receives a total of 0 weekly downloads. As such, adminjs-sql popularity was classified as not popular.
We found that adminjs-sql 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 supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.