janpio
Yusuf Erdogan
06/02/2021, 3:46 PMAngad Gupta
06/05/2021, 2:09 PMLesly Zerna
06/10/2021, 2:22 PMTri Nguyen
06/12/2021, 7:23 AMmkspcd
06/13/2021, 12:00 PMKenneth Gitere
06/14/2021, 4:41 AMLesly Zerna
06/14/2021, 4:45 PMPigotz
06/16/2021, 12:02 PMDaniel Olavio Ferreira
06/17/2021, 10:24 AMKenneth Gitere
06/18/2021, 5:12 PMKenneth Gitere
06/20/2021, 6:43 AMDennis
06/21/2021, 8:51 AMjm
06/21/2021, 5:06 PMschema.prisma
so I can modify with?jm
06/22/2021, 8:13 AMfunctions.config()
(https://firebase.google.com/docs/functions/config-env)
But to connect to a database, prisma uses dotenv:
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
Is it possible to access functions.config()
in schema.prisma
file? I definitely donot want to hard code user name and password.pzaenger
06/23/2021, 3:42 PMSpencer Curry
06/23/2021, 3:49 PM"\nInvalid `prisma.objects.findMany()` invocation:\n\n\n Can't reach database server at `xx.xxx.xxx.xx`:`3306`\n\nPlease make sure your database server is running at `xx.xxx.xxx.xx`:`3306`."
On my local machine I am using DATABASE_URL="<mysql://username:password@xx.xxx.xxx.xx:3306/db_name?schema=public>"
but that connection string is clearly not working on Cloud Run.
The Cloud Run docs provide a snippet to create a create a connection but I'm not sure how to convert that connection into a valid Prisma connection too...
The Node.js snippet for Private IPs from the docs
const createTcpPool = async config => {
// Extract host and port from socket address
const dbSocketAddr = process.env.DB_HOST.split(':');
// Establish a connection to the database
return await mysql.createPool({
user: process.env.DB_USER, // e.g. 'my-db-user'
password: process.env.DB_PASS, // e.g. 'my-db-password'
database: process.env.DB_NAME, // e.g. 'my-database'
host: dbSocketAddr[0], // e.g. '127.0.0.1'
port: dbSocketAddr[1], // e.g. '3306'
// ... Specify additional properties here.
...config,
});
};
Nick Schmitt
06/23/2021, 6:56 PMDennis
06/25/2021, 7:28 PMSpencer Curry
06/28/2021, 4:41 PMJakub Hrášek
07/01/2021, 10:00 AMSELECT
query on prisma.create()
?Mayke Freitas
07/04/2021, 2:35 PMEden Lane
07/06/2021, 5:12 PM.count()
query has stopped working for some reason.
I'm getting following error:
Invalid `prisma.task.aggregate()` invocation:
Failed to validate the query: `Field does not exist on enclosing type.` at `Query.aggregateTask.AggregateTask._count`
My code is
const totalCount = await prisma.task.count({
where,
});
can someone help me with that? Documentation says I'm doing everything correctlyChris Tsongas
07/06/2021, 6:33 PMexecuteOperation
method which feels more like unit testing to me, but maybe I'm wrong. Here's a post https://thenewstack.io/automatic-testing-for-graphql-apis/ about using Jest and supertest which is more like what I've done with REST APIs. Opinions or advice appreciated!manuel
07/06/2021, 8:34 PMNick
07/14/2021, 8:19 AMSeren_Modz 21
07/15/2021, 12:23 AMTimothee
07/20/2021, 2:18 PMselect
a substring to not return the whole article in my blog database, how can I achieve this ?
I tried this
return prisma.article.findMany({
orderBy: {
createdAt: 'desc',
},
select: {
createdAt: true,
id: true,
title: true,
updatedAt: true,
content: 'left(content, 15)' as any
},
});
but is says it's expecting true
or false
as a value.
Thanks for the help 🙂arun
07/24/2021, 4:45 PMNika Musić
07/27/2021, 2:52 PM