Skip to content

Custom Database Adapter #11009

Description

@dignifiedprediction

Documentation Issue

I want to create a custom payload database adapter, but I could not find anything about it in the database documentation, although there is a guide for custom storage adapters. Am I missing something? Is there a minimum interface that needs to be implemented ? Say, select insert select where delete, or equivalent NoSQL interfaces etc?

Additional Details

(Specifically I want to use Iroh, but I'm not asking for help with Iroh)

I can see the following being exported from db-mongodb/dist/index.js. Maybe thats a good place to start. Src is in db-mongodb/src

            beginTransaction: transactionOptions === false ? defaultBeginTransaction() : beginTransaction,
            collectionsSchemaOptions,
            commitTransaction,
            connect,
            count,
            countGlobalVersions,
            countVersions,
            create,
            createGlobal,
            createGlobalVersion,
            createMigration,
            createVersion,
            defaultIDType: 'text',
            deleteMany,
            deleteOne,
            deleteVersions,
            destroy,
            find,
            findGlobal,
            findGlobalVersions,
            findOne,
            findVersions,
            init,
            migrateFresh,
            migrationDir,
            packageName: '@payloadcms/db-mongodb',
            payload,
            prodMigrations,
            queryDrafts,
            rollbackTransaction,
            updateGlobal,
            updateGlobalVersion,
            updateOne,
            updateVersion,
            upsert

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: docsImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions