
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
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.init(client, connectionOptions)
to parse table information from running database.
// import { Adapter } from 'adminjs-sql';
// ...
const db = await Adapter.init('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')],
});
This supports ManyToOne relationship if you define a foreign key.
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 12 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.