Registry / database / podverse-orm

podverse-orm

JSON →
library5.1.12jsnpmunverified

A TypeORM-based ORM for Podverse, handling database interactions for the Podcast Index ecosystem. Current stable version is 5.1.12, released on an as-needed cadence. It wraps TypeORM with pre-defined entities, repositories, and migrations tailored to Podverse's podcast metadata schema, including podcasts, episodes, users, playlists, and media refs. Key differentiator is its tight coupling with the Podverse API and built-in support for podcast namespace extensions. Not intended for general-purpose use; designed specifically for Podverse application development.

npm install podverse-orm
INSTALL
IMPORT
SIG · PODVERSE-ORM
P
podverse-orm
databasejavascriptv5.1.12
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.

Podcast
import { Podcast } from 'podverse-orm'
import Podcast from 'podverse-orm'
Named export for the Podcast entity. Default import does not exist.
getRepository
import { getRepository } from 'podverse-orm'
const { getRepository } = require('podverse-orm')
ESM-only package; CommonJS require does not work.
Episode
import { Episode } from 'podverse-orm'
import { Episode } from 'podverse-orm/lib/entity/Episode'
Deep imports into lib are not supported; use top-level named export.
createConnection
import { createConnection } from 'podverse-orm'
import { createConnection } from 'typeorm'
While TypeORM's createConnection can be used, podverse-orm wraps it with pre-configured options. Use podverse-orm's export for correct defaults.

Shows how to set up a database connection using podverse-orm, create and save a Podcast entity. Requires reflect-metadata import at entry point.

import 'reflect-metadata'; import { createConnection, Podcast, Episode } from 'podverse-orm'; async function main() { const connection = await createConnection({ type: 'postgres', host: process.env.DB_HOST ?? 'localhost', port: Number(process.env.DB_PORT) ?? 5432, username: process.env.DB_USER ?? 'postgres', password: process.env.DB_PASSWORD ?? 'password', database: process.env.DB_NAME ?? 'podverse', entities: [Podcast, Episode], synchronize: true, }); const podcastRepo = connection.getRepository(Podcast); const podcast = new Podcast(); podcast.title = 'Sample Podcast'; podcast.feedUrl = 'https://example.com/feed.xml'; await podcastRepo.save(podcast); console.log('Podcast saved with id:', podcast.id); await connection.close(); } main().catch(console.error);
Debug
Known issues
breakingTypeORM version 0.3.x changed API: createConnection is deprecated in favor of DataSource
fix
Use new DataSource instead of createConnection. podverse-orm may still export createConnection for backward compatibility, but it is recommended to migrate.
affects: >=5.0.0
deprecatedEntity constructor patterns changed: passing plain object to constructor no longer works in TypeORM 0.3.x
fix
Use Object.assign(new Entity(), data) or create entities via repository.create(data).
affects: >=5.0.0
gotchaMissing reflect-metadata import causes 'Reflect.defineMetadata is not a function' error
fix
Import 'reflect-metadata' at the top of your application entry file.
affects: >=3.0.0
gotchaThe entities list must include all used entities or they won't be registered; silent failures on save
fix
Always include all entity classes in the entities array when calling createConnection.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: Reflect.defineMetadata is not a function
reflect-metadata polyfill not imported before TypeORM decorators are used
fix
Add import 'reflect-metadata' at the very top of your entry file.
QueryFailedError: relation 'podcast' does not exist
Database tables not created because synchronize: false or migrations not run
fix
Set synchronize: true in connection options for development, or run migrations: npm run typeorm migration:run
No metadata for 'Podcast' was found
The entity class is not included in the entities array or not exported correctly
fix
Ensure the entity is imported and added to the entities array in the connection options.
Cannot use import statement outside a module
Running TypeScript code directly with node without compilation, ts-node, or proper ESM config
fix
Use ts-node to run TypeScript files directly, or compile to JavaScript first with tsc.
Upgrade
Version history
5.1.12latest on npm
Audit
Dependencies
typeormrequiredunderlying ORM for entity management and database queries
reflect-metadatarequiredrequired by TypeORM for decorator support
pgrequiredPostgreSQL driver (default database for Podverse)
Agent activity
5 hits · last 30 days
node
5
Resources
podverse-orm — npm install podverse-orm · libregistry