@indexfolio/db
v0.6.0
Published
Prisma schema, migrations, and typed client for Indexfolio - open-source ETF tools for European passive investors.
Downloads
79
Maintainers
Readme
@indexfolio/db
The Prisma schema, migrations, and typed client behind Indexfolio - open-source tools for European passive investors.
This package is the single source of truth for the Indexfolio data model: the Prisma schema, its full migration history, and the generated, fully-typed client. The Indexfolio API and data pipelines both import from here, so the shape of the data lives in exactly one place.
What is Indexfolio?
Indexfolio is a free, open-source toolkit for passive investing in Europe: an ETF screener that actually understands UCITS, accumulating vs distributing funds, TERs, domiciles, and the details EU retail investors care about. No account, no paywall, no upsell.
- 🌐 App: https://www.indexfolio.dev
- 📦 Source: https://github.com/aravindasiva/indexfolio
Install
pnpm add @indexfolio/db
# or: npm install @indexfolio/db@prisma/client ships as a dependency, and prisma generate runs on install to
build the client for your platform.
Usage
Import the client and the model types straight from @indexfolio/db - you never
touch @prisma/client directly:
import { PrismaClient } from '@indexfolio/db'
const db = new PrismaClient()
const etfs = await db.eTF.findMany({
where: { isUcits: true, isAccumulating: true },
})Enums and helper types come from the same entry point:
import { Prisma, type ETF } from '@indexfolio/db'
const ter = new Prisma.Decimal(0.0022)What's inside
prisma/schema.prisma- the data model (ETFs, holdings, prices, FX rates, pipeline runs)prisma/migrations- the full, ordered migration historydist- the compiled, typed client entry point
Applying migrations
Point Prisma at the bundled schema to apply migrations from a consuming app:
prisma migrate deploy --schema node_modules/@indexfolio/db/prisma/schema.prismaLicense
MIT (c) aravindasiva. See LICENSE.
