Registry / database / sine-postgres

sine-postgres

JSON →
library0.1.3jsnpmunverified

A NestJS module providing a Postgres integration service using the pg client. Current version 0.1.3, early development with frequent releases. It wraps pg with NestJS dependency injection, offering a provider for executing queries. Differentiates from TypeORM/Prisma by staying close to raw SQL with minimal abstraction. Requires NestJS 10, pg 8, and RxJS.

npm install sine-postgres
INSTALL
IMPORT
SIG · SINE-POSTGRES
S
sine-postgres
databasejavascriptv0.1.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PostgresModule
✓ import { PostgresModule } from 'sine-postgres';
✗ const PostgresModule = require('sine-postgres');
ESM only; CommonJS not supported.
PostgresService
✓ import { PostgresService } from 'sine-postgres';
✗ import { PostgresService } from './postgres.service';
Named export from package root, not local path.
InjectPostgres
✓ import { InjectPostgres } from 'sine-postgres';
✗ import { InjectPostgres } from '@nestjs/common';
Custom decorator from sine-postgres package.

Demonstrates registering the PostgresModule with configuration using environment variables.

import { Module } from '@nestjs/common'; import { PostgresModule } from 'sine-postgres'; import { AppController } from './app.controller'; import { AppService } from './app.service'; @Module({ imports: [ PostgresModule.forRoot({ host: process.env.DB_HOST ?? 'localhost', port: parseInt(process.env.DB_PORT ?? '5432'), user: process.env.DB_USER ?? 'postgres', password: process.env.DB_PASSWORD ?? '', database: process.env.DB_NAME ?? 'mydb', }), ], controllers: [AppController], providers: [AppService], }) export class AppModule {}
Debug
Known issues
breakingVersion 0.1.x may introduce breaking changes without major version bump due to pre-1.0 state.
fix
Pin to exact version and test upgrades.
affects: <1.0.0
deprecatedUsage of @InjectPostgres() decorator is deprecated in favor of constructor injection via PostgresService.
fix
Inject PostgresService directly instead of using @InjectPostgres().
affects: >=0.1.0
gotchaPostgresModule.forRoot() must be called only once; calling it again in child modules will create duplicate connections.
fix
Use forRoot() only in root AppModule and forFeature() for feature modules.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'sine-postgres' or its corresponding type declarations.
Package not installed or TypeScript module resolution misconfigured.
fix
Run 'npm install sine-postgres' and ensure tsconfig.json includes 'node' in 'types' or 'moduleResolution' is set to 'node'.
Nest can't resolve dependencies of the PostgresService (?). Please make sure that the argument PostgresModule at index [0] is available in the current context.
PostgresModule not imported in the module where PostgresService is used.
fix
Import PostgresModule in the feature module (e.g., via imports: [PostgresModule.forFeature()]).
Upgrade
Version history
0.1.3latest on npm
Audit
Dependencies
@nestjs/commonrequiredDecorators and module system
@nestjs/corerequiredNestJS application foundation
pgrequiredPostgreSQL client
rxjsrequiredReactive extensions for NestJS
Agent activity
14 hits · last 30 days
node
14
Resources
sine-postgres — npm install sine-postgres · libregistry