Eli S
Eli S
PPrisma
Created by Spctr on 9/17/2024 in #help-and-questions
ERROR P1001: Can't reach database server
What type of database and what type of connection string is it (hiding any username/password/ip if you choose to show it)? For example if it has TLS certs in it, know that those are handled differently by prisma than regular connection strings.
10 replies
PPrisma
Created by Keith#1141 on 9/3/2024 in #help-and-questions
Clarification on Prisma and DB Congruence
@Keith#1141 Replace table with collection if you're using something like MongoDb. But basically the models model the structure in the database not in the application. The ability to reference different keys via programmatic methods (like include: {xyz:true}} is a feature of an ORM like Prisma, so you don't have to perform selects/finds on matching table's id in a different query or a subquery.
7 replies
PPrisma
Created by Keith#1141 on 9/3/2024 in #help-and-questions
Clarification on Prisma and DB Congruence
If the data is in separate tables, I'd say the models will be separate even if they are related (models model a table, not the data in your application, but can be combined in more complex types when related query elements are pulled in with an include). Say you have a User and a Password table. The User will probably have a relation to a Password id. When the User is queried with an {include: {passwordRelation: true}}, you may have some object on the queried User like {id: 20, username: "X", passwordRelation: {id:19, userId: 20, passwordhash: "somehash"}} Then the type would be User & {passwordRelation: Password}. All things in one table's rows should relate to one external key.
7 replies
PPrisma
Created by bockster6669 on 8/31/2024 in #help-and-questions
is there a `substring` method in prisma?
You can do a raw SQL query, if it's a SQL db. I think the typed SQL stuff might make that easier
7 replies