Big News: Socket Selected for OpenAI's Cybersecurity Grant Program.Details
Socket
Book a DemoSign in
Socket

@qbobjx/plugins

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qbobjx/plugins

Official OBJX plugins, including timestamps, snake case naming, soft delete, tenant scope, and audit trail.

Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
271
52.25%
Maintainers
1
Weekly downloads
 
Created
Source

@qbobjx/plugins

Official OBJX plugins, including timestamps, snake case naming, soft delete, tenant scope, and audit trail.

Install

npm install @qbobjx/plugins

Quick Usage

import { col, defineModel } from '@qbobjx/core';
import {
  createSnakeCaseNamingPlugin,
  createSoftDeletePlugin,
  createTenantScopePlugin,
} from '@qbobjx/plugins';

export const Account = defineModel({
  table: 'accounts',
  columns: {
    id: col.int().primary(),
    tenantId: col.text(),
    deletedAt: col.timestamp().nullable(),
  },
  plugins: [
    createSnakeCaseNamingPlugin(),
    createTenantScopePlugin(),
    createSoftDeletePlugin(),
  ],
});

Included Plugins

  • createTimestampsPlugin()
  • createSnakeCaseNamingPlugin()
  • createSoftDeletePlugin()
  • createTenantScopePlugin()
  • createAuditTrailPlugin()

Snake Case Naming

Use createSnakeCaseNamingPlugin() when your model keys are camelCase but your physical database columns are snake_case.

import { col, defineModel } from '@qbobjx/core';
import { createSnakeCaseNamingPlugin } from '@qbobjx/plugins';

export const Account = defineModel({
  table: 'accounts',
  columns: {
    id: col.int().primary(),
    tenantId: col.text(),
    createdAt: col.timestamp(),
  },
  plugins: [
    createSnakeCaseNamingPlugin({
      exclude: ['id'],
      overrides: {
        createdAt: 'created_on',
      },
    }),
  ],
});

The compiler emits physical names like tenant_id, while hydrated rows continue to use model keys like tenantId.

Important: this plugin should be attached at model definition time. It updates column metadata in the onModelDefine hook, so adding it only as a session-global plugin is too late for remapping.

Repository examples using this pattern:

  • examples/complex-runtime
  • examples/express-api
  • examples/nestjs-api

FAQs

Package last updated on 06 Apr 2026

Did you know?

Socket

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.

Install

Related posts