-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add functional client creator and documentation
- Loading branch information
1 parent
093394e
commit 7d47693
Showing
2 changed files
with
45 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# NodeJS Mongo support for the Kapeta project | ||
|
||
Creates a client using Prisma and connects to a MongoDB database. | ||
|
||
Is meant to be used with Kapeta and resources defined in a NodeJS Kapeta block. | ||
|
||
Uses Prisma to make it simple to work with MongoDB from Kapeta - and | ||
adds support for DB migrations. | ||
|
||
Also exposes a CLI tool called ```kap-mongodb-url``` that can be used | ||
to generate a Mongo database URL from within a Kapeta block - for a given environment. | ||
|
||
To learn more about Kapeta, visit [kapeta.com](https://kapeta.com). | ||
|
||
## Usage | ||
|
||
This library exposes a class and function that can be used to create a client. | ||
|
||
Normal usage is generated using Kapeta - but it can also be used directly. | ||
|
||
### `createMongoDBClient` | ||
Async function that creates a client using Prisma and connects to a MongoDB database | ||
|
||
### `MongoDB` | ||
Class that creates a client using Prisma and connects to a MongoDB database. | ||
It will auto-initialize once the configuration provider is ready. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters