@subsquid/file-store
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@subsquid/csv-store

This package provides CSV based database access to squid mapping.

Usage example

const Transfers = new Table('transfers', {
    blockNumber: types.number,
    timestamp: types.timestamp,
    extrinsicHash: {type: types.string, nullable: true},
    from: types.string,
    to: types.string,
    amount: types.bigint,
})

const db = new CsvDatabase({
    tables: [Transfers],
    dest: `./data`,
    chunkSizeMb: 10,
    syncIntervalBlocks: 1_000,
})

processor.run(db, async (ctx) => {
    let transfersData: TableRecord<typeof Transfers>[] = getTransfers(ctx)
    ctx.store.write(Transfers, transfersData)
})

Readme

Keywords

none

Package Sidebar

Install

npm i @subsquid/file-store

Weekly Downloads

173

Version

2.0.0

License

GPL-3.0-or-later

Unpacked Size

48 kB

Total Files

27

Last publish

Collaborators

  • subsquid