npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@encodeagent/platform-helper-data

v1.2604.1061957

Published

Comprehensive TypeScript data library for the EncodeAgent platform with database utilities, query builders, migrations, and more

Downloads

2,897

Readme

@encodeagent/platform-helper-data

Comprehensive TypeScript data library for the EncodeAgent platform with database utilities, query builders, migrations, and more.

Installation

npm install @encodeagent/platform-helper-data

Features

Database Connection Management

  • Connection utilities: Connect, disconnect, and test database connections
  • Connection pooling: Efficient connection pool management
  • Multi-database support: Support for various database engines

Query Building

  • SQL Query Builder: Programmatic SQL query construction
  • Type-safe queries: TypeScript-first query building
  • Complex joins: Support for complex JOIN operations
  • WHERE clause builder: Flexible condition building

Schema Management

  • Table operations: Create, alter, and drop tables
  • Index management: Create and manage database indexes
  • Constraint handling: Foreign keys, unique constraints, and checks
  • Schema validation: Validate schema definitions

Migration System

  • Version control: Database schema versioning
  • Migration runner: Execute and rollback migrations
  • Migration generator: Create new migration files
  • Status tracking: Track migration execution status

Transaction Management

  • ACID transactions: Full transaction support
  • Isolation levels: Configurable transaction isolation
  • Transaction wrapper: Execute functions within transactions
  • Rollback handling: Automatic rollback on errors

Repository Pattern

  • Base repository: Generic repository implementation
  • CRUD operations: Standard create, read, update, delete operations
  • Query methods: Flexible query methods
  • Type safety: Full TypeScript support

Data Validation

  • Input validation: Validate data before database operations
  • Constraint checking: Verify database constraints
  • Data sanitization: Clean and sanitize input data
  • Foreign key validation: Ensure referential integrity

Performance Monitoring

  • Query logging: Track query performance
  • Performance metrics: Collect and analyze performance data
  • Query optimization: Optimize slow queries
  • Performance analysis: Comprehensive performance reporting

Backup & Recovery

  • Database backups: Create full and incremental backups
  • Backup scheduling: Automated backup scheduling
  • Restore operations: Restore from backup files
  • Backup monitoring: Track backup status and health

Usage Examples

Database Connection

import { connectDatabase, testDatabaseConnection } from '@encodeagent/platform-helper-data';

const config = {
  host: 'localhost',
  port: 5432,
  database: 'myapp',
  username: 'user',
  password: 'password'
};

// Test connection
const isConnected = await testDatabaseConnection(config);

// Connect to database
const connection = await connectDatabase(config);

Query Building

import { buildSelectQuery, buildWhereClause } from '@encodeagent/platform-helper-data';

const whereConditions = [
  { field: 'status', operator: '=', value: 'active' },
  { field: 'created_at', operator: '>', value: '2024-01-01', logic: 'AND' }
];

const query = buildSelectQuery(
  'users',
  ['id', 'name', 'email'],
  whereConditions
);

Repository Pattern

import { createRepository } from '@encodeagent/platform-helper-data';

interface User {
  id: number;
  name: string;
  email: string;
}

const userRepository = createRepository<User>({
  tableName: 'users',
  primaryKey: 'id',
  timestamps: true
});

// CRUD operations
const user = await userRepository.findById(1);
const users = await userRepository.findAll();
const newUser = await userRepository.create({ name: 'John', email: '[email protected]' });

Migrations

import { runMigrations, createMigration } from '@encodeagent/platform-helper-data';

const migrationConfig = {
  migrationsPath: './migrations',
  tableName: 'migrations'
};

// Run pending migrations
await runMigrations(migrationConfig);

// Create new migration
const migrationId = await createMigration('add_user_table', migrationConfig);

Transactions

import { executeInTransaction } from '@encodeagent/platform-helper-data';

const result = await executeInTransaction(async (transaction) => {
  // All operations within this function will be part of the transaction
  const user = await userRepository.create({ name: 'John' });
  const profile = await profileRepository.create({ userId: user.id });
  return { user, profile };
});

Type Definitions

The library provides comprehensive TypeScript type definitions for all database operations:

  • DatabaseConfig - Database connection configuration
  • QueryResult<T> - Query result with typed rows
  • SchemaDefinition - Table schema definition
  • MigrationConfig - Migration configuration
  • TransactionOptions - Transaction settings
  • RepositoryOptions - Repository configuration
  • ValidationRules - Data validation rules
  • PerformanceMetrics - Performance monitoring data

Requirements

  • Node.js >= 20.0.0
  • TypeScript >= 5.2.0

Development

# Install dependencies
npm install

# Build the library
npm run build

# Run tests
npm test

# Run linting
npm run lint

License

UNLICENSED - Proprietary software of PrimeObjects Software Inc.

Support

For support and questions, contact: [email protected]


Part of the EncodeAgent Platform ecosystem