feat: add Prisma ORM #5

Open
nerdychara wants to merge 3 commits from feat/add-prisma into main
Member

Explanation

This allows the opportunity to use less hard-coded values for this particular bot. This PR should not be merged until Naomi creates a variable for the bot to use.

Issue

1

Attestations

Dependencies

  • I have pinned the dependencies to a specific patch version.

Style

  • I have run the linter and resolved any errors.
  • My pull request uses an appropriate title, matching the conventional commit standards.
  • My scope of feat/fix/chore/etc. correctly matches the nature of changes in my pull request.

Tests

  • My contribution adds new code, and I have added tests to cover it.
  • My contribution modifies existing code, and I have updated the tests to reflect these changes.
  • All new and existing tests pass locally with my changes.
  • Code coverage remains at or above the configured threshold.

Documentation

No response

Versioning

Major - My pull request introduces a breaking change.

### Explanation This allows the opportunity to use less hard-coded values for this particular bot. This PR should not be merged until Naomi creates a variable for the bot to use. ### Issue 1 ### Attestations - [x] I have read and agree to the [Code of Conduct](https://docs.nhcarrigan.com/community/coc/) - [x] I have read and agree to the [Community Guidelines](https://docs.nhcarrigan.com/community/guide/). - [x] My contribution complies with the [Contributor Covenant](https://docs.nhcarrigan.com/dev/covenant/). ### Dependencies - [x] I have pinned the dependencies to a specific patch version. ### Style - [x] I have run the linter and resolved any errors. - [x] My pull request uses an appropriate title, matching the conventional commit standards. - [x] My scope of feat/fix/chore/etc. correctly matches the nature of changes in my pull request. ### Tests - [x] My contribution adds new code, and I have added tests to cover it. - [x] My contribution modifies existing code, and I have updated the tests to reflect these changes. - [x] All new and existing tests pass locally with my changes. - [x] Code coverage remains at or above the configured threshold. ### Documentation _No response_ ### Versioning Major - My pull request introduces a breaking change.
nerdychara added 2 commits 2026-01-06 12:52:59 -08:00
able to sign in and create a local database
Node.js CI / CI (pull_request) Failing after 18s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 49s
1e25328711
nerdychara added 1 commit 2026-01-07 06:05:28 -08:00
move generated folder back to where it belongs
Node.js CI / CI (pull_request) Failing after 19s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 52s
0a0c8dc17c
Author
Member

The generatedfolder was moved back where it originally was.

The `generated`folder was moved back where it originally was.
naomi requested changes 2026-01-08 15:58:39 -08:00
naomi left a comment
Owner

https://git.nhcarrigan.com/nhcarrigan/liora is a decent example of our Prisma approach.

https://git.nhcarrigan.com/nhcarrigan/liora is a decent example of our Prisma approach.
@@ -1,2 +1,4 @@
node_modules
prod
generated/prisma
Owner

Prisma should not be creating this at all.

Prisma should not be creating this at all.
@@ -6,0 +5,4 @@
"eslint.validate": [
"typescript"
],
"prisma.pinToPrisma6": true
Owner

Also not something we set - the version is managed via the package.json file.

Also not something we set - the version is managed via the package.json file.
@@ -28,2 +29,3 @@
"discord.js": "14.21.0",
"node-schedule": "2.1.1"
"node-schedule": "2.1.1",
"prisma": "6.19"
Owner

This does not look like a proper semver. Did you install correctly?

This does not look like a proper semver. Did you install correctly?
@@ -0,0 +5,4 @@
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
generator client {
provider = "prisma-client"
Owner

This should be prisma-client-js, I believe.

This should be `prisma-client-js`, I believe.
@@ -0,0 +6,4 @@
generator client {
provider = "prisma-client"
output = "../generated/prisma"
Owner

We should not need this at all.

We should not need this at all.
@@ -0,0 +14,4 @@
url = env("DATABASE_URL")
}
model ServerData {
Owner

We should index this by serverId to optimise fetches, I think.

We should index this by serverId to optimise fetches, I think.
@@ -22,6 +23,7 @@ process.on("unhandledRejection", (error) => {
process.on("uncaughtException", (error) => {
if (error instanceof Error) {
void logger.error("Uncaught Exception", error);
void prisma.$disconnect();
Owner

This should not be necessary, why are we disconnecting the database on any uncaught exceptions?

This should not be necessary, why are we disconnecting the database on any uncaught exceptions?
@@ -0,0 +1,12 @@
import { defineConfig } from "prisma/config";
Owner

We should not need a config file at all. The schema handles all of the config we need.

We should not need a config file at all. The schema handles all of the config we need.
@@ -1,7 +1,7 @@
{
Owner

These changes are incorrect and should be reverted.

These changes are incorrect and should be reverted.
nerdychara marked the pull request as ready for review 2026-01-12 06:51:26 -08:00
Some checks are pending
Node.js CI / CI (pull_request) Failing after 19s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 52s
This pull request has changes conflicting with the target branch.
  • package.json
  • pnpm-lock.yaml
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/add-prisma:feat/add-prisma
git checkout feat/add-prisma
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/maribelle#5