Joey
06/30/2022, 6:03 PMid String *@id*
*@default*(cuid())
, does that guarantee that no row will be created with the same id on any table, or is it just unique on that specific table?Avery Yip
06/30/2022, 6:11 PMpush
in the update is actually not being consistent.
i.e. If I push 1
and 2
, only 1
is in the array
items.map((item) =>
table.upsert({
where: {
id: item.id,
},
create: {
id: item.id,
relatedIds: [item.relatedId],
},
update: {
relatedIds: {
push: item.relatedId,
},
},
})
);
AlexSPx
06/30/2022, 8:06 PMAlexSPx
06/30/2022, 8:06 PMError: Unknown column 'datetime_precision' in 'field list'
0: migration_core::state::SchemaPush
at migration-engine\core\src\<http://state.rs:349|state.rs:349>
AlexSPx
06/30/2022, 8:06 PMgenerator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
model Quote {
id Int @id @default(autoincrement())
quote String
fromName String
From From @relation(fields: [fromName], references: [fromName])
topics Topic[]
}
model From {
fromName String @id
quotes Quote[]
}
model Topic {
name String @id
quotes Quote[]
}
AlexSPx
06/30/2022, 8:06 PMAlexSPx
06/30/2022, 8:07 PMnpx prisma migrate dev
starlord btc
06/30/2022, 9:03 PMJean Moirano
06/30/2022, 10:56 PMHarshit Aneja
07/01/2022, 2:04 AMDarryl Morley
07/01/2022, 3:48 AM{
Manufacturer: {
path: ["manufacturerID"],
not: { in: ["28", "266", "213", "234"] },
},
},
Gonzalo iniguez
07/01/2022, 6:40 AMGonzalo iniguez
07/01/2022, 6:41 AMExample
Gonzalo iniguez
07/01/2022, 6:41 AMgetClient(request: IRequest): PrismaClient {
const tenantId = this.getTenantId(request);
let client = this.clients[tenantId];
// create and cache a new client when needed
if (!client) {
const databaseUrl = process.env.DATABASE_URL!.replace('public', tenantId);
client = new PrismaClient({
datasources: {
db: {
url: databaseUrl,
},
},
});
console.log('CLIENT', client);
// setup prisma middlewares if any
client.$use(PrismaLoggingMiddleware());
this.clients[tenantId] = client;
}
return client;
}
Kay Khan
07/01/2022, 9:27 AMPrismaClientInitializationError: The provided database string is invalid. Unable to parse URL. in database URL. Please refer to the documentation in <https://www.prisma.io/docs/reference/database-reference/connection-urls> for constructing a correct connection string. In some cases, certain characters must be escaped. Please check the string for any illegal characters.
at /home/kay/checkpoint/nft-rarify/core/node_modules/@prisma/client/runtime/index.js:45403:20 {
clientVersion: '4.0.0',
errorCode: 'P1013'
DATABASE_URL="<mongodb+srv://root:rootpassword@localhost:27017/demo-db>"
any ideas why the database string is invalid?Kay Khan
07/01/2022, 10:56 AMmodel Contract {
id String @id @default(auto()) @map("_id") @db.ObjectId
address String @unique
active Boolean
last_fetch DateTime
}
I expect that if i insert a colletion with the same address it should fail? becuase of "@unique"
But i am able to insert 2 contracts with the same addressLiz Mowforth
07/01/2022, 11:03 AMThéo Casner
07/01/2022, 2:20 PMDrew
07/01/2022, 3:46 PMwrangler
it uses miniflare which is a copy of cloudflare’s network locally. From everything I’ve been reading in the docs, in order to use the prisma client in cloudflare’s network you need to import it from the @prisma/client/edge
. However, you can only use this using the data-proxy and I have a need to have multiple people developing and they can’t all be developing to one single development instance… each of them should have their own DB in Docker locally.
At this point, i haven’t gotten it to work yet, but would love to hear if anybody else has. Thanks!Ethan Phan
07/01/2022, 5:47 PMhayes
07/01/2022, 5:55 PMJunior Miksza
07/01/2022, 8:20 PMJunior Miksza
07/01/2022, 8:21 PMJunior Miksza
07/01/2022, 8:21 PMJunior Miksza
07/01/2022, 8:21 PMprisma chobo
07/01/2022, 8:42 PMYerzhan
07/02/2022, 5:43 AMDATABASE_URL="postgresql://${GCP_SQL_USER}:${GCP_SQL_PASSWORD}@${GCP_SQL_HOST}:5432/${GCP_SQL_DB}
Industrial
07/02/2022, 11:56 AM'Error: \nInvalid `prisma.todo.create()` invocation:\n\n\n Null constraint violation on the fields: ()\n at RequestHandler.handleRequestError
Industrial
07/02/2022, 11:57 AMsazz
07/02/2022, 3:42 PM