Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Server, Mongoose -> Prisma. Hono integration. #483

Open
wants to merge 49 commits into
base: andrew_testing
Choose a base branch
from

Conversation

andrew-bierman
Copy link
Owner

No description provided.

andrew-bierman and others added 15 commits November 1, 2023 20:22
…11 embedded documents and wrote them into prisma/schema.prisma in 1.92s

*** WARNING ***

The following fields point to nested objects without any data:
  - Model: "users", field: "packs"
  - Model: "users", field: "trips"

Could not determine the types for the following fields:
  - Model: "itemcategories", field: "location"
  - Model: "items", field: "location"
  - Model: "packs", field: "coordinates"
  - Model: "templates", field: "geojsonField"
  - Model: "templates", field: "location"
  - Model: "users", field: "code"
  - Model: "users", field: "location"

Could not determine the types for the following fields:
  - Composite type: "UsersPacks", field: "geometry"
  - Composite type: "UsersTrips", field: "geometry"

The following fields had data stored in multiple types. Either use Json or normalize data to the wanted type:
  - Model: "items", field: "category", original data type: "Json"
  - Model: "items", field: "packs", original data type: "Json"
  - Model: "items", field: "weight", original data type: "Json"
  - Model: "packs", field: "owners", original data type: "Json"
  - Model: "trips", field: "geojson", original data type: "Json"

The following fields had data stored in multiple types. Either use Json or normalize data to the wanted type:
  - Composite type: "GeojsonsGeometry", field: "coordinates", chosen data type: "Json"
  - Composite type: "PacksScores", field: "essentialItemsScore", chosen data type: "Json"
  - Composite type: "PacksScores", field: "redundancyAndVersatilityScore", chosen data type: "Json"

Run prisma generate to generate Prisma Client.
…o-prisma-models

Replace Mongoose virtuals, statics and object methods
Copy link

cloudflare-pages bot commented Nov 11, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 24df30b
Status:🚫  Build failed.

View logs

awais-codes and others added 2 commits November 13, 2023 10:15
@awais-codes
Copy link
Collaborator

awais-codes commented Nov 15, 2023

  1. Setup standalone tRPC setup i.e no elysia.
  2. Replaced bcrypt with bcryptjs
  3. updated server package.json script and .ignore
  4. commented user routes
  5. updated prisma imports to use edge based client.

What is left:
Use prisma data proxy URL and test

@andrew-bierman
Copy link
Owner Author

andrew-bierman commented Dec 9, 2023

Below are some queries that I'm running into issues with on my side, I think mostly due to response size/length. We should be more explicit about the data we need (based on frontend). List is in progress still.

We have strict limitations using the accelerate/data proxy from prisma.

  • getPacks
  • getPublicPacks
  • getTrips
  • getPublicTrips
  • getUserFavorites

@andrew-bierman andrew-bierman changed the title WIP - Server, Mongoose -> Prisma WIP - Server, Mongoose -> Prisma. Hono integration. Dec 9, 2023
@andrew-bierman
Copy link
Owner Author

andrew-bierman commented Dec 9, 2023

  • getPhotonResults cannot read properties of undefined

@andrew-bierman
Copy link
Owner Author

Note, need to add values from env to env.dev.vars in wrangler toml for development environment. Be sure not to commit these to repo.

@andrew-bierman
Copy link
Owner Author

andrew-bierman commented Dec 11, 2023

DATABASE_URL will need to be updated to a prisma connection pooling URL for something like prisma accelerate to work properly on edge

Edit: it is now the MONGODB_URI

@andrew-bierman andrew-bierman changed the base branch from fix/server-side-issues-with-new-models to andrew_testing December 12, 2023 02:02
Copy link

render bot commented Dec 12, 2023

Copy link

render bot commented Dec 12, 2023

A deploy for your Render PR Server at https://packrat-dev-pr-483.onrender.com just failed.

View details on your dashboard at https://dashboard.render.com/web/srv-clrrvl146foc73c8vbe0.


datasource db {
provider = "mongodb"
url = env("MONDODB_URI")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
url = env("MONDODB_URI")
url = env("MONGODB_URI")

id: userId,
},
include: {
favorites: true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
favorites: true,
favoriteDocuments: true,

@@ -0,0 +1,29 @@
const findOrCreateMany = async (ids, nodes) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to fix error : this might be undefined

Suggested change
const findOrCreateMany = async (ids, nodes) => {
async function findOrCreateMany(ids, nodes) {

Copy link

render bot commented Dec 24, 2023

A deploy for your Render PR Server at https://packrat-dev-pr-483.onrender.com just failed.

View details on your dashboard at https://dashboard.render.com/web/srv-clrrvl146foc73c8vbe0.

Copy link

render bot commented Dec 24, 2023

A deploy for your Render PR Server at https://packrat-dev-pr-483.onrender.com just failed.

View details on your dashboard at https://dashboard.render.com/web/srv-clrrvl146foc73c8vbe0.

2 similar comments
Copy link

render bot commented Dec 27, 2023

A deploy for your Render PR Server at https://packrat-dev-pr-483.onrender.com just failed.

View details on your dashboard at https://dashboard.render.com/web/srv-clrrvl146foc73c8vbe0.

Copy link

render bot commented Feb 18, 2024

A deploy for your Render PR Server at https://packrat-dev-pr-483.onrender.com just failed.

View details on your dashboard at https://dashboard.render.com/web/srv-clrrvl146foc73c8vbe0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants